How to build a Minecraft server

03.03.2021 489 0

Ah, Minecraft. A simple “block game” that reminds a lot of people about Lego. It was intended for young kids. Despite that it quickly became one of the most popular video games of all time with over 200 million copies sold and over 126 million monthly active users in 2020. And it has been around since 2009!

That’s quite impressive, considering there’s no real end goal in Minecraft. But that’s also the beauty of the game. It has a lot of (almost) infinite resources and that has inspired players of all ages to think of creative builds, challenges, massive projects, or to even create machines and practice coding.

One of the most popular aspects of Minecraft is multiplayer. Players can create or join servers along with friends or like-minded gamers and battle or build amazing projects and entire communities. Playing Minecraft with friends can be surprisingly fun and it’s no wonder why it’s so popular.

Many players just join ready-made servers, but while easy, it can have its share of disadvantages. For example, the server can disappear with all of your projects. It could be hosted on a weak machine or with an insufficient connection, thus leading to lag. Or someone with bad intentions can join and ruin the fun for everyone. As such, many players prefer to create private Minecraft servers and have more control over what happens.

How much does it cost?

That would be the first question anybody asks. Naturally, people would like for it to be free. Hence, the reason why the searches for free Minecraft server hostings are so popular. But often “free” means you may not pay with money, but you pay with something else. For example, data sharing or getting swamped in ads. And it could also mean fewer resources, making the game unsuitable for massive projects or multiple players at the same time.

If you have big plans for a Minecraft server, then “free” shouldn’t be on your list. You could get away with a cheap Minecraft server hosting, but it’s also going to be somewhat limited in resources. However, if you have serious plans for your Minecraft server, then you should make it yourself and it’s not necessary that it will cost you an arm and a leg.

You can rent a dedicated server for as little as €39 a month. Surprisingly, this will offer you better hardware at a cheaper price than most ready-made Minecraft hosting services. Or you can get a lower spec cloud server for an even cheaper price. And you still get DDoS protection, unlimited low-latency bandwidth and a quality server in a secured data center on both.

Granted, you will have to set up the Minecraft portion of the server yourself, but that’s easy. How easy you ask? Let’s find out.

What resources do you need?

You can build a Minecraft server quickly and use a Linux distribution for lower costs. Of course, you can install it on a Windows machine, too, provided you have a license for the OS.

No matter what OS you choose, after you’re done installing it, you also have to download and install the Java Development Kit (JDK). It should be the latest version.

For Ubuntu you can do that via the terminal with the following set of commands:

sudo apt update
sudo apt install default-jdk
java –version

For CentOS you can run these commands:

sudo yum update
sudo yum install java-11-openjdk-devel
java –version

Next, you also need to install Screen in order to keep the server running when you’re not connected. The command for Ubuntu is:

sudo apt install screen

and for CentOS the command is:

sudo yum install screen

If you plan to run the server and play on the same machine, you need to download and install the Minecraft Java Edition. If you’re going to use the machine only as a server, you may skip this part.

Next up is installing the actual Minecraft server. You have to go to this site and follow the instructions.

If you still get an error that you haven’t agreed with the EULA, read it in the install directory (it’s a file with the name eula.txt). Then return to the terminal, opt to modify the eula.txt and change the line eula=false to eula=true and then save the file and exit the text editor.

Next up, run Screen with this command:

screen -S "Minecraft server"

And then run the actual Minecraft Server:

java -Xmx1024M -Xms1024M -jar minecraft_server.1.16.4.jar nogui

Wait a bit until you get a message that the task is done.

For Windows, you just need to click the Run.bat file to achieve the same result.

You will get the Server Windows from which you can see important stats. You can see the memory usage, connected players, chat and server logs and so on. You can also run a plethora or server commands with various effects. There’s a full list of all available commands on the Minecraft Wiki page. It’s a long one.

Depending on the configuration and host, you may need to configure the firewall and allow connections to the server. For Windows there’s a GUI, but for Linux distributions, you can use commands like this one for CentOS 7:

firewall-cmd --permanent --add-port=25565/tcp
firewall-cmd –reload

By default Minecraft uses port 25565 and you shouldn’t have problems with it. Also, ask the hosting support for help if there’s an issue with the connection.

Joining the server

Now your Minecraft server should be operational. It’s time to connect to it. If the server is on your home machine with Minecraft installed on it, you can connect to it via Minecraft > Multiplayer > Add Server and adding the name of the server. Simply type localhost in the Server Address field and you’re done.

If you have it on a remote server, then you have to connect to it via a subdomain (if you own one) or simply by entering the external IP address of the server. This will be available via the hosting provider.

You will have to enter the IP address in the “Add Server” menu of the Minecraft client, followed by the port. For example: 192.168.1.11:25565.

And that’s it. You will have a personal Minecraft server which you can play on with friends and people you invite. You can also add whitelisting to prevent random folks from being able to find and connect to the server. There’s also the option to add plugins or mods. That, though, would require adding Forge Server or another custom client to allow mods and the players connecting to it will also have to use it.

Good practices

When you have a server, you’re its administrator who’s responsible for its wellbeing. This means following a few good practices to make your life easier:

  • Add a whitelist so only pre-approved players can join.
  • Add a backup plugin for regular, automated server backups.
  • Write-up a set of server rules and share them with all players before they join, so they can read and agree with them.
  • Opt for a server with at least 4GB of RAM
  • Go for a host with unlimited bandwidth

There isn’t much more to it. Have fun in the block-like, but beautiful world of Minecraft!

Leave a Reply

Your email address will not be published.