Setup Minecraft server to start automatically

Minecraft

These instructions will allow setting up Minecraft server to launch automatically when computer starts. I used Windows 8.1 Pro machine, but setting this up on different Windows versions would be very similar.

  • First of all setup Minecraft server and make sure you can launch it manually.
  • You could skip this step and use an existing admin account (with password enabled), but it's best security practice not to give any service more permissions than it requires.
    • Create a new non-admin user account minecraft with secure password. Set password to never expire.
      New user account
    • To run scheduled task, our account will need Log on as batch job right:
      • Open Local Security Policy
      • Navigate to Local Policies > User Rights Assignment
      • Find and open policy Log on as a batch job
      • Click on Add User or Group and add your new minecraft account.
        Local Security Policy
  • Create a scheduled task:
    • Open Task Scheduler and create a new task. Setup it up in a following way:
    • General tab
      • Click on Change User and Group and select account you created in the previous step
      • Select Run whether user is logged on or not
        Task Scheduler - General Tab
    • Triggers tab
      • Click New and create a trigger
      • Under Begin the task: select At startup
      • Make sure Enabled is checked and click OK
        Task Scheduler - Triggers Tab
    • Actions tab
      • Click New and create a new Start a Program type action
      • In Program/script field enter:
        C:\ProgramData\Oracle\Java\javapath\javaw.exe
        This path may be different depending on your Java installation
      • In Add argument field enter your Minecraft server launch commands (as you would do in .bat file when starting the serve manually). I.e:
        -Xms1024M -Xmx1024M -d64 -jar "C:\DATA\minecraft_server\minecraft_server.1.8.jar" nogui
        In this particular case we are assigning 1024MB RAM to the server on a 64bit machine. Path to the server file is in quotes, and nogui tells to launch server without GUI.
      • In Start in field enter path to the directory where your server java file resides, i.e:
        C:\DATA\minecraft_server
        Task Scheduler - Actions Tab
    • Conditions tab
      • Clear all checkboxes
        Task Scheduler - Conditions Tab
    • Settings tab
      • Check Allow task to be run on demand 
      • In the drop down under If the task is already running, then the following rule applies: select Do not start a new instance
        Task Scheduler - Settings Tab
    • Now just click OK to save all changes. You will be prompted to enter your minecraft user account password.

That should be it. First run the task manually and make sure it stays running and your Minecraft server is accessible. Then restart the computer and Minecraft server should launch automatically without you even having to log-on with your user account.

If you let your computer to go into sleep mode and find that sometimes Minecraft server crashes after resuming from sleep, read this.

Windows 8.1 Pro 64bit
Minecraft Server 1.8

Newsletter

Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait