How to Install Minecraft server on Ubuntu Server 22.04

In this article, we will show you How to install Minecraft server on Ubuntu Server 22.04. Ubuntu Server is a part of the larger set of Ubuntu products and operating system developed by Canonical Ltd. Ubuntu server is a specific addition that differs a little bit from Ubuntu desktop, in order to facilitate installation on servers. Ubuntu tools, which are open-source software, are alternatives to various types of licensed products. The word “Ubuntu” comes from a South African term for togetherness and sharing. Some of the differences with Ubuntu Server include the replacement of a graphical user interface with a character-based interface for installation, as well as other changes to the interface. These can be customized by the user. The system is compatible with many different platforms like Microsoft Hyper-V and VMware ESX server. You can also install Ubuntu 22.04 Linux with Hyper-V

When you install Ubuntu Linux it gives you access to various different features that other operating systems to do not provide access to, Ubuntu Server can be an easy and convenient way to set up a simple home network. One other feature of Ubuntu Server is the ability to assign “super user” tasks to make it easier to administer the network, where using the original edition can be more challenging or labor intensive. The video game Minecraft was created by Mojang Studios, Microsoft later bought the rights to it. Although it is not an open-source programmed, a Mojang account must be created in order to play the demo version for free. There is plenty of room for digging down beneath the surface. The Game Player starts out with nothing.

No tools, no shelter, not even a sense of direction or course. If you survive the night, whatever you do and everywhere you go will entirely depend on your decisions. Isn’t it awesome? There are plenty of shocks in Minecraft account. There are many other places to be found and explored, including lakes, rivers, valleys, mountains, deserts, waterfalls, woods, and lava flowers. A small crew dedicated to Minecraft’s continuing development creates the game. The game is now in beta, and a crew that is connected to the player base is continually adding new features.

How to Install Minecraft server on Ubuntu Server 22.04

Install Prerequisites

There are a few packages we’ll need in order to run the Minecraft server, so let’s start by installing them. Open a command line terminal and type the following two commands:

$ sudo apt update$ sudo apt install wget screen openjdk-18-jdk nmap

Explanation of each package we are installing:

Step 1: wget will be used to download Minecraft server fies

Step 2: screen is for running the Minecraft server in the background

Step 3: openjdk-18-jdk is a Java package that Minecraft needs in order to run

Step 4: nmap will be used later on for basic troubleshooting purposes

Create a Minecraft user

It’s best practice to let the Minecraft server run under its own dedicated account, rather than using root or some other account. Create a new account in Ubuntu with the following command:

$ sudo useradd -m -r -d /opt/minecraft minecraft

Install Minecraft server

Step 1: It’s possible to run multiple instances of the Minecraft server on a single host. We’ll show you how to do this later in the article, in case you’re wanting to run multiple servers. Each server instance we run will need its own directory under the /opt/minecraft directory. For this first server instance, let’s call it survival and create the following directory:

$ sudo mkdir /opt/minecraft/survival

Step 2: Now, we need to download the Minecraft server Java file with wget. Since Minecraft receives regular updates, you’ll need to make sure you’re downloading the latest version by going to the official Minecraft download page and copying the link to the .jar file. Use the following command to download the file, replacing the link in this example with the current one available: You need to accept the terms and conditions before being able to install the Minecraft server. Use this command:

$ sudo bash -c “echo eula=true > /opt/minecraft/survival/eula.txt”

Lastly, we need to give our minecraft user account ownership on the Minecraft server directory:

$ sudo chown -R minecraft /opt/minecraft/survival/

Create Minecraft SystemD startup script

Adding a Minecraft startup script to SystemD will make it really convenient to start your Minecraft server any time you need to put it up, such as after a system reboot. It also gives you an easy way stop the restart the server.

Step 1: Start by creating the following file with nano or your preferred text editor:

$ sudo vi /etc/systemd/system/minecraft@.service

Step 2: Paste the following content in the new file:

ExecStart=/usr/bin/screen -DmS mc-%i /usr/bin/java -Xmx2G -jar minecraft_server.jar nogui

To:

ExecStart=/usr/bin/screen -DmS mc-%i /usr/bin/java -Xmx4G -jar minecraft_server.jar nogui

Now, you can save your changes to the file and exit.

Start Minecraft Server

Starting the Minecraft server is very easy. Use the following systemctl command to put it up:

$ sudo systemctl start minecraft@survival$ sudo systemctl status minecraft@survival

Type the following command if you want the Minecraft server to start automatically every time your system reboots:

$ sudo systemctl enable minecraft@survival

To make sure your Minecraft server is listening for incoming connections, use the nmap command to check the default Minecraft port, which is 25565:

$ nmap -p 25565 localhost

Provision new Minecraft server instance on the same host

If you want to host another instance of Minecraft, most of the work has already been done for us. Now, we just need to copy over some of our existing configuration for the new instance. Since the first server runs on port 25565, we will run the second Minecraft server on port 25566 in this example.

Step 1: First, make a new directory for this instance. We’ll just call this new server linuxconfig:

$ sudo mkdir /opt/minecraft/linuxconfig

Step 2: Next, copy over the .jar file from the other Minecraft directory, and accept the terms and conditions again:

$ sudo cp /opt/minecraft/survival/minecraft_server.jar /opt/minecraft/linuxconfig/$ sudo bash -c “echo eula=true > /opt/minecraft/linuxconfig/eula.txt”

Step 3: Use the following command to append a line inside Minecraft’s configuration file. This will configure the server instance to run on port 25566:

$ sudo bash -c “echo server-port=25566 > /opt/minecraft/linuxconfig/server.properties”

Step 4: Give your minecraft user ownership of the new directory:

$ sudo chown -R minecraft /opt/minecraft/linuxconfig/

Step 5: Now, use systemctl to enable the server to start at system boot and start the server:

$ sudo systemctl enable minecraft@linuxconfig$ sudo systemctl start minecraft@linuxconfig

Step 6: Verify that the new instance is running correctly:

$ sudo systemctl status minecraft@linuxconfig

Step 7: Lastly, use the following content as a reference for the various settings you can use for your server(s). These settings are stored in  the server.properties file inside /opt/minecraft/linuxconfig.

$ sudo nano /opt/minecraft/linuxconfig/server.properties

Final Words

We hope like this article on How to install Minecraft server on Ubuntu Server 22.04. This article has taught us how to use the command line to install and remove Minecraft on Linux using Ubuntu 22.04. The article is completed now and you know How to install a Minecraft server on Ubuntu Server 22.04. If you are Windows user and facing the issue to update your Minecraft, you can also check our article on update Windows 11 Minecraft

I hope you understand this article, How to Install Minecraft server on Ubuntu Server 22.04.

Editorial Staff
Editorial Staffhttps://www.bollyinside.com
The Bollyinside editorial staff is made up of tech experts with more than 10 years of experience Led by Sumit Chauhan. We started in 2014 and now Bollyinside is a leading tech resource, offering everything from product reviews and tech guides to marketing tips. Think of us as your go-to tech encyclopedia!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related Articles

Best Telemedicine Software: for your healthcare practice

Telemedicine software has transformed my healthcare visits. It's fantastic for patients and doctors since they can obtain aid quickly. I...
Read more
I love microlearning Platforms in today's fast-paced world. Short, focused teachings that engage me are key. Microlearning platforms are great...
Think of a notebook on your computer or tablet that can be changed to fit whatever you want to write...
As of late, Homeschool Apps has gained a lot of popularity, which means that an increasing number of...
From what I've seen, HelpDesk software is essential for modern businesses to run easily. It's especially useful for improving customer...
For all of our important pictures, stories, and drawings, Google Drive is like a big toy box. But sometimes the...