How to Install a Minecraft Server on Ubuntu Server (22.04/24.04)

By Virgil on May 4, 2025 | howtos


How to Install a Minecraft Server on Ubuntu Server (22.04/24.04)

 

Minecraft isn’t just a game—it’s a platform for creativity, collaboration, and even education. Running your own Minecraft server gives you full control over mods, worlds, and who plays. In this guide, we’ll walk you through setting up a vanilla Minecraft server on an Ubuntu 22.04 or 24.04 server from Cloudnium.net


✅ Prerequisites

Before you begin:

  • You need an Ubuntu server (22.04 or 24.04 LTS).

  • At least 2GB of RAM (4GB recommended for smooth play).

  • A non-root user with sudo privileges.

  • ufw or another firewall tool installed.


🧱 Step 1: Update the Server

First, make sure your server is up to date:

bash
sudo apt update && sudo apt upgrade -y

Install basic dependencies:

bash
sudo apt install curl wget git ufw -y

☕ Step 2: Install Java

Minecraft requires Java 17 or newer.

bash
sudo apt install openjdk-17-jdk -y

Confirm the version:

bash
java -version

You should see something like:

nginx
openjdk version "17.0.x"

📁 Step 3: Create a Minecraft Server Directory

It’s a good idea to keep your server files organized:

bash
mkdir -p ~/minecraft/server cd ~/minecraft/server

📥 Step 4: Download the Minecraft Server .jar

Visit https://www.minecraft.net/en-us/download/server and copy the link for the latest .jar file.

Then use wget to download it. Example:

bash
wget https://launcher.mojang.com/v1/objects/your-version-url/server.jar -O minecraft_server.jar

(Replace the URL with the actual current one from Mojang)


🛡️ Step 5: Accept the EULA

Run the server once to generate the files:

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

You’ll see an error about the EULA. Open the file:

bash
nano eula.txt

Change:

ini
eula=false

To:

ini
eula=true

Save and exit.


🧠 Step 6: Configure Basic Server Settings (Optional)

Open server.properties to tweak game rules like difficulty, PvP, max players, etc.

bash
nano server.properties

Make your changes, then save.


🚀 Step 7: Start the Server

Now start the Minecraft server:

bash
java -Xmx2048M -Xms1024M -jar minecraft_server.jar nogui

This will launch your Minecraft world. It may take a minute or two to finish generating.


🔒 Step 8: Open Firewall Ports

Allow Minecraft’s default port (25565):

bash
sudo ufw allow 25565 sudo ufw reload

🔁 Optional: Keep It Running in the Background

You can use screen or tmux to keep your server running after you disconnect:

bash
sudo apt install screen screen -S minecraft java -Xmx2048M -Xms1024M -jar minecraft_server.jar nogui

To detach from the session:
Ctrl + A, then D

To reattach later:

bash
screen -r minecraft

🌍 Connect to Your Server

Launch Minecraft on your client and connect to your server using your server's public IP address and port 25565.

 


Share this article: Twitter Facebook LinkedIn