Launch Minecraft server automatically at startup.
Launch Minecraft server automatically at startup.
Hi All, I'm just starting with Linux CLI and setting up a Minecraft server for my brother. Everything seems to work, but I need to SSH in and run the startup script (start.sh). It closes if I close the SSH connection. I followed the tutorial, but it didn't help. Can someone give me a reliable way to start the server? My current rc.local looks like this: # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi /home/pi/Minecraft_Server/./start.sh & exit 0 Thanks, J
If you're on Ubuntu Server, consider using "screen." It helps you preserve your session state so you can resume from where you left off even after reconnecting.
Suggest using systemd to host it as a service. Refer to the guides:
- https://minecraft.gamepedia.com/Tutorial...tup_script
- https://teilgedanken.de/Blog/post/settin...ng-systemd
This allows automatic startup without manual sign-in.
I suggest using systemd for this project.
1. Make the file /etc/systemd/system/minecraft.service
2. Open Nano to modify the file: Spoiler nano /etc/systemd/system/minecraft.service
3. Enter the details and update the path and user accordingly
4. Save and exit
5. Refresh SystemD: systemctl daemon-reload
6. Activate the service for automatic startup
7. Launch the server
8. Have fun!
Apologies for the phone-writing errors, this was on my phone too. If you run into issues, just let me know!