Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Gaming

How to make a Minecraft Java server, step by step

Make a Minecraft Java server from scratch: what a server does, what it needs, then Java 25, the EULA, server.properties, a systemd service and the firewall.

CloudSat teamNovember 18, 20267 min read
A single glowing cube on a dark grid, with thin lines of light running from it to small player-shaped markers around the edges.
On this pageDo you need a server at all?

A Minecraft server is the game's world simulation running on its own, with no graphics and no player of its own. It keeps the world loaded, ticks it 20 times per second, saves it to disk, checks every login against your rules, and lets players connect with their normal game. Because it runs separately from anyone's PC, the world stays online when you log off, and you decide who gets in. This guide covers when you need one, the choices to make first, and a complete setup on a Linux server with Java 25, a service that survives reboots and a firewall.

Do you need a server at all?

For an evening with friends in the same house, Open to LAN is enough. For a small group that wants an always-on world without any setup, a Realm works, with limits on players and no mods or plugins. Our guide to playing with friends compares those routes. A server becomes the right tool when:

  • The world must stay up while the host is offline.
  • More people play than a Realm allows, or you want plugins, mods, maps or your own rules.
  • You want full control over backups, versions and who has admin rights.

Three decisions before you install

  1. Edition. This guide builds a Java Edition server. Bedrock has its own server software, summarized near the end.
  2. Server software. Mojang's vanilla server.jar gives pure gameplay with data packs. Paper adds plugins and performance fixes, while Fabric and NeoForge load mods. The steps below are the same for vanilla and Paper; our server software comparison helps you choose.
  3. Where it runs.
A PC at home A rented server
Upload bandwidth Shared with the household Data-center uplinks
Uptime Only while the PC is on Around the clock
Your home IP address Visible to every player Never involved
Setup Port forwarding on the router A public IP from the start

What the server needs

  • Java 25. Minecraft 26.1 and later require it. Older 1.20.5 to 1.21.11 servers run on Java 21.
  • Memory. A heap of 2 to 3 GB carries a few friends on vanilla or Paper, on a machine with 4 GB in total. Plugins, mods and player counts raise that; our Minecraft RAM guide has the numbers.
  • A fast CPU core. The main game loop runs on one thread, so clock speed matters more than core count.
  • SSD storage with room for the world to grow, plus backups.
  • Port 25565 over TCP, reachable from the internet.

A CloudSat High Frequency VPS fits that list: Ryzen cores at 4.2 GHz or more, NVMe storage and a dedicated IPv4 address, with 4 GB at $11.58/mo.

Step 1: Prepare the system

These commands target Ubuntu 24.04 or 26.04, where OpenJDK 25 is in the standard repositories. Install Java and tmux, then create an unprivileged user that will own the server:

sudo apt update && sudo apt upgrade -y
sudo apt install -y openjdk-25-jre-headless tmux
java -version
sudo useradd --system --create-home --home-dir /opt/minecraft --shell /usr/sbin/nologin minecraft
sudo -u minecraft mkdir /opt/minecraft/server

java -version should report version 25. Running the game as its own user, never as root, limits what a bad plugin or a stolen admin account can reach.

Step 2: Download the server and accept the EULA

Copy the download link for the current release from the official server download page on minecraft.net, or from papermc.io if you chose Paper, and fetch it:

cd /opt/minecraft/server
sudo -u minecraft wget -O server.jar "https://link-copied-from-the-download-page/server.jar"
sudo -u minecraft java -Xms2G -Xmx2G -jar server.jar nogui

The first start creates eula.txt and server.properties, then stops without generating a world. Read the Minecraft EULA linked in eula.txt; running a server means agreeing to it. Then record your acceptance:

sudo -u minecraft sed -i 's/^eula=false/eula=true/' eula.txt

Step 3: Set server.properties before the world exists

Because no world has been generated yet, this is the moment to set a seed or a world type. The settings most servers change:

Key What it controls A sensible start
motd The line shown in the server list Your server's name
difficulty Mob damage and hunger normal
max-players Concurrent players Your real peak, plus a few
view-distance How far players see, in chunks 10
simulation-distance How far the world is ticked 8
white-list Only listed players may join true
enforce-whitelist Kicks players removed from the list true
online-mode Verifies every account with Microsoft true, always
level-seed Seed for the new world Blank for random

Fresh 26.3 servers already generate white-list=true. Keep online-mode on: without it, anyone can join under any name, including yours, and letting in accounts that do not own the game breaks Mojang's rules for servers. Leave enable-rcon=false unless you have a reason and a firewall rule to keep its port private.

Step 4: Run it as a service

A service starts the server at boot and stops it cleanly on shutdown. This unit runs the game inside a tmux session named mc, so you can still reach its console:

# /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft server
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
User=minecraft
WorkingDirectory=/opt/minecraft/server
ExecStart=/usr/bin/tmux new-session -d -s mc /usr/bin/java -Xms3G -Xmx3G -jar server.jar nogui
ExecStop=/usr/bin/tmux send-keys -t mc stop Enter
ExecStop=/bin/sh -c 'while /usr/bin/tmux has-session -t mc 2>/dev/null; do sleep 1; done'
TimeoutStopSec=180
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target

Passing the Java command to tmux as separate words makes tmux start it directly, without needing a login shell for the minecraft user. On stop, the unit types stop into the console and waits until the world is saved and the session closes. Enable it and open the console:

sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo -u minecraft tmux attach -t mc

Detach again with Ctrl+B followed by D; the server keeps running. Read the log without attaching with tail -f /opt/minecraft/server/logs/latest.log.

Step 5: Open the port

Allow SSH before you enable the firewall, or you will lock yourself out:

sudo ufw allow OpenSSH
sudo ufw allow 25565/tcp
sudo ufw enable
sudo ufw status

Step 6: Make yourself admin and invite players

In the tmux console, type commands without a slash:

op YourName
whitelist add FriendName
list

Players open Multiplayer, choose Add Server and enter the server's IP address. Our admin command cheat sheet covers operator levels, bans and game rules from there.

Bedrock instead?

Bedrock Dedicated Server is a separate download from minecraft.net, for Windows or Ubuntu. On Linux, unzip it into its own folder, start it with LD_LIBRARY_PATH=. ./bedrock_server, and open UDP port 19132. Access is controlled through allowlist.json and permissions.json, and it loads add-ons rather than plugins. Console players cannot type a custom server address, which limits a self-hosted Bedrock server to phones, tablets and Windows.

Keep it healthy

  • Update deliberately. Stop the server, back it up, replace the jar, start it again, and read the log. New versions convert the world forward, and there is no simple way back.
  • Back it up automatically, with at least one copy off the machine. Our backup and restore guide has a complete script.
  • Watch the tick time as the world grows. tick query shows whether the server keeps 20 ticks per second, and our guide to fixing server lag explains what to do when it does not.

FAQ

Is there a way to host a Minecraft server without paying?

The server software costs nothing, so a server on your own PC is free apart from power and bandwidth. The trade-offs are that it only runs while the PC is on, it shares your home upload speed, and every player can see your home IP address.

How many players can a small server handle?

It depends on what players do far more than on how many there are. A handful of friends fits easily in a 2 to 3 GB heap. Twenty players exploring fresh terrain need far more CPU and memory than twenty players at spawn, so watch the tick time and grow the server when it struggles.

Does a Minecraft server need a graphics card?

No. The server never renders anything. It needs a fast CPU core, enough memory and quick storage.

Are the steps different on Windows or macOS?

Only the setup around the jar changes. Install a Java 25 runtime, put server.jar in its own folder, run the same java -Xms2G -Xmx2G -jar server.jar nogui command from a terminal, accept the EULA, and allow Java through the system firewall when asked.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.