
What we're doing here is changing to the directory where the server is and then running an endless loop that starts the server and then, if it ever stops, waits 10 seconds and starts it again. Enter the following code to your bash script. You can create and open the file with nano. Create a new file called mcstart.sh in the same folder as the server files (in our case, mcserver). How to Start the Raspberry Pi Minecraft Server at Bootġ. And, even if you run it from a terminal window on the Pi (or via VNC), the server is not set to restart should you need to reboot the Raspberry Pi.īelow, we'll show you how to create a script that will start the Minecraft server every time you boot the Raspberry Pi and should also restart the Minecraft server if it crashes but the Pi itself does not.

However, if you ran the server from an SSH window, it will close the moment that you close the window (unless you put "nohup" before the server load command).

Now your server should be running and you can log into it.
