Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
You can run a Minecraft server on Linux with a dedicated account, the right server software and Java version, and a few network settings. The first choice is the edition: the official Java server is for Java Edition players; Bedrock players need the separate Bedrock Dedicated Server. This walkthrough covers a private Java Edition server on Ubuntu or Debian, then explains access, security, backups, and the Bedrock alternative.
Choose the edition and server software first
Java and Bedrock servers are not interchangeable. Minecraft’s official Java server download is for Java Edition. Bedrock Dedicated Server is a separate product; its official Linux support is for Ubuntu 22.04 LTS or later, according to the download page. Ordinary Java and Bedrock clients cannot join the same server without additional bridge or proxy software.
| Server type | Choose it when |
|---|---|
| Vanilla Java | You want the official, unmodified Java server and do not need plugins. |
| Paper | You want plugins and additional server administration or tuning options. It is a third-party server implementation, not vanilla. |
| Fabric, Forge, or NeoForge | You want a modded server. The Minecraft version, loader, mods, and Java runtime must match; players may also need compatible client-side mods. |
| Bedrock Dedicated Server | Your players use Bedrock clients such as mobile, console, or Minecraft for Windows. Follow its separate installation instructions. |
For a first Linux server, vanilla Java is a straightforward baseline. Choose Paper if you specifically need its plugin ecosystem or features. A proxy such as Velocity is for connecting multiple servers and is unnecessary for one small server.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsWhat you need
- A 64-bit Ubuntu or Debian machine with
sudoaccess. Commands below assume Ubuntu/Debian; package names and firewall tools differ elsewhere. - A stable network connection. Wired networking is preferable for a home server.
- SSD storage if available, and space for the world plus backups.
- A matching Java runtime for Java Edition, or the separate Bedrock package for Bedrock.
- For home hosting, a stable local address for the Linux machine and an Internet connection that permits inbound connections.
- A backup destination separate from the server’s working files.
As a practical starting estimate, a small vanilla server for roughly 2–5 players might allocate 2–4 GB to the server; Paper with several plugins often warrants 4–6 GB, and modpacks may need 6–12 GB or more. These are not guarantees: player count, world generation, simulation distance, entities, plugins, and CPU performance all matter. Leave memory for Linux and other services rather than assigning all system RAM to Minecraft. Fast single-thread CPU performance can matter more than a high core count.
#1 Best Overall
- ENGAGING AND COOPERATIVE: Experience the thrill of Minecraft in a unique and cooperative board game format. Perfect for teams of 2 to 4 players, the game encourages joint strategies and shared victories
- EVER-CHANGING GAMEPLAY: With a map that changes every time you play, this game offers high replay value, making every game a unique and unpredictable experience
- QUALITY COMPONENTS: The game includes 25 wooden blocks, 18 world tiles, 4 inventory boards, 6 player cards, 9 buildings, 12 mob tokens and more. All components are crafted with care to enhance your gaming experience
- AGE-APPROPRIATE CHALLENGE: Aimed at ages 7 and up, this game offers a great balance of fun and challenge, making it a great choice for family game nights, parties, or gatherings
- TRUSTED BRAND: With over 130 years of experience, Ravensburger ensures top quality games that stimulate the mind, engage the hands, and touch the heart
Install the Java version your server requires
There is no single Java release that is correct for every Minecraft server version. Check the requirements for the exact server software and game version before installing. For example, Paper’s current getting-started documentation lists Java 21 for Paper versions covering Minecraft 1.20 through 1.21.11, and Java 25 for Paper 26.1 and newer. Check that page again when choosing a different version; this mapping is Paper-specific.
Update package lists and install the runtime that matches your chosen server:
sudo apt update
sudo apt upgrade -y
sudo apt install -y openjdk-21-jre-headless
java --version
Use openjdk-25-jre-headless instead when the server requires Java 25 and that package is available for your distribution release. Package availability varies. If your repositories do not provide the required version, follow a reputable JDK vendor’s Linux instructions and verify the selected runtime. If multiple Java versions are installed, sudo update-alternatives --config java can select the default; check the result with java --version.
An error such as UnsupportedClassVersionError usually means the server JAR needs a newer Java runtime than the one being used.
Create a dedicated server account
Do not run the Minecraft process as root. A dedicated account limits the files and permissions available to the server process. The following creates a system account whose home directory is /opt/minecraft:
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
Administrators can edit files with sudo or use an appropriately restricted administrative account; keep the service itself running as minecraft.
Rank #2
- The Minecraft Labyrinth invites 2-4 people aged 7 and over to immerse themselves in the world of Minecraft, move corridors and search for hidden characters and items
- The classic in the look of the well-known and popular computer game Minecraft! The labyrinth has been delighting children and adults for decades and has become a highlight among board games
- A fun family game for children and adults: This board game for ages 7 and up is a must-have in any game collection! Simple rules, entertaining games and exciting rounds ensure long-lasting fun
- A search and slide game that challenges and encourages logical thinking in a playful way
- A great gift or souvenir for all Minecraft fans: the characteristic illustrations provide an authentic gaming experience
Download and initialize the server
For vanilla, download the desired Java server version from the official Minecraft server page. Do not rely on a copied “latest” file URL: releases change. Save the downloaded JAR in /opt/minecraft and give it a consistent name:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →sudo mv /path/to/minecraft_server.<version>.jar /opt/minecraft/server.jar
sudo chown minecraft:minecraft /opt/minecraft/server.jar
sudo -u minecraft -s
cd /opt/minecraft
java -Xms2G -Xmx4G -jar server.jar nogui
Replace the placeholder path and filename with the actual download. The memory values are examples, not required settings. The initial run generates files and then stops until you accept the EULA.
To use Paper instead, download the build for the Minecraft version you intend to run from Paper’s own resources linked in its documentation, then follow that version’s Java and startup instructions. Do not use a Paper JAR with the vanilla filename unless you have deliberately named it that way.
Accept the EULA and configure the server
Read eula.txt, then edit it:
nano eula.txt
Set the agreement line to:
eula=true
This is acceptance of the Minecraft EULA, not just a technical switch. Review the current terms before agreeing. If the file was created under a different account, check its ownership as well.
Edit server.properties while the server is stopped. These settings are a reasonable private-server starting point; not every server implementation or version exposes identical properties:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallmotd=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
- Leave
server-ip=blank unless you have a specific reason to bind the server to one interface. A wrong address can prevent startup. - Keep
online-mode=truefor an ordinary authenticated Java server. Turning it off is not a routine fix for connection or authentication trouble; it can allow username impersonation. 25565is Java Edition’s conventional default port, not a requirement. If you change it, open and forward the new port instead.view-distanceandsimulation-distanceaffect resource use. Lowering them can help a constrained machine, though it changes gameplay.max-playerssets a cap; it does not promise that the machine can handle that many players smoothly.
Start the server and use the console
For a manual test, run the same Java command from the server directory:
Rank #3
- AUTHENTIC MINECRAFT EXPERIENCE: Developed in collaboration with Mojang, for a true shared in-person adventure that brings all the excitement and strategy of the beloved video game to your tabletop
- NEW ADVENTURES AWAIT: Every game offers a unique Overworld grid to explore, inviting players to strategize their building and Biome approach, ensuring a fresh experience each time
- USER-FRIENDLY DESIGN: Comes with an easy-to-understand instruction manual, making it simple to start playing right away - no lengthy set up times
- QUALITY COMPONENTS: The game includes high-quality pieces, from 64 resource cubes and 36 weapon tokens, to 4 player boards and 4 unique character skins, offering an immersive gaming experience
- PERFECT GIFT IDEA: The ideal birthday or holiday present for Minecraft lovers of all ages, offering hours of strategic fun and creative play
cd /opt/minecraft
java -Xms2G -Xmx4G -jar server.jar nogui
Useful console commands include:
whitelist on
whitelist add PlayerName
whitelist list
op PlayerName
save-all
stop
Replace PlayerName with the player’s exact in-game name. Operator privileges are powerful; grant them only to people you trust. Use stop to shut down cleanly so the server can save world data.
Run it at startup with systemd
A terminal session is fine for testing, but systemd can start the server at boot, report its status, and collect logs. First find Java’s executable path:
command -v java
Create a startup script, using the path returned above if it is not /usr/bin/java:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →sudo nano /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
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 and start it, then inspect its status and logs:
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo systemctl status minecraft
sudo journalctl -u minecraft -f
To stop or restart the service, use sudo systemctl stop minecraft or sudo systemctl restart minecraft. Important: this basic service does not type the Minecraft console command stop before stopping Java. Test its shutdown behavior rather than assuming it is equivalent to a clean console shutdown. For a more controlled workflow, use a console-management tool or server manager that can issue save-all and stop; otherwise stop the server before backups and maintenance, and verify that world data saves correctly.
Open the firewall and make the server reachable
For a Java server using the default port, allow TCP through Ubuntu’s UFW firewall:
Rank #4
- Cooperative Minecraft children's game for ages 5 and up for 2-4people
- The children's version for the popular "Minecraft Builders & Biomes" board game
- Build a farm together by collecting the right blocks with pickaxe and shovel
- Different levels and additional challenges offer long-lasting fun - easy game entry for younger children or a challenge for professionals
- A great gift for Minecraft fans young and old, which is fun for ages 5 and up
sudo ufw allow 25565/tcp
sudo ufw status
Allow the port actually set in server.properties if it differs. A local firewall rule is only one part of the path.
Free tools Windows power users keep installed
One-click scans. No signup required.
If the server is at home
- Give the Linux machine a stable LAN address, ideally with a DHCP reservation in the router.
- In the router, forward the Java port over TCP to that LAN address. For the default setup, that is TCP 25565.
- Keep the Linux firewall rule in place and make sure the server is running.
- Have a friend test from outside your home network using your public IP address. Some routers do not support loopback testing from inside the same network.
Players on the same home network should use the server’s private address, which you can inspect with hostname -I, such as 192.168.1.50:25565. Do not give that private address to players connecting from the Internet.
If the server is on a VPS
Home-router forwarding is not needed. Allow the port both in the VPS provider’s network firewall or security group and in the Linux firewall. Friends connect to the VPS public IP or a DNS name, with the port if it is non-default.
For either location, the connection path is Internet → router forward or provider firewall → Linux firewall → Minecraft process. A UFW rule alone cannot fix a missing router rule or cloud firewall rule.
If port forwarding does not work
Check that the router forwards to the current LAN address, that the server listens on the expected port, and that you selected TCP for Java. Double NAT, a blocked inbound port, or ISP carrier-grade NAT (CGNAT) can also prevent ordinary home port forwarding. If direct access is unavailable, consider a VPS or managed host. A tunnel service such as playit.gg may provide another route, but adds a third-party dependency and may affect latency, availability, or connection limits. A private overlay network such as Tailscale is another option for a small group willing to install a client.
Recommended Free Tools
Connect and keep the server private
Java Edition players add a multiplayer server using the public IP or hostname. With the default port, the port can usually be omitted; for a custom port use hostname:port. Players on your LAN can use the Linux machine’s private address instead. Everyone must use a compatible Minecraft version and the correct edition.
Best Value
- The cooperative Minecraft card game invites 2-4 players aged 8 and up to explore the picturesque landscapes of Minecraft and search for hidden treasures
- Experience Minecraft as a new, exciting adventure and fill your chests with treasures before you are caught by the monsters
- Only if you work well as a team and combine luck with strategy can you win the game together.
- The card game for 2-4 people is entertaining and varied, lots of fun and perfect for taking with you thanks to its practical travel format.
- The card game is perfect for every family or friends game night and a great gift for all small and big fans of Minecraft.
For a private server, leave the whitelist enabled and add each player from the console:
whitelist on
whitelist add PlayerName
Also follow a basic security baseline:
- Keep the Minecraft service off root and expose only the ports you need.
- Keep Linux, Java, the server software, plugins, and mods updated. Download plugins and mods from sources you trust; they are executable code.
- Use SSH keys and disable root SSH login on an Internet-facing machine. Do not expose SSH with password authentication if you can avoid it.
- Keep
online-mode=truefor ordinary Java hosting, and do not give console or filesystem access to players. - Back up before updates or plugin/mod changes. Keep at least one backup off the server machine.
Back up before you update
A world is data worth protecting. For a small server, a stopped-server archive is a simple starting point. First prepare a destination outside the server directory:
sudo mkdir -p /opt/minecraft-backups
sudo chown minecraft:minecraft /opt/minecraft-backups
Stop the server cleanly using its console stop command when possible. If using the basic systemd service, stop it and verify shutdown before copying. Then archive the world 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 with server software and configuration. A modded server may also need loader data, mod configuration, and other files. Adjust the file list to match your setup. Keep multiple generations, copy at least one to another disk or machine, and test a restore. A simple file copy while chunks are actively being written is not necessarily a consistent backup; use a server-aware backup tool for a large or always-online world.
Before a version update, announce maintenance, save and stop the server, make a full backup of the server directory, and record the server and Java versions plus installed plugins or mods. Download the new server JAR from its official source and keep the old JAR until the new version has been tested. Start the new version, read the logs, and check connections and gameplay. Do not assume a world can be safely downgraded: restore a backup or test on a copy if you need to roll back.
Common problems
| Symptom | What to check |
|---|---|
java: command not found |
Install the required runtime and run java --version. If versions are selectable, check sudo update-alternatives --config java. |
UnsupportedClassVersionError |
The runtime is too old for that server JAR. Match Java to the exact server software and Minecraft version. |
| EULA error | Check cat /opt/minecraft/eula.txt and confirm eula=true. If necessary, fix ownership with sudo chown minecraft:minecraft /opt/minecraft/eula.txt. |
| Server starts, but friends cannot connect | Check sudo systemctl status minecraft, sudo ss -ltnp | grep 25565, and sudo ufw status. Then verify the public IP, router destination, TCP protocol, VPS firewall, client version, and possible CGNAT. |
| Port appears closed | Confirm the server is listening and that every layer is open: router forwarding and host firewall at home, or provider firewall and host firewall on a VPS. |
Failed to bind to port |
Another process may be using the port, the server may already be running, or server-ip may name an address not assigned to the machine. Inspect sudo ss -ltnp | grep 25565 and normally leave server-ip= blank. |
| Server restarts repeatedly under systemd | Inspect sudo journalctl -u minecraft -n 100 --no-pager. Check the Java path, JAR filename, permissions, EULA, startup flags, and Java compatibility. |
| Lag or “Can’t keep up!” | Look at CPU and memory use, disk I/O, view and simulation distance, entity counts, world generation, farms, plugins, and mods. More heap is not always the answer; an oversized heap can increase garbage-collection pauses. |
| “Outdated Client” or “Outdated Server” | Bring the client and server to compatible versions. This also applies to Bedrock; see Microsoft’s Bedrock server guidance. |
Bedrock Dedicated Server on Linux
Bedrock requires its own server package; do not use the Java JAR. The official Linux download supports Ubuntu 22.04 LTS or later. Microsoft’s setup instructions cover extraction, startup, and default ports. The documented start command is LD_LIBRARY_PATH=. ./bedrock_server. Follow the current package’s instructions rather than applying the Java setup commands to it.
Bedrock normally uses UDP 19132, with UDP 19133 also documented for the alternate/IPv6 port. Microsoft gives these Ubuntu UFW rules:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
sudo ufw allow 19132
sudo ufw allow 19133
sudo ufw reload
For home hosting, forward the corresponding UDP port or ports in the router; for a VPS, allow them in both the provider firewall and Linux firewall. Bedrock players connect using the server address and configured port. Make sure client and server versions are compatible.
Home server, VPS, or managed host?
Self-hosting on a spare computer is a good fit if you want to learn Linux, have stable Internet access, and are willing to manage networking, security, and backups. A VPS provides a public IP and more predictable uptime, but still requires you to administer the operating system and Minecraft. A managed Minecraft host is usually easier for people who want a control panel, guided modpack installation, or support rather than Linux administration. Compare recurring price, CPU quality, backup terms, support, and resource limits—not just advertised RAM or player slots.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

