Yes, Linux is an excellent platform for a Minecraft server, but the first decision is the edition. The official Java server runs Java Edition clients; Bedrock players need Microsoft’s separate Bedrock Dedicated Server, whose official Linux support is limited to Ubuntu 22.04 LTS or later. For most Linux beginners, the safest route is a Java Edition vanilla server on Ubuntu or Debian, running under a dedicated account and managed by systemd. This guide takes you from Java installation and EULA acceptance through firewall rules, router forwarding, backups, updates, and troubleshooting. It also explains when Paper, modded software, a VPS, or managed hosting is a better fit.
Which Minecraft server should you run on Linux?
Choose the client edition before installing anything. Java Edition uses the official Java server JAR; Bedrock Edition uses a different dedicated-server package and network protocol. An ordinary Java server and an ordinary Bedrock server are not interchangeable, and Java and Bedrock clients cannot join the same server without an additional compatibility bridge or proxy.
| Choice | Best for | Linux considerations |
|---|---|---|
| Java vanilla | Official, unmodified survival | Simplest baseline and the path used in this walkthrough |
| Paper | Plugins, administration, and performance tuning | Third-party implementation with its own Java-version matrix |
| Fabric | Lightweight modded servers | Loader, mods, and client versions must match |
| Forge or NeoForge | Large modpacks and heavily modded gameplay | Usually needs more memory and stricter version control |
| Bedrock Dedicated Server | Mobile, console, and Minecraft for Windows players | Official Linux download supports Ubuntu 22.04 LTS or later |
| Velocity or another proxy | Networks containing multiple servers | Unnecessary for one small server and an advanced configuration |
The official Java server download is compatible only with Java Edition. If your friends play Bedrock, use the Bedrock Dedicated Server download instead.
What do you need before installing?
You need a 64-bit Linux installation, administrative access through sudo, a stable network connection, and enough CPU, memory, and storage for both Linux and the game. A wired connection is preferable for a home machine, and an SSD generally gives smoother world loading than a mechanical disk.
- Memory: as a starting estimate, allocate about 2–4 GB to a vanilla server for two to five players, 4–6 GB for several players with Paper plugins, and 6–12 GB or more for many modpacks. These are practical starting points, not guarantees. World size, view distance, simulation distance, entities, redstone, mods, plugins, and player count all change the result.
- CPU: Minecraft’s main tick loop benefits substantially from strong single-thread performance. More cores do not automatically eliminate lag.
- Storage: reserve room for the world, logs, updates, and multiple backups. Keep at least one backup copy on another disk or machine.
- Networking: home hosting needs a stable local address and normally a public IPv4 path. A VPS normally supplies a public address but still requires local and provider firewall rules.
- Access: use a dedicated, non-root service account. Do not run the game process as
root.
The official Bedrock page lists 4 GB of system memory and approximately 180 MB to 1 GB of disk space for its package. Those figures are not recommended capacity for a large world or modded server.
Should you host at home, on a VPS, or with a managed provider?
Self-hosting on an existing Linux computer gives the most control and avoids a recurring hosting bill, but it also makes you responsible for power, Internet uptime, updates, firewalling, backups, and router configuration. A VPS removes the home-router problem and usually stays online, while a managed Minecraft host trades operating-system control for a panel, support, and convenience.
| Situation | Most suitable route | Main trade-off |
|---|---|---|
| Learning Linux with a few friends and a spare computer | Self-host at home | You manage hardware, power, networking, and backups |
| ISP uses CGNAT or blocks inbound ports | VPS or a tunnel service | A tunnel adds a third-party dependency; a VPS adds monthly cost and administration |
| 24/7 access with minimal Linux work | Managed Minecraft host | Higher cost per resource and less operating-system control |
| Root access and control over the complete stack | Bare VPS | You must perform the setup and maintenance yourself |
| One-click modpacks and support | Managed host with modpack tooling | Provider-specific panels and migration procedures |
| Public community server | Professionally managed host or carefully managed VPS | Backups, monitoring, abuse handling, and network capacity become more important |
Displayed managed-host prices are volatile and should be checked at checkout. For example, the pricing page at BisectHosting showed monthly 2 GB through 12 GB tiers from $5.99 to $35.99 when checked; PebbleHost advertised budget plans from $1 per GB and a displayed 6 GB Premium configuration at $13.50 per month; and Apex Hosting showed introductory prices of $11.24 for 4 GB, $16.87 for 6 GB, and $20.99 for 8 GB, followed by recurring prices of $14.99, $22.49, and $27.99. Promotional terms, regions, CPU tiers, backups, and billing periods affect the final cost. ScalaCube advertised plans from $2 per month and a first-month promotion; “unlimited slots” is not a promise of unlimited playable performance.
A tunnel such as playit.gg can help a home server behind CGNAT, but it adds another service, may change latency or address format, and does not replace server security or backups. A VPS option such as Amazon Lightsail, Microsoft Azure, DigitalOcean, or Vultr provides control, not automatic Minecraft administration; provider firewall, storage, snapshot, and bandwidth charges may be separate.
How do you install Java on Ubuntu or Debian?
The commands below assume Ubuntu or Debian. Package names and repository availability differ on other distributions, so do not copy them unchanged to an unrelated Linux release.
Update the operating system
sudo apt update
sudo apt upgrade -y
Match Java to the server version
Do not choose a Java release by habit. Paper’s current documentation lists Java 21 for Minecraft versions 1.20 through 1.21.11 and Java 25 for Paper 26.1 and newer. Check the server implementation’s documentation whenever you change Minecraft versions. The Paper getting-started guide is the current reference for Paper.
sudo apt install -y openjdk-21-jre-headless
java --version
For a server requiring Java 25, the corresponding package command is:
sudo apt install -y openjdk-25-jre-headless
java --version
OpenJDK 25 may not exist in the normal repositories of your distribution or release. If it is unavailable, use a current, reputable JDK distribution and follow that vendor’s Linux instructions. If multiple Java releases are installed, select the active one with:
sudo update-alternatives --config java
How do you create a safe Minecraft service account?
Create a system account whose home directory is the server directory. This limits the damage a compromised plugin or server process can do elsewhere on the machine.
sudo useradd --system --home /opt/minecraft --create-home --shell /usr/sbin/nologin minecraft
sudo mkdir -p /opt/minecraft
sudo chown -R minecraft:minecraft /opt/minecraft
For interactive administration, you can use a normal locked-down account with a shell, but the service should still run as that account rather than as root. Switch to the service account for the initial setup:
sudo -u minecraft -s
cd /opt/minecraft
How do you download and initialize the Java server?
Download the correct JAR
Select the desired release from the official Minecraft Java server page. Do not hard-code a guessed “latest” URL: release filenames and versions change. Save the downloaded file in /opt/minecraft, then rename it to a stable name:
mv minecraft_server.<version>.jar server.jar
ls -lh server.jar
For Paper, download the build matching your Minecraft version from Paper’s official downloads and documentation. Paper supplies runnable JARs and a startup-script generator, but it changes server behavior and should be chosen for plugins, performance, or administration features rather than substituted automatically for vanilla.
Run it once to generate files
cd /opt/minecraft
java -Xms2G -Xmx4G -jar server.jar nogui
The first launch normally creates eula.txt, server.properties, a logs directory, and world directories. The process will stop or refuse to continue until the EULA is accepted. The official download page states that using the server is subject to the Minecraft EULA and Privacy Policy; read the current terms yourself.
Accept the EULA
nano eula.txt
Change only the agreement value:
eula=true
If the file contains the standard line, this command makes the same edit:
sed -i 's/^eula=false/eula=true/' eula.txt
How should you configure server.properties?
Stop the server before changing important settings, then edit the file as the minecraft user:
nano /opt/minecraft/server.properties
A sensible private-server starting profile looks like this:
motd=My Linux Minecraft Server
gamemode=survival
difficulty=normal
max-players=10
online-mode=true
white-list=true
server-port=25565
server-ip=
view-distance=10
simulation-distance=8
enable-command-block=false
spawn-protection=16
server-ip=should normally remain blank. Setting it to an address that is not assigned to the machine causes binding failures.online-mode=truekeeps ordinary Java authentication enabled. Disabling it can allow unauthenticated usernames and is not a normal fix for connection problems.server-port=25565is the conventional Java TCP port, not a requirement. If you choose another port, use that same port in the firewall, router, and client.view-distancecontrols how many chunks players can see, whilesimulation-distancecontrols active game simulation. Lower values can reduce CPU and memory pressure.max-playersis only a connection cap; it does not guarantee that the machine can handle that many active players.- A whitelist is appropriate for a private group. Property names and available settings vary by server software and version.
How do you start the server manually?
From the server directory, use the same memory values you selected during testing:
cd /opt/minecraft
java -Xms2G -Xmx4G -jar server.jar nogui
Paper’s short-form example is java -Xms4G -Xmx4G -jar paper.jar --nogui; those values are examples, not universal requirements. Leave memory for Linux, filesystem cache, monitoring, and other services instead of assigning all system RAM to Minecraft.
Useful console commands include:
list
whitelist on
whitelist add PlayerName
op PlayerName
save-all
stop
Use stop rather than killing the process. It lets the server save world data cleanly.
How do you keep the server running with systemd?
A service manager starts the server at boot, records logs, and can restart it after a failure. It is more dependable than leaving a terminal or a screen session open.
Create a startup script
As root, create /opt/minecraft/start.sh:
#!/usr/bin/env bash
set -euo pipefail
cd /opt/minecraft
exec /usr/bin/java -Xms2G -Xmx4G -jar /opt/minecraft/server.jar nogui
Confirm the Java path first if necessary:
command -v java
Use the returned path in the script, then set permissions:
sudo chmod 750 /opt/minecraft/start.sh
sudo chown minecraft:minecraft /opt/minecraft/start.sh
Create the service unit
sudo nano /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft Java Edition Server
After=network-online.target
Wants=network-online.target
[Service]
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/opt/minecraft/start.sh
Restart=on-failure
RestartSec=10
TimeoutStopSec=60
Nice=5
[Install]
WantedBy=multi-user.target
Load the unit and start it:
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
Check its state and follow its logs:
sudo systemctl status minecraft
sudo journalctl -u minecraft -f
Use these commands for maintenance:
sudo systemctl stop minecraft
sudo systemctl restart minecraft
A basic systemd stop sends a termination signal; it does not type Minecraft’s stop command into the Java console. For a small private server, test the shutdown behavior before relying on it. If graceful console commands are essential, use a console-aware manager or a controlled screen/tmux wrapper, and schedule backups while the server is stopped or through server-aware tooling.
How do you open the Linux firewall and home router?
Java on a home computer or VPS
For the conventional Java port:
sudo ufw allow 25565/tcp
sudo ufw status
If you changed server-port, replace 25565 with the actual port. On a VPS, also create the matching TCP rule in the provider’s security group or network firewall.
Bedrock ports
Microsoft’s Bedrock documentation identifies UDP 19132 for the ordinary IPv4 connection and UDP 19133 as the documented alternate IPv6/default port. Its Ubuntu example is:
sudo ufw allow 19132
sudo ufw allow 19133
sudo ufw reload
Bedrock uses UDP; Java’s ordinary server connection uses TCP. Do not open only the wrong protocol.
Forward a home router port
- Give the Linux machine a DHCP reservation or static LAN address.
- Forward the external Minecraft port to that address.
- Use TCP for Java or UDP for Bedrock.
- Allow the same port through UFW.
- Test from outside the home network, because some routers do not support NAT loopback.
The complete direct path is Internet → router forward → Linux firewall → Minecraft process. A local UFW rule alone cannot make a home server reachable from the Internet.
Diagnose CGNAT and double NAT
If forwarding appears correct but the port remains unreachable, check for ISP CGNAT, a second router, an inbound-port block, a stale DHCP address, or an incorrect protocol. In that situation, move the server to a VPS, use a tunnel service after reviewing its current terms and limits, or use a private overlay network for a small group willing to install a client.
How do players connect?
Java players on the same LAN
Find the Linux machine’s private address:
hostname -I
A player on the same network can enter an address such as 192.168.1.50:25565. This private address is not the address to give friends on the Internet.
Java players outside the home
Give them your public IP address or DNS name and the configured port, for example public-address:25565. The client can omit the port only when you use the default Java port. A VPS player uses the VPS public address or hostname after both provider and Linux firewalls allow the port.
Bedrock players
Use the Bedrock server’s configured address and UDP port. Do not send Java clients to a Bedrock server or assume a Bedrock client can join a Java server. Microsoft’s Bedrock setup documentation notes that client and server versions must be compatible; “Outdated Server” and “Outdated Client” messages generally require version alignment.
How do you secure a small Minecraft server?
- Run the process as
minecraft, never as root. - Keep
online-mode=trueunless you have a specific, understood proxy architecture. - Enable the whitelist and grant operator status only to trusted people.
- Keep Linux, Java, the server JAR, plugins, and mods updated.
- Download plugins and mods from trusted official sources and treat them as executable code.
- Open only the required firewall ports.
- Use SSH keys, disable root SSH login, and avoid password authentication on an Internet-facing machine.
- Back up before every version, plugin, or mod change.
- Do not grant players console or filesystem access.
Whitelist commands are:
whitelist on
whitelist add PlayerName
whitelist list
whitelist remove PlayerName
Granting operator access with op PlayerName gives powerful administrative abilities; use it sparingly.
How should you back up the world?
A stopped-server archive is a simple, consistent starting point. Prepare a destination outside the live directory:
sudo mkdir -p /opt/minecraft-backups
sudo chown minecraft:minecraft /opt/minecraft-backups
Stop the service and archive the worlds and important configuration:
sudo systemctl stop minecraft
sudo tar -czf
/opt/minecraft-backups/minecraft-$(date +%F-%H%M).tar.gz
-C /opt/minecraft
world world_nether world_the_end server.properties whitelist.json ops.json
sudo systemctl start minecraft
World-directory names can differ by server software and configuration. A modded server may also need loader data, mod configuration, and other files, so preserving the complete server directory is safer before a major change. Keep several generations, store at least one copy on another disk or machine, and test a restore. A file copy made while chunks are being written is not automatically a valid backup; large always-online servers benefit from server-aware backup tools.
How do you update or roll back the server?
- Announce maintenance to players.
- Run
save-all, thenstopfrom the console, or stop the service through a tested graceful-shutdown method. - Back up the complete server directory.
- Record the Minecraft version, Java version, plugins, mods, and configuration.
- Download the new JAR from the official vendor and keep the old JAR under a different name.
- Start the new version and read the logs carefully.
- Test login, world loading, plugins or mods, and ordinary gameplay.
- Restore the backup and old JAR if compatibility problems appear.
Never assume that downgrading is safe. A newer server can alter world data in ways an older version cannot read; test upgrades on a copy and retain the pre-update backup. Paper’s Java requirements change with supported Minecraft versions, so check its current version table before changing Java.
What are the most common Linux server failures?
java: command not found
Install a JRE or JDK, then verify it:
java --version
If more than one release is installed, choose the active binary with sudo update-alternatives --config java.
UnsupportedClassVersionError
The JAR was built for a newer Java release than the runtime in use. Match Java to the exact server implementation and Minecraft version; current Paper documentation lists Java 21 for 1.20–1.21.11 and Java 25 for 26.1 and newer.
EULA or permission errors
cat /opt/minecraft/eula.txt
sudo chown minecraft:minecraft /opt/minecraft/eula.txt
Confirm that the file contains exactly eula=true and that the service account can read and write the server directory.
The service starts but friends cannot connect
sudo systemctl status minecraft
sudo ss -ltnp | grep 25565
sudo ufw status
Then verify the public address, router destination address, protocol, VPS security-group rule, server version, and possible CGNAT or double NAT. The process must be listening on the port you are forwarding.
Failed to bind to port
Another process may already own the port, an older server may still be running, or server-ip may name an address not assigned to the host. Inspect the listener and normally leave server-ip= blank:
sudo ss -ltnp | grep 25565
Severe lag or “Can’t keep up!”
Check CPU saturation, available memory, disk I/O, view and simulation distance, entity counts, redstone or farms, world generation, plugins or mods, and network latency. More heap is not a universal cure: an oversized Java heap can increase garbage-collection pauses. Reduce simulation load and identify the specific workload before changing memory.
The service repeatedly restarts
sudo journalctl -u minecraft -n 100 --no-pager
Common causes include a wrong Java path, an incorrect JAR filename, ownership problems, a missing EULA, invalid flags, or a Java/server-version mismatch.
Players see “Outdated Client” or “Outdated Server”
Bring the client and server to compatible versions. This is especially common with Bedrock Dedicated Server, where Microsoft documents those messages as version-compatibility problems.
When should you choose Paper or a modded server?
Paper
Choose Paper when you need Bukkit/Spigot-compatible plugins, additional administration features, or performance-oriented tuning and accept a third-party implementation. Download a build matching the Minecraft version, use its documented Java release, and treat plugin updates as executable-code changes that require backups.
Fabric, Forge, and NeoForge
Use a mod loader when the gameplay itself depends on mods or a modpack. The loader, Minecraft version, Java version, and mod versions must align, and players commonly need a compatible client-side installation. Modded servers usually need more memory and stricter backup discipline than a vanilla server; never update a modded world without a tested backup.
How do you install the official Bedrock server on Linux?
Bedrock is a separate path, not a variation of the Java commands above. The official Linux download supports Ubuntu 22.04 LTS or later, and Microsoft’s instructions should be treated as the authority for package requirements and version compatibility.
- Download the Bedrock Dedicated Server package from the official Bedrock page.
- Extract it into a dedicated directory owned by a non-root account.
- From that directory, launch it with the documented command:
LD_LIBRARY_PATH=. ./bedrock_server
Configure the Bedrock properties file, keep the client and server releases aligned, and open UDP 19132 and, where applicable, UDP 19133 in both UFW and any upstream firewall. Bedrock players connect with the address and port configured for that server; Java clients cannot use it as an ordinary Java server.
What is the practical first-day checklist?
- Confirm Java or Bedrock edition and select compatible server software.
- Install the matching runtime and verify it with
java --versionwhere applicable. - Create
/opt/minecraftand a dedicated service account. - Download the exact server release from its official source.
- Run once, accept the EULA, and edit
server.properties. - Test locally before exposing the server.
- Enable
systemd, inspect logs, and test a clean stop and restart. - Open the correct firewall protocol and configure router forwarding or the VPS security group.
- Turn on the whitelist and limit operator access.
- Create and restore-test a backup before inviting players.
Frequently Asked Questions
Can I move an existing Minecraft world from Windows to Linux?
Yes. Stop the old server, copy the complete world and configuration directories into the new server directory, preserve the server version initially, and assign ownership to the Linux service account. Test the copy before allowing players to connect; changing versions at the same time makes it harder to identify a migration problem.
Can one Linux machine run several Minecraft servers?
Yes, but each instance needs its own directory, service account or carefully separated permissions, memory allocation, and listening port. Give every service a distinct WorkingDirectory and JAR path, then open and forward only the ports that players actually need.
Do I need a domain name for my Minecraft server?
No. Players can use a public IP address. A DNS name is optional; an A record can point a hostname to an IPv4 address, while a custom port may still need to be entered unless you configure the appropriate Minecraft DNS record and keep the address current.
What should I monitor after the server goes live?
Watch the service log with journalctl -u minecraft -f, disk space with df -h, memory with free -h, and CPU or process activity with tools such as top. Sudden disk growth, repeated restarts, or steadily rising memory use are reasons to investigate before players experience corruption or outages.
Can Java and Bedrock friends play together on this setup?
Not on an ordinary Java or Bedrock server by themselves. Cross-play requires a compatible bridge or proxy, additional configuration, and careful version testing, so it is best treated as a separate advanced project rather than added to a first Linux installation.