hero-image

Hosting a modded Minecraft server on Unraid is very easy to do! However, the steps to get it up and running aren't exactly clear, especially if you aren't very familiar with Docker. This guide assumes you have no prior knowledge of Docker, but do have some basic knowledge of administering an Unraid system. With that said, you certainly don't need to be an expert on Unraid system administration - you just need to have some familiarity with working with the file system in Unraid either with SSH or FTP.

Docker image and container setup

We are going to use is the itzg/minecraft-server Docker image. Don't install it using the steps in this link, however - just refer to it for documentation, if needed. This image allows you to host a number of different types of Minecraft servers, not just Forge. However, I really only play Forge modded version of Minecraft, so that's all I'll be covering for now.

To create a new Docker container using the itzg/minecraft-server image on Unraid, navigate to your Unraid dashboard and click the Docker tab. Click Add container. Give the new container a name. For the Repository field, set it to itzg/minecraft-server. Network type should be set to Bridge and Console shell command should be set to Shell. Now, you're ready to configure the fields!

NOTE: If you want to create additional servers using this setup, you will be able to use the configuration you're about to create as a template (though, you will need to ensure they map to different ports on the host machine). However, since we haven't created it yet, we don't have the template. Just keep this in mind for later!

Explanation of the "raw" command

If you're already familiar with the underlying command, you can skip to the "Field Configuration" section.

The point of the field configuration is to make it so that we can set the required start environment variables, path and port are set without needing to pass a nasty-looking "Extra parameter". Before we continue, consider the following command (but don't run it):

docker run -d -v /path/on/host:/data \
    -e TYPE=FORGE \
    -e VERSION=1.12.2 -e FORGEVERSION=14.23.5.2854 \
    -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server

This is the target command we are using while configuring the new container. This is what you would normally use if you were running the container from the command line. We are going to be setting up Unraid to expose these same settings in the dashboard. Here's a quick explanation:

  • docker run -d - This is the "core" part of the command, which just runs a container using the given options
    • -d is just a flag to tell the container to run in the background (e.g., "daemon" process)
  • -v /path/on/host:/data - Maps container data to a location on the filesystem as a "volume"
    • /path/on/host can be replaced with wherever you intend to store data in your Unraid filesystem
    • /data must always stay the same - it's where the data is stored within the container
    • This option is crucially important as it ensures your server data persists when the container is stopped
  • -e TYPE=FORGE - A Docker environment variable custom to this Docker image - it must be set to FORGE when running Forge servers
  • -e VERSION=1.12.2 - This environment variable is also needed, but you must set it to whatever game version you're server is for
  • -e FORGEVERSION=14.23.5.2854
    • Indicates the version of Forge to use
    • The version you use must match the Forge version used in your game version
    • Unfortunately, this can be a little ambiguous - you can generally find it on the actual Forge JAR file, but sometimes, the game version is prefixed to the actual Forge version
      • E.g., 1.16.5-XXXX - in this case, the forge version would be whatever the XXXX
  • -p 25565:25565 - The port flag (and mapping)
    • This basically just says "this container runs on port 25565 in the container, and maps to 25565 on the host machine"
    • This is what exposes the Docker-hosted Minecraft server through the host-machine (using port 25565 in this case)
      • In other words, this is a required field
  • -e EULA=true - an optional (yet, convenient) environment variable that automatically-agrees to the Minecraft server EULA
  • --name mc itzg/minecraft-server
    • Names the created container "mc"
    • Sets the image to itzg/minecraft-server

Field configuration

Adding the volume:

  1. Click Add another Path, Port, Variable, Label or Device > set the Config Type to "Path" > give it a name (e.g., something like "Volume")
  2. Set the value for the Container path field to /data
  3. Click the Host path field > select the location on your system where the server files are located
  4. Click Add

Adding the TYPE environment variable:

  1. Click Add another Path, Port, Variable, Label or Device > set the Config Type to "Variable" > give it a name (e.g., something like "Type")
  2. Set the Key field to TYPE
  3. Set the Value field to FORGE
  4. Click Add

Adding the VERSION environment variable:

  1. Click Add another Path, Port, Variable, Label or Device > set the Config Type to "Variable" > give it a name (e.g., something like "Version")
  2. Set the Key field to VERSION
  3. Set the Value field to the base Minecraft version that you're using (e.g., 1.12.2)
  4. Click Add

Adding the FORGEVERSION environment variable:

  1. Click Add another Path, Port, Variable, Label or Device > set the Config Type to "Variable" > give it a name (e.g., something like "Forge version")
  2. Set the Key field to FORGEVERSION
  3. Set the Value field to the version of Forge that you're using
  4. Click Add

Adding the port mapping:

  1. Click Add another Path, Port, Variable, Label or Device > set the Config Type to "Port" > give it a name (e.g., something like "Port mapping")
  2. Set the Container Port to "25565" - this must always be 25565
  3. Set the Host Port to whatever port you want to expose your server on from the host machine - this port value can be whatever you want it to be, so long as it's a valid, unoccupied port
  4. Set the Connection Type to "TCP"
  5. Click Add

Now you should be able to start your Forge Minecraft server by simply starting the Docker container!

Hosting multiple servers

As mentioned in a note above, you can re-use the settings you just configured to create a new Docker container with the same settings. To do this, when adding a new container, click the Template dropdown and select the container you previously-created.

You must ensure the port mappings do not conflict. This is really easy to do, however - simply ensure the containers are using different ports on the host (the port in the container should always be 25565). As long as the ports don't conflict, and as long as you have resources available on the server, you can re-use the template to create as many servers as you'd like!