17

I have been having a difficult time configuring the Minecraft server to start with Windows. Here's the situation:

I have a Windows Server 2008 hosted at GoDaddy which I use for my web development and such. It has really powerful hardware which most of the time is not utilized (Core 2 Quad @2.5Ghz, 8GB RAM, etc). I have had the server configured to restart automatically every night at 2AM just to keep it refreshed. Well, I spent hours trying different ways to configure the Minecraft server to startup after the computer boots, but I've had no luck and finally gave up. The server hasn't been restarted in like a month thanks to that...

So, I ask for any assistance on how I can configure a scheduled task that will startup the Minecraft server after boot.

7
  • I believe every version of Windows has a "Startup" programs folder, which does just this.
    – Corey
    Dec 9, 2010 at 0:02
  • 3
    @Corey, severs generally do not auto-login as a user. Items in the Startup folder are only executed when a user logs in with Explorer.exe as the shell.
    – Zoredache
    Dec 9, 2010 at 0:27
  • I'm working on a service based minecraft server, which works at the moment just isn't pretty. I could do with some early testers to help work out dependencies etc, I'll post an answer to this Q when it's ready for anyone else to try! Jan 20, 2011 at 14:47
  • 1
    This question amounts to "how do I make an application start on Windows", and has nothing to do with gaming.
    – pppery
    Sep 30, 2020 at 21:13
  • 1
    I’m voting to close this question because this question is not about a problem specific to gaming.
    – Schism
    Sep 30, 2020 at 22:38

9 Answers 9

4

It generally doesn't work that great, but you can define you own services. You will need to figure out some way to make sure the service performs a save.

How To Create a User-Defined Service

From SF see these questions.

Create a schedule task that runs at boot

If all else fails, you may have to do as Corey suggests. Configure your server to auto-login as some account, and just place a shortcut in the startup group.

3

Edit: This app is actually quite mature and reliable now and not really an "early release" anymore. It's still being worked on and recently added support for running multiple servers at the same time (e.g. for trialling the weekly builds).


If you are happy with the "vanilla" experience, I have (as mentioned in comments) made an application that keeps Minecraft running as a service. You can download an early release direct from GitHub which gives you Vanilla Minecraft as a service with a web-based console.

1

What you're looking for is a tool that can turn any arbitrary Windows process/executable into a Windows service.

There are three tools that I can recommend get the job done:

  • SrvAny: Free but requires more in-depth technical detail to setup. Not compatible with ALL apps.
  • FireDaemon: Not free but is extremely reliable and effective. Try the 30-day trial.
  • Java Service Wrapper: Free for personal use. Works for java apps.

Set your Windows service as 'Automatic' and you're done!

1
  • You may want to make sure the service restarts itself if your server crashes. Just something to keep in mind for anyone who wants to go this route. Dec 17, 2017 at 18:56
1

On a windows machine, you don't need anything fancy or to run anything "as a service". The quickest and easiest way I've done this is using task scheduler. Simply create a basic task and point the "task/script" at the java executable (with full path): "C:\Program Files (x86)\Java\jre1.8.0_25\bin\java.exe"

and then in the optional parameters: (some of these could be wrong, but hey, it's an example) -Xms1024M -Xmx1024M -jar craftbukkit-1.7.2-R0.3-20131221.081113-1.jar -o true

I also set a "Start In" path, so I didn't have to fully reference my jar file too: D:\Minecraft

I also have a script that does a backup of the minecraft folder every night that deletes zip files after a few days. I run that at 4:00am.

So on my server I have: - the MC server startup automatically using a scheduled task at 5:00am - minecraft server auto-shutdown at 3:00am - the backup .bat file run at 4:00am - Go back to step 1.. :-)

I hope this helps someone.

2
  • NOTE: you can't run a .bat file that runs the MC server because it runs and exits the script as soon as the command is executed and I believe the server processes stop too.
    – Ads
    Oct 25, 2014 at 22:34
  • This was the easiest method I never even thought to consider. Extremely simple to get running and much appreciated. Oct 16, 2015 at 4:56
0

With os x I made a simple script that I could add that to the startup items.

I'm guessing that you could just make a shortcut to the server application and put that in your startup folder.

1
  • -1 this does not work see comments on the question. Aug 18, 2012 at 5:00
0

You can make a .txt file, rename it as whatever.cmd and then change the text to

start (the address, for example C:\Desktop\....and so on)

then in the cmd file you may use any command prompt action such as start. I hope this is helpful.

0

You could just make a batch file that starts the exe instead, have the batch shortcut in the startups folder and have it route to the minecraft_server.exe

The batch file was a workaround the issue of Windows 2008 server not allowing user login apps to start.

1
  • This works if you log into the server regularly. Just want to note that if the Windows box restarts itself after installing updates or a power outage, the minecraft server won't start until you log in. Dec 17, 2017 at 18:58
0

McMyAdmin will auto start a server on Windows as a Windows Service. You can configure it to do this during the install process. Here's a screenshot:

McMyAdmin 2 installation System Settings 'Install As Service' screenshot

However only 10 people can play at the same time using the free edition. See here for a comparison of free and paid versions of McMyAdmin: https://www.mcmyadmin.com/#/editions

Of course this won't give you the same flexibility as if you set up a Minecraft server yourself by making your own Windows Service by following the steps in the articles from others' answers. But it may be an option. I might even buy the pro version just because creating and maintaining a Minecraft management system is surely a lot of hard work. I mean, just manually setting up your own Windows service is some hard work! (I don't work for McMyAdmin. I just discovered it today.)

-1

You should run your Minecraft Server as a Windows Service to achieve what you want. There's no need to use scheduled tasks. There's a detailed guide on how to do this here:

http://forums.firedaemon.com/howtos/minecraft-server-as-a-windows-service.8/

1
  • 1
    Please summarize the information from the linked guide. That way, if the page ever goes down, your answer is still valid. Besides, it saves people a click.
    – Frank
    Aug 18, 2014 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .