Skip to content

Minecraft (Java) Server in Docker on a Synology NAS

UpdateDate
Added Docker Compose details03/05/2021
Updated to show which version of the image to download09/06/2021

In this guide I am going to take you through the steps to get a Minecraft server up and running. This applies to both a Vanilla and modded server.

We will be using DSM6 and the latest version of Docker at the time of writing. The server I run is now open to anyone who want’s to play, its usually up and running most of the time. You can see its status in the widget on the left of this page 🙂

Downloading the Container

Open up Docker within DSM and navigate to the ‘Registry’ tab and search for ITZG in the keyword box.within the results right click and download the ‘ITZG|Minecraft-Server’, When it asks which version number to download select the one that you require.

Minecraft VersionTag to Select
v1.17 and upLatest
v1.16 and belowJAVA15
Search and Download

Setting up a Docker User for Minecraft and Obtaining the PGID and PUID

In previous versions of this guide we used your default admin account for each container, this is not very secure so please now follow the separate setup guide and then head back here.

Setting up the container

Now we have downloaded the container and got hold of our user IDs we can move onto the next stage, where we will configure the Docker container. First go back into Docker and click on the ‘Image’ tab, in the list of your containers select the ITZG minecraft server, and click on ‘Launch’

Time to start

You will be greeted with the initial setup screen, this is where you can start specifying some of your preferences.

As this is a Minecraft server it will likely use as much memory and CPU usage as you allow it, if you are running the server on a lower specification Synology machine you will probably want to set limits around the CPU priority and memory usage to ensure DSM is still usable when the server is running.

In this case I am leaving this as the defaults, you can always come back and tweak these settings later once the server is setup.

The initial setup screen

Next up we are going to setup some other parts, click on the ‘Advanced’ button.

Advanced Tab

On this first tab you can decide if you want to create a shortcut to the server on the DSM desktop and also if you want the server to start up automatically if you ever restart your Syno, this is useful if you don’t want to login to manually startup the server.

Advanced Settings

Volume(s)

In the next tab we need to setup where we want the various Minecraft world files to reside, having these outside of the container will mean you can make backups of the entire server, great if someone decides to flood the map with Lava!

Personally, I setup folders for each of the  containers I am running in the default Docker directory as this keeps things nice and tidy.

We are going to mount a single directory for this container, the internal “/data” directory to the NAS “/docker/minecraft” seen the screenshot to see exactly how this is laid out.

Specify where you world files should reside

Network

You do not need to adjust and settings in this tab.

Port Settings

By default docker will automatically assign external ports to your Docker container, however we will never know what they are until the container is launched and also they may change upon a reboot, so we will need to assign some specific ports.

In the case of this container Minecraft uses high value port number so it’s unlikely to clash with any other containers or ports already used by DSM. So we are just going to enter the same port numbers on the left hand column.

Assign your ports

Environment Variables – PGID , PUID, Server Type and EULA

We are now going to set up the specific options for the server including what type of server you would like to run and even a specific version.

*Please note that you must not change the UID and GID options in the first red box.

First up Click on the + sign at the top of the options page, in the ‘Variable’ box type PGID and enter the value you obtained earlier, repeat this step for the PUID. (See screenshot)

In addition to this we have to accept the Minecraft EULA so you will add an additional variable called EULA with the value set to TRUE.

You can now specify the type of server you would like to run by amending the value next to the TYPE variable.

  • VANILLA
  • BUKKIT
  • SPIGOT
  • PAPER
  • TUINITY
  • MAGMA
  • MOHIST
  • CATSERVER
  • CURSEFORGE
  • SPONGEVANILLA
  • FABRIC

If you want to run a specific version of the server you can amend the VERSION variable from LATEST to for example 1.13

*Please note the screenshot below has been updated, as you can see after you run the server for the first time a lot of additional variables are automatically added. Ignore the GID and UID towards the top of this screenshot we only need to fill in the items at the bottom!

You have now completed the hard part of the guide, click on OK and you will be taken back to an overall summary screen, this is just a summary of the settings you have entered, just do a quick sanity check to make sure they are correct. if you want to launch the server immediately check the box and click on finish.

Final summary page

Server startup time

The first time the server is launched it may take a few minutes to start as the files are downloaded and the world in generated, this time will depend on how fast your Synology performs, you can track the progress by going into the ‘Containers’ tab and clicking on details, and then either viewing the terminal or log tabs.

All other server settings can be configured using the standard Minecraft server.properties file, I won’t be covering that here as there are extensive other guides out there.

Docker Compose

You can use the below code saved as minecraft.yml to do the entire process above in one quick command via SSH.

version: "3.2"
services:
  spigotserver:
    image: itzg/minecraft-server:java15
    container_name: minecraft
    environment:
      - UID=YOURPUID
      - GID=YOURPGID
      - JVM_XX_OPTS=-XX:+UseG1GC
      - MEMORY=2G
      - TYPE=SPIGOT
      - VERSION=LATEST
      - FORGEVERSION=RECOMMENDED
      - SPONGEBRANCH=STABLE
      - SPONGEVERSION=
      - FABRICVERSION=LATEST
      - LEVEL=world
      - PVP=true
      - DIFFICULTY=easy
      - ENABLE_RCON=true
      - RCON_PORT=25575
      - RCON_PASSWORD=
      - LEVEL_TYPE=DEFAULT
      - SERVER_PORT=25565
      - ONLINE_MODE=FALSE
      - SERVER_NAME=NAME OF YOUR SERVER
      - ENABLE_AUTOPAUSE=false
      - AUTOPAUSE_TIMEOUT_EST=3600
      - AUTOPAUSE_TIMEOUT_KN=120
      - AUTOPAUSE_TIMEOUT_INIT=600
      - AUTOPAUSE_PERIOD=10
      - REPLACE_ENV_VARIABLES=FALSE
      - ENV_VARIABLE_PREFIX=CFG_
      - EULA=TRUE
    volumes:
      - /volume1/docker/minecraft:/data:rw
    ports:
      - 25565:25565/tcp
      - 25575:25575/tcp
    restart: unless-stopped
sudo docker-compose -f /volume1/docker/minecraft.yml up -d --remove-orphans

Throw me some bits

If you have found my site useful please consider pinging me a tip as it helps cover the cost of running the site, it could even buy me a beer 🙂

  • Bitcoin
  • Ethereum
  • Tether
  • Xrp
  • Polkadot
  • Binance coin
  • Litecoin
  • Bitcoin cash
  • Dogecoin
  • Tron
  • Monero
  • Omisego
Scan to Donate Bitcoin to bc1qfznx5kxad9k9z5t9y79mkm9ukfexan9a6wrzl0

Donate Bitcoin to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin

Scan to Donate Ethereum to 0x162fc7781D3C6c6f27197A3A92567b5DAF258f19

Donate Ethereum to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum

Scan to Donate Tether to 0x162fc7781D3C6c6f27197A3A92567b5DAF258f19

Donate Tether to this address

Scan the QR code or copy the address below into your wallet to send some Tether

Scan to Donate Xrp to rKGpNHetksTn4dgwgpiTkg8JM4uJ3J6pam

Donate Xrp to this address

Scan the QR code or copy the address below into your wallet to send some Xrp

Scan to Donate Polkadot to 153iRH61nXQZUXMveZxCmYyzjf1cWYVnxpHpfifoNchQuXbY

Donate Polkadot to this address

Scan the QR code or copy the address below into your wallet to send some Polkadot

Scan to Donate Binance coin to bnb14ye5rju74u5ythneaum2rjvp8eqep6wq8flghx

Donate Binance coin to this address

Scan the QR code or copy the address below into your wallet to send some Binance coin

Scan to Donate Litecoin to LfNfer3aSqLx4p8KfbbkT96ArXLXLDPxoD

Donate Litecoin to this address

Scan the QR code or copy the address below into your wallet to send some Litecoin

Scan to Donate Bitcoin cash to qrc7scd2drzsd7kywpsjfklvkmm26fqc2vd7uyvdx9

Donate Bitcoin cash to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin cash

Scan to Donate Dogecoin to DCwbNzfYHx22MDSyEVLWgfjxziYHtcgwAM

Donate Dogecoin to this address

Scan the QR code or copy the address below into your wallet to send some Dogecoin

Scan to Donate Tron to TL1Q3vY9mHnDMedHRyU8ERUAY8SzJ4FXiV

Donate Tron to this address

Scan the QR code or copy the address below into your wallet to send some Tron

Scan to Donate Monero to 45qwFr42XiA8egC5z2HdSQ2FzzP9VR1MvD5Sicg4EhGvdvTutx9GsF6DeU8DHAsTZy2ShBERjCB5rdy8iQ9CFnFu9Z6Adgw

Donate Monero to this address

Scan the QR code or copy the address below into your wallet to send some Monero

Scan to Donate Omisego to 0x162fc7781D3C6c6f27197A3A92567b5DAF258f19

Donate Omisego to this address

Scan the QR code or copy the address below into your wallet to send some Omisego

Published inGamingMinecraft

49 Comments

    • Dr_Frankenstein Dr_Frankenstein

      Hey, you skipped a bit at the start of the guide, make sure you choose the JAVA15 version when it asks you which image to download 🙂

      • Mathis Martin Mathis Martin

        after checking I have downloaded the container with the ‘Java15’ version.

        I think the problem comes from installing java on my nas

        • Dr_Frankenstein Dr_Frankenstein

          Hey, so my timing was bad when updating the guide a few days ago as 1.17 now requires Java 16… so just select the JAVA16 version when it asks.. I will amend the guide.

          • Mathis Martin Mathis Martin

            hello, this morning I tried to do a reinstallation on my nas with ‘multiarch-latest’ that worked for me.

            I suppose that it comes from my installation because I am on a nas Xpenology (DIY) I think it comes from the architecture of the processor (INTEL Core i3-4130)

            thank you for taking the time to answer me.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.