Cuberite server for Minecraft on QNAP NAS (4kids)
Posted on Thu 05 April 2018 in Automatyczny dom, Games, Tips4Unices • 3 min read
My boys have built quite large world inside theirs Minecraft. One of them is running local server on his PC and other connects to his computer. But this is not a perfect way of doing things. Older boy has to turn on brother's PC to play so I have to pay more for electricity. There is no automatic backup for Minecraft worlds, guys are not able to add plugins to theirs server, etc.
So, they ask me if I can run server as before, few years ago, when I run it on one of my servers with public address. I answered:if I will do it you will start to hate me.
"Why dad?"
"Because our Internet connection is poor. Hey guys, we have Qnap NAS which runs 24/7 and has ability to run Virtual Machines and Linux containers. We can set up one for Minecraft server as before."
”OK, dad. Let's do it."
This is how we did it and you can follow it this way:
First change default port (8080) of your NAS to some not popular port because we know that some services could run on 8080 automatically and overlap it. And it's also a small piece of security by obscurity.
Then setupVirtual Switchconnected to physical Ethernet card. It's simple as running wizard.
InstallContainer Station.
Install Debian Jessie (you can choose Ubuntu or others) LXC container insideContainer Station.
In our Debian containerSettingswe changedNetwork Modeto “Bridge� connected to Virtual Switch with DHCP to allow autoconfiguration. This way our container will get IP address from our router.
Run Debian container and check if it gets IP address (we fixed this IP to Debian in router config).
If it's OK then install Cuberite (which is fine Minecraft server with plugins and web interface for admins).
Open console of Debian's container and do:
apt install curl curl -sSfL https://download.cuberite.org \| sh
Check if Cuberite is OK:
cd Server ./Cuberite
Close it with Ctrl+c.
Move Cuberite to /srv:
mv Server /srv/cuberite
Make service file for systemd:
vi /etc/systemd/system/cuberite.service
and paste following stuff:
[Unit] Description=Cuberite Server After=local-fs.target network.target [Service] Type=forking User=root WorkingDirectory=/srv/cuberite ExecStart=/srv/cuberite/Cuberite --service [Install] WantedBy=multi-user.target
Then enable it to run Cuberite when container boots:
systemctl daemon-reload systemctl enable cuberite.service
Run service to check it:
systemctl start cuberite
Look for Cuberite:
ps auxc \| grep -i cuberite
You should see it running.
Find IP address of your container:
ifconfig
and go to the following address to manage your Cuberite server,default login/pass is: admin.
http://[container_ip]:8080
You can change it in/srv/cuberite/webadmin.ini.
Take a look at other INI files. Check some awsome plugins and
Be sure that Debian container starts automatically when Container Station is started and of course is Container Station starts when NAS is booting.
The very last thing was to backup old Minecraft world from kid's PC (here is short guide how to find it) to USB drive and then copy it as/srv/cuberite/world. You compress whole folder and transfer it to container withscp.
Restart Cuberite:
systemctl restart cuberite
Kids now can connect to new Minecraft server with[container_ip]:25565.
Default port for Cuberite is 25565, you can change it in /srv/cuberite/settings.ini.
AND REMEMBER: CONTROL HOW LONG YOUR KIDS PLAY!
YOU ARE ADMIN. USE YOUR POWER AND QNAP SETTINGS TO SHUT DOWN EVERYTHING.
YOU ARE MOTHER OR FATHER - BE BRAVE!
:)