F5F Stay Refreshed Software Operating Systems Launch Minecraft server automatically at startup.

Launch Minecraft server automatically at startup.

Launch Minecraft server automatically at startup.

S
smilyfries5
Member
142
11-20-2021, 04:49 AM
#1
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
S
smilyfries5
11-20-2021, 04:49 AM #1

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

B
Briellowen2
Junior Member
1
11-20-2021, 04:49 AM
#2
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.
B
Briellowen2
11-20-2021, 04:49 AM #2

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.

3
3gilad3
Senior Member
735
11-20-2021, 04:49 AM
#3
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.
3
3gilad3
11-20-2021, 04:49 AM #3

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.

A
Abood_99am
Member
115
11-20-2021, 04:49 AM
#4
Understood, I'll try it this morning and confirm back. J
A
Abood_99am
11-20-2021, 04:49 AM #4

Understood, I'll try it this morning and confirm back. J

O
Officerbacon
Member
61
11-20-2021, 04:49 AM
#5
You can also utilize cron to automate scheduling at startup.
O
Officerbacon
11-20-2021, 04:49 AM #5

You can also utilize cron to automate scheduling at startup.

K
Kittylu
Member
115
11-20-2021, 04:49 AM
#6
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!
K
Kittylu
11-20-2021, 04:49 AM #6

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!