So I run a Minecraft server on Ubuntu Desktop 12.04. It runs very well except every so often the computer does need a reboot, as it should considering it runs 24/7.

I'm relatively new to Ubuntu still so obviously I don't know how to do all the fancy (or even simple) things possible with Ubuntu.

  • How would I set the computer to automatically reboot itself every so often, like once every two days or so?
  • And then of course I would have to start the Minecraft server again so how would I run commands as well?
  • Can I set it to run a .sh on startup?
  • Oh, and if there's any way to run a terminal command before shutting down and restarting (like /stop for the server) how would I do so if this is possible?

1 Answer 1


You need to create a startup script for the minecraft. The mine craft wiki tells you how to do this: http://minecraft.gamepedia.com/Tutorials/Ubuntu_startup_script

Basically you put a configuration file (provided on that page) in /etc/init/. It also suggested that you crate a new 'minecraft' user so that the minecraft server runs as that user rather than as root.

As far as rebooting, you should need to reboot Ubuntu often. My Ubuntu computers (at home and work) are usually up for a month or more between reboots. You probably don't want to automate reboots, because then it could reboot while you are doing something on the computer.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.