Host a Minecraft Server on Ubuntu 24.04

With a dedicated Minecraft server, you can host a game world for others that persists even when you're not playing.
Try the NVMe cloud.

Start your 7-day free trial with no commitment. Explore freely and continue if it’s right for you.

So you’ve decided to host a dedicated Minecraft server for others to play on. Minecraft is great because of its customization—play it how you want—but all the different versions out there make things confusing. In this guide, I’ll give you a specific configuration that makes installing a Minecraft server on Ubuntu simple.

Note: this guide is to host Minecraft: Java Edition PC players on Windows, Mac, and Linux. These steps will not work for a Minecraft Bedrock server.

Hardware Prerequisites for a Minecraft Server

The specs you need will depend on how many players you want to support. Here are some minimum requirements:

  • Operating System: Ubuntu Server 24.04 or another Linux distro
  • Processor: 1 CPU core (Minecraft mostly utilizes a single thread.)
  • Memory: 2 GB minimum. See below.
  • Storage: 5 GB minimum. More recommended.

The server’s RAM directly affects how many players your server can support. The amount will vary based on your world and plugins, but here’s an estimate for the configuration in this guide:

  • Up to 6 players: 2 GB RAM
  • Up to 15 players: 4 GB RAM
  • Up to 25 players: 6 GB RAM
  • Up to 40 players: 8 GB RAM
  • 40+ players: 10 GB RAM

Want a Minecraft Server with hardware specs you can resize as your player base grows?
Check out our 1-click installers for Minecraft: Java Server or Minecraft: Bedrock Server from the LifeinCloud marketplace.

How to Install Minecraft Java Server on Ubuntu 24.04

Now we’re ready to install a Minecraft server!

I will give an example using Minecraft version 1.20.6.
It’s stable with popular mods and works well with the Complementary shader pack and Faithless texture pack.

I’ll also leave notes for other versions, so you can adapt as necessary.

1. Install Java

The Minecraft Java server depends on, you guessed it, Java.
The Java version you should install depends on the Minecraft version you want to run:

  • Minecraft 1.11 or older: Java 8
  • Minecraft 1.12 to 1.16.4: Java 11
  • Minecraft 1.16.5: Java 16
  • Minecraft 1.17.1 or newer: Java 21

Install Java :
sudo apt install openjdk-21-jdk

java version check

2. Download Minecraft Server

Not only are there different versions of Minecraft, there are also different Minecraft server flavors:

  • Vanilla is the official server app: it’s simple, but its performance is suboptimal.
  • Fabric works well for playing with friends on a private server, as it supports server mods.
  • Paper is great for public servers, as it prevents cheating and has great server optimization.

For this guide, I’ll be showing you how to run Paper as your Minecraft server.

View the Paper downloads page.
Copy the link that matches the Minecraft version you want to play.

Download Paper:
wget https://api.papermc.io/v2/projects/paper/versions/1.20.6/builds/151/downloads/paper-1.20.6-151.jar

3. Create the Server Launch Script

The server doesn’t get installed on your system but rather is run directly from the .jar file.
To enable server optimization, we’ll create a script to launch the server with specific flags.

First, visit Paper’s script generator and fill in these details:

  • Memory: Move the slider to choose how much server RAM to allocate.
    -Don’t max out your total. If your system has 4 GB, then allocate only 3 GB.
    -Don’t allocate more than 10 GB, as there can be performance drop-offs.
  • Filename: paper-1.20.6-151.jar
    (Replace with the file you downloaded.)
  • Platform: Linux
  • Flags: Aikar’s
    (This enables server optimizations.)
paper minecraft server script generator settings

When you’re done, click Copy to Clipboard.

Next, create a script file:
nano mc_launcher.sh

And paste the lines you copied from the script generator.
Save & exit (CTRL+X, Y, Enter).

Then, make the script executable:
sudo chmod +x mc_launcher.sh

4. Start the Minecraft Server

Launch the server using your script:
./mc_launcher

The first time you load it, it’ll flash an error about the EULA. That’s normal.

Press CTRL+C to quit out.

Agree to the EULA:
nano eula.txt

Change eula=false to eula=true to accept. Save & exit.

minecraft agree to EULA

Launch the server again:
./mc_launcher

It should load successfully this time.

5. Connect to the Minecraft Server

It’s time to play! Here’s how other players can join your server:

  • Launch Minecraft: Java Edition on PC.
  • Go to Multiplayer > Add Server
  • Under Server Address, put your server’s IP. Hit Done.
  • Click Join Server to play.
minecraft client add server

Phew, you did it! Enjoy playing Minecraft now as a proper game admin!
For more tips, check out our FAQ below. Until next time, friends.

FAQ

Why can’t players connect to my Minecraft server?

Your server could be blocking Minecraft’s default port: 25565.

You may need to allow TCP and UDP traffic to this port in multiple places, by:

  • Adding a rule to your server’s firewall
  • Adding a rule to the firewall interface, if hosted on a cloud VM (such as our LifeinCloud firewall)
  • Adding an AppArmor profile or disabling AppArmor temporarily
  • Adding a port forwarding rule if your server sits behind a router (such as at home)
minecraft server iptables open ports at top of chain

After applying your settings, you may need to reboot your server and launch the Minecraft server again.

Can I modify my Minecraft server’s behavior?

Yes. There are many server-side plugins you can install to control user permissions, enable voice chat, and so forth.
There’s even a plugin (Geyser) that enables cross-play for Minecraft: Bedrock Edition players.

Are there other ways to improve my Minecraft server’s performance?

Yes. You can tweak settings in Paper itself and also try plugins like Chunky.

Picture of Thomas Dyan

Thomas Dyan

Thomas is a staff writer for LifeinCloud whose experience crosses over into server administration, computer networking, and web software. Thomas has been tinkering with hardware and software most of his life. When he’s not writing about tech, he likes to watch standup, build mechanical keyboards, and read science fiction.

Useful insights?

Help others discover this article by sharing it.