Minecraft Server on QNAP (2022)

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

java -version

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

  2 Replies to “Minecraft Server on QNAP (2022)”

  1. Jay Peterson
    June 25, 2023 at 3:31 pm

    Thank you for your description. One of my kids also wants me to set up a Minecraft server for him, and I was wondering if I could install it on our QNAP. I currently only use it to occasionally access files and don’t have any virtual OS or Plex servers running. Do you perceive that the QNAP is performing well as a Minecraft server? I’m wondering if it would be sluggish or that running the virtual machine would slow down the other functions. I like the idea of putting it on the NAS, since it’s already running all of the time.

    • Nick
      March 25, 2024 at 11:16 pm

      It worked fine for me, but actually – in the end…. they setup on some cloud service and pay a small fee for it.

Leave a Reply

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

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