The Minecraft craze started back in 2009, and although it may not remain at the top of everyone’s mind, it still holds some sway. Even now it’s one of the most popular video games in history. But it’s not just about fun and games: Installing a Minecraft server allows you to bring the fun to your LAN, and it’s also a great exercise in teaching new admins how to work with Linux.
SEE: 20 good habits network administrators need–and 10 habits to break (free PDF) (TechRepublic)
I want to walk you through the procedure of installing a Minecraft server on Ubuntu Server 22.04 so you can test the mettle of your young Linux admins and give your staff the ability to blow off some steam while not leaving the confines of your local network.
What you’ll need
To follow along, you’ll need a running instance of Ubuntu Server 22.04 and a user with sudo privileges. That’s it.
How to install the dependencies
Minecraft has a few dependencies to take care of. One of the biggest is Java. Before we install Java, let’s take care of a few other, more standard dependencies with the command:
sudo apt-get install lib32gcc-s1 lib32stdc++6 libsdl2-2.0-0:i386 netcat screen -y
When that completes, we can now install Java. The thing about Minecraft is that it requires a much more recent version of Java than found in the standard repository. To get around that, we’ll first add the correct repo with the command:
sudo add-apt-repository ppa:openjdk-r/ppa
Next, update apt with:
sudo apt-get update
We can now install OpenJDK 17 with:
sudo apt-get install openjdk-17-jre-headless -y
How to open the firewall
If you’re running Uncomplicated Firewall, which you should be, it’s necessary to open a specific port with the command:
sudo ufw allow 25565
How to install Minecraft
Before we download and run the installer, we’ll create a new user with:
sudo adduser mcserver
Make sure to give the new user a strong and unique password. Once you’ve taken care of that, change into the new user with:
su - mcserver
We’re going to download the installer from Linux Game Server Manager with:
wget -O linuxgsm.sh https://linuxgsm.sh
Give the new file executable permissions with:
chmod +x linuxgsm.sh
Make the linuxgsm.sh file aware to Bash as mcserver with:
bash linuxgsm.sh mcserver
Finally, run the installer with:
~/mcserver install
How to configure the server
After the installation completes, we need to make a simple configuration change before starting the server. Open the config file with:
sudo nano serverfiles/server.properties
In that file, look for the line:
server-ip:xxx.xxx.xxx.xxx
Change the xxx.xxx.xxx.xxx to reflect the actual IP address of the hosting server.
Save and close the file.
How to start the server
Finally, it’s time to start the server. For that, issue the command:
~/mcserver start
Your Minecraft server should now be up and running and ready for players to connect. The one caveat is that players cannot connect to this server with the official Microsoft version of Minecraft. Instead, they must use the Java version of the game, which is not free, to play Multiplayer and connect to the local server.
One tip — you can check on the status of the Minecraft server with the command:
~/mcserver monitor
You should see output similar to the following (indicating all is well):
Monitoring mcserver: Checking session: OK
Monitoring mcserver: Querying port: gsquery: 192.168.1.63:25565 : 0/1: Â OK
Monitoring mcserver: Querying port: gsquery: 192.168.1.63:25565 : 0/1: OK
And that, my Linux admin friends, is how you install a Minecraft server to an instance of Ubuntu Server 22.04 on your LAN. Happy gaming!
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.