With your own Minecraft server, you and your friends play on a world that is always online – with your rules, your plugins and your save. You can host it on your own hardware under Windows or Linux, or rent a Minecraft server if you would rather not deal with Java, port forwarding and keeping the machine running.

This guide covers both routes and walks the self-hosted path end to end: installing Java 25, choosing vanilla or Paper, the EULA, server.properties, ports, running permanently via systemd, whitelist, backups and the most common errors. It applies to the current Java Edition 26.2 ("Chaos Cubed", released 16 June 2026).

Creating a Minecraft server – four player characters on a hilltop at sunset overlooking a new world with a half-built house, crafting table, furnace and a village by the river

Last checked against the official Minecraft and Paper documentation, as of August 2026 (version 26.2).

What you will learn

  • whether renting or self-hosting fits you better
  • which Java version each Minecraft version needs – and why 26.x demands Java 25
  • how to install and start the server on Linux and Windows
  • what belongs in server.properties and which ports have to be open
  • how to keep the server running permanently with systemd, restarts included
  • how to handle whitelist, operators, backups and updates cleanly

Quick summary

  1. Decide: rent a ready-made server or host it yourself.
  2. Check the hardware: at least 2–3 GB of free RAM for small groups.
  3. Install Java 25 (mandatory from Minecraft 26.1).
  4. Download the server.jar from the official Minecraft page – or go straight to Paper.
  5. Start the server once and accept the EULA in eula.txt.
  6. Configure server.properties: name, player count, view distance.
  7. Open port 25565/TCP in your firewall and router.
  8. Set up permanent operation – systemd on Linux, a start script on Windows.
  9. Enable the whitelist and make yourself an operator with /op.
  10. Plan backups of the world folder with the server stopped.
Important
Minecraft 26.1 and newer only start on Java 25. The most common first-attempt error – UnsupportedClassVersionError – simply means your Java runtime is too old.

Table of contents

Rent or self-host?

Rent a serverSelf-host
Efforta few clicks, ready immediatelyinstallation, configuration, maintenance
Technical knowledgenone neededcommand-line basics
Availability24/7, automaticmachine must keep running, public IP required
DDoS protectionincludedorganise it yourself
Controlpanel with versions, modpacks, pluginsfull control over system and files
Costfixed monthly pricepower or server costs, no rental fee

If you just want to play, renting is the shorter route: with a Minecraft server from DeinServerHost you pick RAM and slots, and the server runs about two minutes later – versions, modpacks and plugins are switched in the panel, no console required.

The rest of this article belongs to the self-hosted path – worth it if you want full control or already run a root or virtual server anyway.

Requirements and hardware

For a self-hosted Minecraft server you need:

  • a machine that runs continuously (Linux with SSH access, or a Windows system)
  • enough free memory – on top of what the operating system itself needs
  • a publicly reachable IPv4 if friends should join over the internet
  • the Java version matching your Minecraft version

How much RAM?

The values below are planning and experience figures for servers without large modpacks:

PlayersRecommended server RAM
1–52–3 GB
5–154–6 GB
15–406–10 GB
Modpacks8 GB and more

More RAM is not automatically better: an oversized Java heap makes garbage collection pauses longer. The details live in optimizing Minecraft server performance.

Which Java version?

Minecraft versionRequired Java
1.17–1.20.4Java 17
1.20.5–1.21.xJava 21
26.1 and newerJava 25

Since December 2025, Minecraft uses the year.drop.hotfix versioning scheme – current versions start with 26. Java 25 became mandatory with 26.1; an older runtime will not start the server.

Networking: a public IPv4

When hosting at home, classic port forwarding needs a public IPv4 address. With DS-Lite or CGNAT, your line often has no directly reachable IPv4 for incoming connections – and then no amount of firewall configuration helps. Clarify this with your provider first, or fall back to a rented server.

Installing Java

On Linux (Debian/Ubuntu)

sudo apt update && sudo apt upgrade -y
sudo apt install -y openjdk-25-jre-headless
java -version

If java -version reports a 25.x version, you are set. If your distribution does not ship a Java 25 package yet, install Eclipse Temurin 25 from the Adoptium repository – the most widely used free Java distribution.

On Windows

Download Eclipse Temurin 25 from the Adoptium website and run the installer. Then check in the command prompt:

java -version
Caution
With several Java versions installed, the system uses whichever it finds first. If the server dies with UnsupportedClassVersionError, your start script is almost certainly invoking an old Java – point it at the full path of the Java 25 installation.

Vanilla or Paper?

Mojang's server.jar ("vanilla") is the official server. Paper is a performance-optimised server core that behaves like vanilla but runs considerably faster and supports plugins:

VanillaPaper
Sourceminecraft.net (official download page)papermc.io
Performancebaselineconsiderably better optimised
Pluginsnoyes (Bukkit/Spigot compatible)
Game behaviourreferencenearly identical, fine-tunable
Current version26.226.2 (stable builds available)

For almost every server, Paper is the better choice – even without plugins, purely for the performance. Stable Paper builds for 26.2 are available. The setup below works identically with both jars; just swap the file name.

Both downloads are free. Get the vanilla server.jar only from the official Minecraft download page and Paper only from papermc.io – not from third-party mirrors.

Installing the server and first start

On Linux

Create a directory and place the jar there (the download link comes from the official page and changes with every version):

mkdir -p /opt/minecraft && cd /opt/minecraft
wget -O server.jar "<official-download-link>"

First start – it aborts on purpose and creates eula.txt:

java -Xms2G -Xmx2G -jar server.jar --nogui

Accept the EULA and start again:

sed -i 's/eula=false/eula=true/' eula.txt
java -Xms2G -Xmx2G -jar server.jar --nogui

The server now generates the world and reports Done shortly after. Typing stop in the server console shuts it down cleanly.

-Xms and -Xmx set the memory – put both on the same value and size them according to the table above.

On Windows

Create a folder (e.g. C:\minecraft) and save the jar there. In the same folder, create a file called start.bat:

@echo off
java -Xms2G -Xmx2G -jar server.jar --nogui
pause

Double-click start.bat – the first run aborts and creates eula.txt. Open it in a text editor, change eula=false to eula=true, save, and start again. After Done the server is live; stop in the console shuts it down cleanly.

Tip
Use Aikar's flags for the server start right from the beginning instead of the bare -Xms/-Xmx parameters – they reduce lag spikes considerably. The ready-made start command is in optimizing Minecraft server performance.

Configuring the server (server.properties)

The first start creates server.properties in the server directory. The most useful values to begin with:

motd=My Minecraft Server
max-players=20
difficulty=normal
view-distance=8
simulation-distance=6
white-list=true
  • motd is the text shown in the server list.
  • view-distance=8 and simulation-distance=6 save noticeable load compared to the defaults, without anyone noticing in game.
  • white-list=true makes sure only listed players can join (setup below).

Edit the file only with the server stopped and without spaces around the equals sign. The complete reference of every entry with its default lives in Minecraft server.properties explained – and what no longer belongs in the file at all (e.g. pvp) is covered in Minecraft game rules.

Ports and firewall

PurposePortProtocol
Minecraft Java (game connection)25565TCP
Query (optional, enable-query)25565UDP
RCON (optional, enable-rcon)25575TCP

Linux with ufw

sudo ufw allow 25565/tcp

Windows firewall

Create an inbound rule for TCP port 25565 (Windows Security → Firewall → Inbound Rules → New Rule → Port).

Router

When hosting at home, additionally forward 25565/TCP in your router to the internal IP of the server machine. Give that machine a fixed local IP address, or the forwarding rule will point at nothing after the next reboot.

Important
The game connection runs over TCP – a UDP rule alone is not enough. UDP is only needed for the optional query protocol.

Keeping the server running

A systemd unit starts the server on boot and restarts it after a crash. Example /etc/systemd/system/minecraft.service (adjust paths and user):

[Unit]
Description=Minecraft Server
After=network.target

[Service]
Type=simple
User=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/usr/bin/java -Xms2G -Xmx2G -jar server.jar --nogui
Restart=on-failure

[Install]
WantedBy=multi-user.target

Enable it:

sudo systemctl daemon-reload
sudo systemctl enable --now minecraft

Watch logs with journalctl -u minecraft -f, restart with systemctl restart minecraft.

Linux: screen (quick alternative)

screen -S minecraft
java -Xms2G -Xmx2G -jar server.jar --nogui

Detach with Ctrl + A, then D – the server keeps running; return with screen -r minecraft. For permanent operation, systemd is the more robust option because it survives crashes and reboots.

Windows

start.bat has to keep running for as long as the server should be online. For automatic start on boot, create a task in Task Scheduler that runs the script at system startup.

Connecting to the server

Start Minecraft → MultiplayerAdd Server and enter the address:

YOUR-SERVER-IP:25565

With the default port you can leave out the :25565. On the home network your friends use the internal IP of the server machine; from outside, the public IP or your domain. If you test your own public IP from inside the same network, NAT loopback can skew the result – test over a mobile connection when in doubt.

Whitelist and operators

With the whitelist enabled (white-list=true), only listed players get onto the server. In the server console:

whitelist add PLAYERNAME
whitelist list

Operators may use commands such as /gamerule or /whitelist in the game as well:

op YOUR-PLAYERNAME

Hand out operator rights sparingly – the default level 4 can do practically everything, including /stop. Which game rules you can set afterwards (PvP, keep inventory, sleep percentage) is covered in Minecraft game rules.

Caution
Leave online-mode=true switched on. With false, the server no longer verifies Mojang accounts – anyone could connect under any name, including yours.

Backups and updates

Backups

The entire save lives in the world folder (world/ by default). For a consistent backup:

  1. Stop the server (stop or systemctl stop minecraft).
  2. Copy the world folder and server.properties.
  3. Store the backup off the machine.
  4. Start the server again.

Do not copy the world while the server is running – half-written chunks can make the backup unusable.

Updates

When Minecraft updates, download the new jar from the official source (vanilla) or the new build from papermc.io (Paper), stop the server, replace the jar and start again. Always back up first – worlds migrate forwards, never backwards.

Server and clients have to match: a 26.2 client cannot join a 26.1 server, and vice versa.

Troubleshooting

ProblemLikely causeFix
UnsupportedClassVersionError on startJava too old for the Minecraft versioninstall Java 25 and point the start script at the right Java path
Server exits immediately, mentions eula.txtEULA not acceptedset eula=true in eula.txt
Address already in use / FAILED TO BIND TO PORTport 25565 already takenstop the old server process or change server-port
Friends cannot join, works locallyfirewall or router forwarding missingopen 25565/TCP in the firewall and the router
"Outdated server/client" when connectingversions do not matchbring server and client to the same version
OutOfMemoryError or crashes under loadtoo little RAM allocatedraise -Xmx, sized to free RAM and player count
Server lags with few playersview distance/entities too high, chunks generated livelower view-distance and simulation-distance, measure with spark
Unreachable from outside despite port forwardingDS-Lite/CGNAT without public IPv4ask your provider for a public IPv4 or rent a server
Own public IP fails from the home networkNAT loopbacktest over mobile data, use the local IP internally
Strangers connect under arbitrary namesonline-mode=falseset online-mode=true and restart

Frequently asked questions

How much does a Minecraft server cost?

The server software itself is free – vanilla and Paper alike. Self-hosting costs you power or the price of your root/virtual server; a rented game server has a fixed monthly price including operation and DDoS protection.

Which Java version do I need for a Minecraft server?

Minecraft 26.1 and newer need Java 25. Older versions: 1.20.5–1.21.x run on Java 21, 1.17–1.20.4 on Java 17. A runtime that is too old fails with UnsupportedClassVersionError.

How much RAM does a Minecraft server need?

2–3 GB covers 1–5 players, 4–6 GB covers 5–15; modpacks want 8 GB or more. Set -Xms and -Xmx to the same value and never allocate all of the system's memory.

Which port does a Minecraft server use?

Port 25565 over TCP by default. UDP is only needed for the optional query protocol; RCON defaults to port 25575/TCP.

Vanilla or Paper – which should I pick?

Paper. It runs considerably faster than vanilla, behaves practically identically in game and supports plugins. Stable Paper builds for the current version 26.2 are available.

How do I make my server friends-only?

Set white-list=true in server.properties and add your players with whitelist add PLAYERNAME. Keep online-mode=true as well, so names are verified against Mojang accounts.

Why can't my friends join my server?

Most of the time the port is not open: 25565/TCP has to be allowed in the firewall and forwarded in the router. Other usual suspects are mismatched game versions and DS-Lite lines without a public IPv4.

Servers for other games

Much of this guide – port forwarding, systemd, backups – applies to other games just as well:

Summary

Creating a Minecraft server comes down to five core steps: install Java 25, download Paper (or vanilla), accept the EULA, adjust server.properties and open port 25565/TCP. For permanent operation, a systemd unit does the job on Linux, Task Scheduler on Windows.

After that it is about the finish: a whitelist against uninvited guests, online-mode left on, regular backups of the world folder with the server stopped – and when lag hits, measure first, configure second.

If you would rather hand off operation, updates and DDoS protection, a rented Minecraft server at DeinServerHost is ready in about two minutes – versions, modpacks and plugins are switched right in the panel.