With the additional info from the comments, I think, I can provide you with a walkthrough to your issue.
- Stop and disable your minecraft server, and clean-up the config files, if it's configured to start on boot. (I'm assuming you followed the tutorial all the way through). You can do this by using the following commands.
sudo systemctl stop minecraftserver
sudo systemctl disable minecraftserver
sudo rm /lib/systemd/system/minecraftserver.service
sudo systemctl daemon-reload
- Backup your world data, because we are going to purge the non-functional server.
In your setup, world data is found in three folders: /home/pi/world
, /home/pi/world_nether
and /home/pi/world_the_end
.
cd /home/pi
mkdir mc_world_backup
cp -r world world_nether world_the_end mc_world_backup/
- Now that your save is in safety, you have to clean-up (move or delete) the remains of the old server. Based on your screenshot, this is the list of files and folders, that have to be cleaned-up.
logs/
plugins/
world/
world_nether/
world_the_end/
banned-ips.json
banned-players.json
bukkit.yml
commands.yml
eula.txt
help.yml
ops.json
permissions.yml
server.properties
spigot.yml
usercache.json
whitelist.json
Note: You shouldn't delete the minecraft
folder.
If you want to delete these files, you can use the following command:
rm -rf logs/ plugins/ world/ world_nether/ world_the_end/ banned-ips.json banned-players.json bukkit.yml commands.yml eula.txt help.yml ops.json permissions.yml server.properties spigot.yml usercache.json whitelist.json
- Start a new directory and place the server executable and an eula.txt file in that folder. This will be the server's directory from now on.
mkdir mcserver
cd mcserver
cp /home/pi/minecraft/spigot-1.15.2.jar .
echo "eula=true" > eula.txt
- Create a run script and start your server from the terminal.
echo "java -Xms512M -Xmx1008M -jar spigot-1.15.2.jar nogui" > run.sh
chmod 755 run.sh
./run.sh
Note: This isn't the most optimalized command to start your server, but this will work. If you want to run your server in the most optimalized way, you should copy and paste this to your run.sh
file
java -Xms512M -Xmx1008M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar spigot-1.15.2.jar nogui
Test your server. Connect to it, and see if it loads properly. If everything works fine, shut down your server by entering stop
, and proceed to the next step.
Import your world saves. Delete the freshly generated folders world
, world_nether
and world_the_end
, and replace them with your folders, that we backed up in step 2.
rm world world_nether world_the_end
cp -r ../mc_world_backup/* .
Change the server.properties file as you wish.
Test again your results. If you've done everything correctly, by this point you should have a perfectly functional minecraft server with your old maps.
Now if you wan't to start your server, you have to cd into the mcserver
directory, and start your server with the ./run.sh
command.
cd /home/pi/mcserver
./run.sh
Optionally you could configure linux to automatically start the server for you at start-up. (Based on the tutorial you linked, with minor changes)
Create and open /lib/systemd/system/minecraftserver.service
file with a text editor. You could use nano for this, as it comes preinstalled.
sudo nano /lib/systemd/system/minecraftserver.service
Enter the following text into the editor.
[Unit]
Description=Minecraft Spigot Server
[Service]
User=pi
Group=pi
Restart=on-abort
WorkingDirectory=/home/pi/mcserver/
ExecStart=/usr/bin/env bash run.sh
[Install]
WantedBy=multi-user.target
Save this file using the Ctrl + X keyboard shortcut, and then press the y and Enter keys when prompted.
Now you should enable and start your server.
sudo systemctl enable minecraftserver
sudo systemctl start minecraftserver
And done! Your Minecraft server should start with your Raspberry Pi.
Troubleshooting
You can check the status of your server with the following command, to see if it's even running, and to see the latest few lines of log.
sudo systemctl status minecraftserver
The Raspberry Pi isn't too powerful, so your server might take some time to start. If you can't connect to it after a reboot, check the status and give it up to 15 minutes to fully start up.
Your server logs will be saved to /home/pi/mcserver/logs
folder. Here you'll find every error message your server outputs, and you could ask a separate question about them.
If you are on a local network, between restarts, your device's IP might have changed, if you can't connect with "unreachable" error messages, you might want to check out the IP of your Pi with:
sudo hostname -I
find / -name world* -type d
should list every folder that has a name starting with "world".