The kids have been hounding me for some time to setup a Minecraft server so today, about a year after they first started, here I am!
Gah. According to many articles out there, this stuff should be more straightforward. But alas, the QNAPClub site was down, and every time I tried to find a docker install for the QNAP that was on V1.19.2 of Minecraft, I couldn’t get it to work.
So, here is a simple set of steps I took to fix this. QNAP, Virtualisation Station, and Debian.
- Install Virtualization Station on the QNAP
- Download yourself the latest Debian ISO
- Install Debian, with all the standard bits
- Run these commands once you are at the CLI
apt-get update apt get upgrade apt install sudo sudo apt install openjdk-17-jdk (y)
At this point, it will go off and grab and install all the Java systems. In the end, check java by typing in
You should get something like this:
Installing Minecraft server
mkdir ~/mc-server cd ~/mc=server sudo apt install wget wget https://piston-data.mojang.com/v1/objects/f69c284232d7c7580bd89a5a4931c3581eae1378/server.jar
This will download the version I wanted, but you may want something different. The links for the URL above are available on the Minecraft Page here
Now, once you have downloaded this, you can startup the server by typing in:
java -Xmx2048M -Xms2048M -jar server.jar nogui
Youll note the message about the EULA. So then type this:
apt-get install nano nano eula.txt
Change the text from “=false” to “=true”. Then save by pressing CTRL X and then Y and then hit return.
Then, again run the command above. (press the up arrow a few times to get back to the command you typed before). Once you do, it will take some time to build the initial world, give it time, and test you can connect from the Minecraft client.
At this point, the server is running, but the problem is that if the server restarts, it won’t autoload. To fix this, you do the following:
Create the service for the server as follows:
sudo nano /etc/systemd/system/minecraft-server.service
Add this content to that file:
Description=Minecraft After=network.target [Service] WorkingDirectory=/mc-server ExecStart=java -Xmx2048M -Xms2048M -jar server.jar nogui StandardOutput=inherit StandardError=inherit Restart=always User=root [Install] WantedBy=multi-user.target
Now, we can test this service:
sudo systemctl daemon-reload sudo systemctl start minecraft-server.service sudo systemctl status minecraft-server.service (for output)
You last command is as follows, which adds the service to the startup of the VM
sudo systemctl enable minecraft-server.service