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. 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 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.
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.
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.
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’
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.
Next up we are going to setup some of the ‘advanced’ settings so click on the ‘Advanced’ button.
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.
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.
You do not need to adjust and settings in this tab.
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.
Environment 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.
Also worth noting, if you want to run a specific version of Minecraft change the ‘VERSION’ variable to the version you want, such as 1.13.1.
*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.
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!