Today, we're going to install Minecraft Server in a Docker container, using
Container Station on a QNAP TS-451. I'll show you how to install the Container
Station, how to set the share drive to store the docker images and containers,
and how to route the networking for the container. Container Station is a free
app from QNAP available in their App Center. It's similar to the
Virtualization Station app in that it can create virtual machines of Linux, but
it also supports Dockers. The concept of Dockers is similar to that of a virtual
machine, except you aren't virtualizing the entire operating system; you're
virtualizing just one application. Because of that, you have a lot less
overhead. When you create a container, it holds the information that the
application needs to run on the host. And in the QNAP universe, that means it runs
on top of the QTS operating system, which itself is based on Linux. In this
tutorial, we'll install the Minecraft Server app using a docker image. There's
quite a few packages we can choose from, but I'll use one that requires a minimal
amount of configuration and customization. Let's go ahead and log in
to QTS on the QNAP. The first thing you'll want to do is visit
the App Center in order to download and install Container Station. The quickest
way to access it is through QTS Essentials.
Here, you'll want to look for Container Station, and then hit the Install button,
and select the RAID group in which you want to install it. Now I have two RAID
groups called DATA01 and DATA02, but I'll install Container Station in the
first group, where I have all my other apps.
This will take sometime, so I'll fast-forward through this part.
OK, we're back. Let's minimize
the App Center, and before I open Container Station, I want to show you how
my drives are set up. I'll start QNAP's new Storage and
Snapshots Manager, and navigate to the Disks section...
where you can see I've got two RAID1 sets of drives. I've already installed
Container Station on RAID group 1, called DATA01, but I'd like to store
the actual containers and images on RAID group 2, called DATA02, because those
drives have a higher RPM. When I start Container Station for the first time,
it'll ask me to create a new, auto-populated share folder called
Container, and it'll install it by default onto the installed drive which
is DATA01. To make it store the containers on DATA02, I'll simply start
the Control Panel, go to Shared Folders...
and create a new folder...
call it Container...
and set it to DATA02...
and hit Create.
Let's minimize that, and return to Container Station. Let's drop down the
box and verify that the Container folder is on the correct drive - which it is.
If I hadn't manually created the Container folder on DATA02, it would
have created a new shared folder on DATA01.
Let's hit Start Now.
It'll take me directly into the dashboard, where you can see I don't have
any containers listed in the grid yet. To add one,
let's tab over to Create Container. This first screen lists all of the QNAP-
recommended LXC and Docker packages. They do list one Minecraft package, which I
was able to install - but for some reason, it didn't pull the latest version of
Minecraft Server. Since my goal is to show you the best out-of-the-box
experience, I looked for other Minecraft packages.
Let me search for Minecraft,
which returns the QNAP-recommended package. But
if I tab over to the Docker Hub, it'll list all of the available Minecraft
packages. I've tried several of these, and I had the best luck with kitematic's package.
Let's click Install...
and grab the latest version.
If you create the container at this
point using the default settings, you'll most likely have problems with the
network settings of the Minecraft Server. Let me show you how I have my virtual
switch set up. We'll go over to the Control Panel, tab to Network and File
Services, and start the Network and Virtual Switch options.
Of the two physical adapters, the second one is attached to a virtual switch. I
also have two virtual machines going through that switch, one of which is
currently active. What I plan to do is make the Minecraft Server go through the
virtual switch and assign it its own static IP address. Going back to
Container Station, let's click on Advanced Settings...
where we can set the Network Mode to Bridge,
and choose Adapter 2, which is our virtual switch.
I'll use static IP, and set it to an address that I haven't
assigned yet. I'll set mine to .125. Now
let's hit Create and wait for the Docker container to be installed. In the
meantime, I'll go brew some coffee...
Once it's done, you can see the container
listed in the Containers section. if I tab over to Overview, you can see that
the Minecraft Server has actually been started. When you click on the link, it'll
show the console output in a window, which shows that the Minecraft world is being created.
I'll stop the container for a moment.
Let's hop over to File Station and look at the files that represent the container.
I'll click on container_station_data, then drill down to lib, then docker...
volumes, and then this long string that represents the Minecraft Server...
and finally _data.
Here you can edit your ops and ban lists, as well as the server.properties file.
I'll right-click the file to edit it using a text editor - which, by the way, is
a free download from the App Center. I always set game mode to creative and
difficulty to peaceful - for the kids...
and save it.
Let's go back to Container Station and restart the container.
Now restarting the container actually regenerates the world, so I'll take a
quick break while it does that.
OK, the world has been successfully created. Let
me quickly go back to the Network and Virtual Switch page to show you how the
container fits into the network. As expected, the container is going through
the virtual switch 1, along with my other virtual machines. At this point, I
can switch to my Minecraft client on another PC, and hit Multiplayer.
I'll Direct Connect to my server, which is 192.168.1.125.
I'll join the server.
And we're in. As you can see, the console shows I've logged in.
Now I can host a Minecraft Server on a very low-power QNAP NAS device, 24 hours-a-day.
Thanks for watching - I hope you enjoyed!