Run Minecraft Dedicated Server as a Windows Service with FireDaemon Pro


Minecraft Run as Windows Service



Minecraft game: Run as Windows Service


TABLE OF CONTENTS

Introduction

Minecraft is a sandbox and adventure game that takes place in a randomly generated world that is 3 times bigger than the surface area of the earth. The Minecraft Dedicated Server can be run as a Windows service using FireDaemon Pro. This allows you to start and run Minecraft automatically when Windows boots and before login. FireDaemon Pro also allows you to create multiple services so you can start multiple instances of the game server, monitor them and automatically restart those instances in the event they crash. FireDaemon Fusion can also be used to manage your Minecraft Dedicated Server, plus other Windows services via your web browser.


Download and Install Microsoft OpenJDK

The latest version of the Minecraft server requires OpenJDK. Download and install the latest 64-bit OpenJDK from Microsoft.


Download and Install Minecraft Dedicated Server

  1. Download the Minecraft server.jar file from the Minecraft website. Save server.jar to C:\Minecraft or the directory of your choice
  2. Open a Command Prompt. Then manually run Minecraft Dedicated Server as follows (adjusting the path to java.exe as necessary):

    cd C:\Minecraft
    "C:\Program Files\Microsoft\jdk-17.0.7.7-hotspot\bin\java.exe" -Xmx1024M -Xms1024M -jar server.jar

  3. Open "server.properties" and edit to your liking.
  4. Open "eula.txt" and change the second line to read:

    eula=true

Set Up Minecraft as a FireDaemon Pro Service

  1. Download and install FireDaemon Pro
  2. Double-click the FireDaemon Pro icon on your desktop, then click on the New (i.e. +) button in the toolbar (or type Ctrl + N) to create a new service. 
  3. Enter the information into the fields as you see below.

    Minecraft Dedicated Server FireDaemon Pro Program Tab
    The most important sections of the configuration are:

    Program: This is the full path to java.exe or javaw.exe
    Working Directory: This is the full path to the file system location you have placed server.jar
    Parameters: dependent on the use of java.exe or javaw.exe per below

    If you use java.exe to start the Minecraft Dedicated Server, you will see both the Minecraft Dedicated Server Console window and Minecraft Dedicated Server GUI on Session 0. This is undesirable. So use the following Parameters to display the Minecraft Dedicated Server Console only:

    -Xrs -Xmx1024M -Xms1024M -jar server.jar nogui

    If you use javaw.exe to start the Minecraft Dedicated Server, you will not see the Minecraft Dedicated Server Console window on Session 0. So use the following Parameters to display the Minecraft Dedicated Server GUI only:

    -Xrs -Xmx1024M -Xms1024M -jar server.jar

    Now click on the Settings tab and set the SID Type to Unrestricted. This is optional but useful if you are running many MC servers simultaneously. It will allow you to identify which MC service is which on Session 0 via the FireDaemon Zero Task Tray.


    Now click on the Environment tab and add the JAVA_HOME environment variable as per the screenshot below adjusting the Variable Value to where you have installed Java:

    Minecraft Dedicated Server FireDaemon Pro Environment Tab
    Lastly, configure Send Command Termination Events to shut down your Minecraft Dedicated Server nicely as per the screenshot below. We have included one Send Command events: /save-all and one Send Close event: /stop. These are sent to the Minecraft console by simply echoing them on the command line. The difference between Send Command and Send Close is that the former just sends the text string to Minecraft while the latter also sends the text string but tells FireDaemon Pro that Minecraft will shutdown of its own accord. Once that is done click the "tick" to install and run the service.

    Minecraft Dedicated Server FireDaemon Pro Events Tab

Verify that Minecraft is Running

The Minecraft Dedicated Server status can easily be checked on the main FireDaemon Pro Services list. Status should be Running, Process should be running and Process ID (PID) has been assigned that does not change.
Minecraft Dedicated Server FireDaemon Pro Service List

Switch to Session 0 to see Minecraft running

You can use FireDaemon Zero and FireDaemon ZeroInput to switch to Session 0 to see your Minecraft Dedicated Server Console or Minecraft Dedicated Server GUI running per the screenshots below.

This is what Minecraft Dedicated Server Console looks like:


Minecraft Dedicated Server Console
This is what the Minecraft Dedicated Server GUI looks like:

Minecraft Dedicated Server GUI


This is what both types of Minecraft Dedicated Servers look like on Session 0 with the SID type set:

Screenshot of Session 0 showing to Minecraft Dedicated Servers running