If your Minecraft server runs on a VPS, you want it to start automatically after a crash or server reboot. On managed hosting the panel takes care of this, but on your own VPS you need to configure it yourself.
Method 1: systemd service
Create a service file:
/etc/systemd/system/minecraft.service
[Unit] Description=Minecraft Server After=network.target [Service] User=minecraft WorkingDirectory=/home/minecraft/server ExecStart=/usr/bin/java -Xmx4G -Xms4G -jar server.jar nogui Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
Enable and start the service:
systemctl daemon-reloadsystemctl enable minecraft- Start automatically at boot.systemctl start minecraft- Start now.
Method 2: screen or tmux
For a simpler setup you can use screen with a crontab entry:
@reboot screen -dmS mc java -Xmx4G -jar server.jar nogui
This starts the server in a screen session on every reboot. The downside: it does not automatically restart after a crash.
On the HostValues panel
Servers on the HostValues game panel restart automatically after a crash. You can also set up scheduled restarts via the schedule tab.
How do I check if my service is running?
systemctl status minecraft shows whether the service is active, when it started and recent log lines.
What if the server is stuck in a crash loop?
Systemd has a rate limiter: after 5 rapid crashes it stops trying. Fix the underlying issue (usually a corrupted world or config), then start manually with systemctl start minecraft.
Can I access the console via systemd?
Not directly. Use screen or tmux inside the systemd service if you want interactive console access, or send commands via RCON.
Tip: at HostValues you can rent a Minecraft server and be online within minutes.