Skip to content

Setting up a Minecraft Server in Docker on a Synology NAS

In this guide I am going to take you through the steps to get a basic Minecraft server up and running. We will be using DSM6 and the latest version of Docker at the time of writing.

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 choose whichever version you want for the server. It allows you to choose ‘latest’ to pull the latest and greatest server version, or has some specific versions if you want them.

Search and Download
Select the version

PUID and PGID

In order for the Docker container to access the shares on the NAS we need to give it the same permissions as a user who has access to those shares, we achieve this by associating the correct Personal User ID and Personal Group ID to the container.

You will need to SSH into your Diskstation using ‘Putty’ or an equivalent program.

Open up Putty, the only thing you need to enter is the IP address of your NAS and select the SSH radio button.

SSH into your Synology to find out your ID’s

Click on open, you will get a prompt asking if you trust the key, if this is the first time you have used SSH, just press OK or accept.

Enter the login information for your Synology user account, you will not be able to see the password as you type it, I use a very long one so I just paste it in from my password manager. (right click acts as paste in Putty)

Once logged in type ‘id’ without the quotes and this will show your UID(aka PUID) which in my case is 1026 and the GID(aka PGID) which is 101 for an administrator. Make note of these values as we will need them later.

Command to get the ID’s

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 NAS 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 of the ‘advanced’ settings so 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 the NAS, 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

Enviroment Variables – PGID , PUID and EULA

We can now enter the details obtained earlier on in the guide for the PGID and PUID, if these settings are incorrect it will result in the Docker containers internal user not being able to see the shares we specified and the world files and other server settings will not appear in the folder.

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.

Setting your variables

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.

You will just need to enter your server settings into your Minecraft settings screen and join, you can make amendments to the servers settings from within the folder you used to store it’s files as well as installing any mods you want.

If you get something setup ping me an invite and I will come and play!

Published inDockerGamingMinecraft

6 Comments

  1. Pedz Pedz

    Ugh… Docker fails to start the container properly. 🙁 The LOG says that we must accept the EULA. Any idea how do we do this?!

    • Pedz Pedz

      Must add another environment variable:

      EULA variable must be set to TRUE

      Then it works! 🙂

      Thanks for the tutorial!

      • Dr_Frankenstein Dr_Frankenstein

        Hey, not sure how I managed to miss this. Now I know why I couldn’t update my son’s server! the guide has been updated.

  2. Pete Pete

    Excellent thanks!! I managed to setup a server without too much hassle. Now to the next thing.
    Any guide available on how to install mods with this setup? Having severe issues figuring it out…

  3. Kevin Kevin

    Thank you for the tutorial! Was very informative and easy to follow with no problems during setup. I’m using the DS1815+ NAS and this was able to run. My kids will appreciate it!

  4. George Staver George Staver

    I also have this up and running. However, I cannot locate the config files. I have the mount point setup but I cannot see any folders or files. Can you help? Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *