Skip to content

Minecraft (Java) Server in Docker on a Synology NAS (Including Mods)

This guide replaces the two previous guides on the site, they will be archived in due coure.

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 ‘Latest’

Search and Download
Select the version

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


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


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.


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 file, I won’t be covering that here as there are extensive other guides out there.

Published inGamingMinecraft


  1. francois adams francois adams

    Nice tuto & docker image, thanks !


    Is there a way to migrate pre-existing server data to my NAS world? I would like to preserve the world I run from my PC currently just migrate it over to the NAS rather than creating an entirely new world.

    Thanks very much for putting in the time to set this tutorial up, very helpful!

  3. francois adams francois adams

    Copy the directory containing the world from your pc to the /data mount on docker, ensure the name of the directrory is the same in and launch the docker server, it should work.

  4. Michael Michael

    I currently believe that defining different users is a waste of time as long as the containers are created with the web GUI.
    Did you check if defining PUID and PGID has any effect at all?

    We share the same urge to get our setups as secure as possible.
    So I tried to implement the solution you propose but I failed.

    I am using — DSM 6.2.3-25426 Update 3 — on my — DS216+II — to host mongodb and here it seems like mounting folders inside the docker directory can be done regardless of any permissions.
    I used this tutorial here but unfortunately Mr. Abt does not provide a screenshot :
    As if docker runs on root permissions anyway as long as a container is launched from the web GUI.
    While mounting any folder or shared folder outside the docker folder never worked, no matter what User:Group combination or environment variables I used, I could use any environment variable I want as long as the mount happens inside the docker shared folder.

    I also have a python script run by chron to execute a batch job that converts pdf into pdf/a with OCR Layer for a paperless home.
    When using this way the permissions actually control access.
    Persumably because the docker run command is not executed by sudo.

    I tested both 5 mins ago and I cannot find any other explanation.
    Maybe you have a better idea on what I am doing wrong.
    Your help would be appreciated very much :).

    • Dr_Frankenstein Dr_Frankenstein

      I think it depends on the container

      All the Linux|Server containers respect your PUID and GUID settings as when given incorrect permissions that are not granted for a share or folder the container does not have any access to it, so in my personal case if I tried to pass my /photo directory to Radarr it will just be empty as the user I have setup for my automation does not have access to it.

      However other containers without explicit access permissions have the permissions of the user setting them up (usually the admin) so will just allow access to any folders passed through that the admin has access to. (this is what the mongoDB one is doing).

      When you tick the box in the interface called ‘Enable high privilege’ you are granting root access for the container.

      I have pretty much moved exclusively to using Docker-Compose at this point it works the same way though permissions wise.

      So if you wanted to restrict your MongoDB setup you would create a user for it and run the container via the webui logged in with that user… or use docker-compose while logged in via SSH under that user. (obviously that user would be setup with explicit access to only the shares or folders you want the DB to have access to)

      Does that make sense. (I am learning this all as I go, but that is my understanding)

      • Michael Michael

        I found something that might also be helpful here:
        Seems like the mongo container really likes Owners permissions, I am wrong and your security can still be used.
        Probably not for mongodb, though.
        Thank god and user Szmeby for this insight :D.

Leave a Reply

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