So I have spent around a month searching online and figuring out how to start a vanilla Minecraft server as soon ubuntu server boots, but I couldn't make it work.

Using Ubuntu Server 18.04LTS on Pentium G4560 with Intel 545s 512GB SSD with 8GB of RAM (its a physical box inside my basement so if for some reason direct access is needed)

Simply I have a Minecraft server instance in /home/petar/Minecraft and a script that i can use manually to start it up /home/username/petar/run.sh, what i found out is that you need a systemd service to run it so i made: sudo nano /etc/systemd/system/vanilla-mc.service and it goes like this:




than i used sudo systemctl enable vanilla-mc.service and i rebooted my server after it booted i typed in systemctl status vanilla-mc.service and got:

vanilla-mc.service - mc-vanilla-startup-service
Loaded: loaded (/etc/systemd/system/vanilla-mc.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-02-14 17:28:06 CET; 2h 36min ago
Main PID: 969 (code=exited, status=1/FAILURE)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.


BTW here is ./run.sh from minecraft folder:`

java -Xms1024M -Xmx3072M -jar server.jar -o true`

sorry for some reson i cant get formating to work correctly

  • Please note that ./run.sh is a working script, i use it every time manually on the server itself, tho i am running it as root every time... – Pequla Feb 14 at 19:42
  • Have you read minecraft.gamepedia.com/Tutorials/Server_startup_script ? – MatsK Feb 14 at 20:36
  • @MatsK i wonna have a secure system, i never run scripts from github, and i alweys prefere to do it myself, i woud never in my life run a script from github again, i had bad experience with it, i am running a css game server and i used a startup script from github and it turnes out i used my server to be member of bot net, i was called from my ISP to check it, i was so pissed... – Pequla Feb 16 at 7:57
  • That is your prerogative, and I agree with your security perspective, you should aways inspect the source. But as the link I provided states, Warning Since this is a wiki and anyone may modify any page at any time, it is suggested that you do not actually use this script but instead simply use it as a guideline for writing your own. – MatsK Feb 16 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.