Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk11 min

How to Create a Minecraft Server on Ubuntu (Java Edition)

A complete Ubuntu guide for hosting Minecraft: Java Edition, from Java installation and the first server launch to firewall rules, router forwarding, backups, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To create a Minecraft server on Ubuntu, install a Java runtime, download the official Java Edition server JAR, run it once to generate its files, accept the EULA, configure server.properties, and keep the process running under a service manager. For internet play, allow the server’s TCP port (25565 by default) through Ubuntu’s firewall and forward that port from your router to the Ubuntu computer.

This guide covers Minecraft: Java Edition. Bedrock Dedicated Server is a separate download and its Linux build requires Ubuntu 22.04 LTS or later; Bedrock clients cannot join a Java server without an additional compatibility bridge.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the edition and where the server will run

Java Edition server software runs on Linux, including Ubuntu, and the official server download is free. The machine can be your everyday desktop, a spare mini PC, a dedicated home server, or a virtual private server (VPS). The installation commands are nearly the same, but the networking work differs:

  • Home computer or mini PC: no recurring hosting bill, but the computer must remain powered on. You must configure the home router and avoid exposing your public IP unnecessarily.
  • VPS: usually stays online in a provider’s data center and avoids inbound connections to your home network. You pay a recurring fee and must configure the provider’s cloud firewall as well as Ubuntu.
  • Managed service: the provider handles most Linux administration. Minecraft Realms is the official convenience alternative, with automatic backups for up to 10 players, but it is not an Ubuntu-hosted server.

Use the Java server only for Java Edition players. The official Bedrock Dedicated Server is a different product with separate files and requirements.

#1 Best Overall
Minecraft - Bedrock Edition PS4
  • Play and share with friends on console, mobile and Windows 10
  • discover community creations in the new in-game store
  • access new mini games and game modes through servers

Requirements before installation

  • An Ubuntu installation with administrator access through sudo.
  • A supported Java Runtime Environment (JRE) for the exact Minecraft server release you plan to run.
  • Storage for the JAR, generated world folders, logs, and backups.
  • A stable network connection. Internet players also need a reachable public address and a router or cloud firewall you can administer.
  • A plan for who receives operator privileges and whether a whitelist will be enabled.

Minecraft’s official documentation intentionally describes Java as “compatible” rather than guaranteeing one major version forever. Check the current server download or release notes immediately before installation and again before every upgrade.

Install and verify Java

Refresh Ubuntu’s package index and install a headless Java runtime. The package named default-jre-headless follows Ubuntu’s current default; if the server release requires a different major version, install that version’s Ubuntu package instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt update
sudo apt install default-jre-headless

Confirm what Ubuntu will use:

java -version

Record the major version shown. If the server exits with an UnsupportedClassVersionError, the installed Java is too old (or, less commonly, a conflicting Java binary is being selected). Install the major version required by that server release, then run java -version again. Do not assume that the version used by one Minecraft release remains correct for later releases.

Create a dedicated account and server directory

Running the server as root gives a game process more access than it needs. A separate account and directory keep world data, configuration, and logs together while limiting the damage from a compromised plugin or misconfigured command.

sudo adduser --system --home /srv/minecraft --group minecraft
sudo mkdir -p /srv/minecraft
sudo chown -R minecraft:minecraft /srv/minecraft
sudo -u minecraft -H bash

The last command opens a shell as the service account. If you prefer to stay in your administrator shell, prefix individual file operations with sudo -u minecraft instead. From this point, work in the server directory:

cd /srv/minecraft

The path /srv/minecraft is a practical Linux convention, not a Minecraft requirement. You can use another directory if you apply consistent ownership and service settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Download the official Java server JAR

Open Minecraft’s official Java server download page and download the JAR for the release you want. Save it in /srv/minecraft. Naming it server.jar makes service commands stable when you upgrade; keeping the versioned filename can make rollback easier. If you rename the file, use the same name in every launch command and service definition.

Rank #2
Minecraft Playststion 3 Edition - PlayStation 3
  • Learn your way around one block at atime in the new tutorial mode
  • Craft all sorts of items from boats todiamond armor and create enormousstructures
  • Team up with friends in eight-playeronline multiplayer and four-player splitscreen modes

Do not substitute a third-party mirror when the official download is available. Keep the release number in a note so you know exactly which JAR produced a world and configuration.

Run the server once to generate its files

From the server directory, start a headless instance. The values below are an example starting point, not a guaranteed memory requirement:

java -Xms1G -Xmx2G -jar server.jar nogui

The first launch creates eula.txt, server.properties, a world directory, and other files, then stops because the EULA has not been accepted. Memory needs vary with the Minecraft version, simulation distance, mods or plugins, world activity, and player count. Leave enough RAM for Ubuntu and other services; increasing -Xmx does not automatically improve performance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Accept the EULA and configure the server

Accept the EULA

Read the license terms on the official Minecraft site. If you agree, change the generated setting from false to true:

sed -i 's/^eula=false$/eula=true/' eula.txt

Check the result before starting:

grep '^eula=' eula.txt

The output must be eula=true. If it remains false, the server will stop again and report that the EULA must be accepted.

Review server.properties

Open the configuration file:

nano server.properties

These settings are the ones most private servers change first:

Setting Purpose Practical guidance
server-port TCP port on which Java clients connect The default is 25565. If you change it, use the same number in Ubuntu’s firewall, router forwarding, cloud firewall, and player connection address.
gamemode Default game mode for new players Choose the mode appropriate for your group; existing player data may retain its own mode.
difficulty World difficulty Set it before inviting players if you want a predictable survival experience.
max-players Maximum simultaneous players accepted by the server This is a configuration ceiling, not a performance guarantee. Capacity depends on hardware, world activity, version, and mods or plugins.
motd Message shown in the multiplayer list Use it to identify the server and communicate basic rules.
Whitelist settings Restricts joining to named players Enable a whitelist for a private group, then add players by name from the server console.

Save the file and close the editor. The server reads many properties at startup; restart after changing a setting if the console does not apply it immediately.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Ravensburger Minecraft Heroes of The Village | Cooperative Board Game | Exciting & Unpredictable | Perfect for Families and Minecraft Enthusiasts | Suitable for Kids & Adults
  • 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

Start it for testing

Run the same command again from /srv/minecraft:

java -Xms1G -Xmx2G -jar server.jar nogui

Watch the console for a message indicating that the server has finished loading. On the same Ubuntu machine, launch Java Edition and connect to localhost. This test isolates server configuration from router and internet problems. To stop safely, type stop in the Minecraft console and wait for it to save the world.

Keep the server running after logout and reboot

A terminal test ends when the shell closes. For a real server, use a supervisor such as systemd or run the process in a persistent terminal multiplexer. Systemd is convenient for automatic startup and status checks.

Create a systemd unit

As an administrator, create /etc/systemd/system/minecraft.service and paste this unit, changing the JAR name or memory values if necessary:

[Unit]
Description=Minecraft Java server
After=network-online.target
Wants=network-online.target

[Service]
User=minecraft
Group=minecraft
WorkingDirectory=/srv/minecraft
ExecStart=/usr/bin/java -Xms1G -Xmx2G -jar server.jar nogui
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Save the file, reload systemd, start the service, and enable it for future boots:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft

Check whether it is running:

sudo systemctl status minecraft
sudo journalctl -u minecraft -f

Logs go to journald, so you do not need to make the server directory writable by root. Use sudo systemctl restart minecraft after a configuration change and sudo systemctl stop minecraft before maintenance. For world copies or upgrades, allow the server to save and stop cleanly; the console’s stop command is the safest method when you have an interactive console.

Use tmux when you need an interactive console

If you need to issue Minecraft commands directly, install tmux and keep the process in a detachable session:

sudo apt install tmux
sudo -u minecraft -H tmux new -s minecraft
cd /srv/minecraft
java -Xms1G -Xmx2G -jar server.jar nogui

Detach with the tmux key sequence shown by tmux, then reconnect with sudo -u minecraft -H tmux attach -t minecraft. A tmux session does not by itself restart the server after a crash or reboot, so systemd is preferable for unattended operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Minecraft Dungeons: Hero Edition – Xbox Series X & Xbox One
  • Minecraft Dungeons Hero Edition includes the Hero Pass DLC content: a Hero Cape, two player skins, and a chicken pet. It also includes the Jungle Awakens and Creeping Winters DLC packs.
  • Dungeon Creeper Battle new-and-nasty mobs in this all-new action-adventure, inspired by classic dungeon crawlers.
  • Multiplayer Up to four players can team up and fight together in co-op mode.
  • Power Up Unlock dozens of unique items and weapon enchantments for devastating special attacks.
  • Options Personalize your character, then fight up-close and personal with melee swings, hang back with ranged attacks, or tank your way through swarms of mobs, by heavy armor

Open the network path

Ubuntu firewall (UFW)

If UFW is enabled, permit only the port selected in server.properties. For the default Java port:

sudo ufw allow 25565/tcp
sudo ufw status

The official default is TCP 25565. Do not open unrelated ports just to make Minecraft work. If you selected another port, replace 25565 everywhere with that value.

Home-router port forwarding

For players outside your home, create one port-forwarding rule in the router:

  1. Give the Ubuntu host a stable LAN address, preferably with a DHCP reservation.
  2. Forward TCP port 25565 on the router’s internet (WAN) side to TCP port 25565 on that Ubuntu LAN address.
  3. Keep the Ubuntu firewall rule enabled.
  4. Test from a different network, such as a phone using cellular data. Testing from inside the same LAN may fail on routers that lack NAT loopback even when internet access works.

If your internet provider uses carrier-grade NAT, you may not receive a publicly reachable IPv4 address. In that case, ordinary port forwarding cannot accept unsolicited connections; ask the provider about a public address or use a VPS or managed service instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

VPS or cloud firewall

On a VPS, there is no home-router rule. Add an inbound TCP rule for the selected port in the provider’s cloud firewall or security group, then allow the same port with UFW on Ubuntu. Both layers must permit the connection.

Connect players safely

A player on the server machine connects to localhost. A player on the same home network normally uses the Ubuntu host’s private LAN address. A remote player uses the host’s public address followed by :25565 when the default port is in use; if you changed the port, they must use that number.

Keep the whitelist enabled for a private group. Grant operator status only to people who need administrative commands, because an operator can alter the world and server settings. Minecraft’s help documentation warns that advertising a home public IP creates a security risk to the home network. Share the address only with the people who need it, and avoid publishing it in a public forum.

Best Value
Sale
ThinkFun Minecraft Cave Adventure | Screen-Free Strategy Puzzle Game | 40 Logic Challenges | Ages 8+
  • Official Minecraft Puzzle Game – Hands-On Logic Game Based on the Best-Selling Video Game.
  • 40 Strategic Challenges – Use the Actions to Navigate & Solve Increasingly Tough Puzzles.
  • No Screens, Just Strategy – Promotes Problem-Solving with Off-Screen Minecraft Fun.
  • Perfect for Ages 8+ – Great Gift for Minecraft Fans Who Love a Challenge!
  • Trusted by Parents Worldwide – With Over 50 Million Sold, ThinkFun is the World's Leading Manufacturer of Brain Games and Mind-Challenging Puzzles!
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Back up worlds and configuration

Stop the server before copying live world data. At minimum, back up:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • world
  • world_nether
  • world_the_end
  • server.properties
  • whitelist.json, ops.json, and any other access-control files present

Copy the directories to storage outside the live server directory, retain more than one dated version, and test a restore in a separate directory. A backup that has never been restored is not verified. Include the server JAR version and Java version in your backup notes so you can reproduce the environment.

Upgrade without damaging a world

  1. Tell players the maintenance time and stop the server with the console stop command.
  2. Make and verify a backup of all world and configuration directories.
  3. Check the official release information for the new JAR and its compatible Java requirement.
  4. Keep the old JAR until the new installation has loaded successfully; rename files rather than deleting them immediately.
  5. Replace or add the new JAR, update the systemd unit if its filename changed, and start the server.
  6. Read the console and journal for conversion warnings or errors before allowing players back in.

World formats and mods can have release-specific migration rules. Never treat an upgrade as a reason to skip the backup.

Troubleshoot the common failures

The server says the EULA has not been accepted

Open /srv/minecraft/eula.txt as the minecraft user and confirm the exact line is eula=true. Make sure you edited the file in the same directory used by WorkingDirectory; editing a second copy elsewhere has no effect.

Unable to access jarfile

List the directory and compare the actual filename with ExecStart:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo -u minecraft ls -l /srv/minecraft

Correct the unit or rename the JAR, then run sudo systemctl daemon-reload and restart the service. Check ownership if the file exists but cannot be read.

UnsupportedClassVersionError

Run java -version under the same account and inspect the server release notes for the required major version. Install the compatible Ubuntu Java package and ensure the service points to the intended /usr/bin/java.

Players on the internet cannot connect

  • Confirm the service is running with sudo systemctl status minecraft.
  • Confirm something is listening on the selected port with sudo ss -ltnp | grep 25565.
  • Check server-port, UFW, and the VPS cloud firewall or router forwarding rule.
  • Verify the player is using the public address, not the Ubuntu host’s private LAN address.
  • Test from an external network and check whether the ISP uses carrier-grade NAT.

Local players connect but remote players do not

The Java process and local firewall are probably working. Concentrate on router forwarding, the Ubuntu host’s changing LAN address, the public address supplied by the ISP, and any upstream firewall. A router reboot can change the host’s private address unless you reserved it.

The server feels laggy

There is no universal RAM-per-player figure. Measure the actual workload and consider the Minecraft version, simulation distance, entity-heavy farms, mods or plugins, CPU speed, storage latency, and concurrent players. Lowering simulation or view distance and removing expensive plugins can help; adding heap beyond what the machine can use may increase garbage-collection pauses instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Home host, VPS, or managed option?

Option Strengths Trade-offs Administration
Ubuntu at home Full control, local hardware, no separate hosting bill Power and internet outages, router forwarding, public-IP exposure, home bandwidth limits You maintain Ubuntu, Java, backups, firewall, and upgrades
Ubuntu VPS Continuous data-center availability, no inbound connection to your home LAN, selectable region Recurring cost, provider dependence, cloud-firewall configuration, possible latency or resource limits You still maintain the server software and Linux stack
Managed service or Realms Less Linux work; Realms includes automatic backups and supports up to 10 players according to official help Not an Ubuntu server; less control over the operating environment and customization Provider handles most infrastructure

Choose a home host when control and cost matter more than guaranteed uptime. Choose a VPS when 24/7 availability or avoiding home port forwarding is worth the recurring expense. Choose a managed option when administration and backup simplicity matter more than running your own Ubuntu instance.

Quick Recap

Bestseller No. 1
Minecraft - Bedrock Edition PS4
Minecraft - Bedrock Edition PS4
Play and share with friends on console, mobile and Windows 10; discover community creations in the new in-game store
$42.98
Bestseller No. 2
Minecraft Playststion 3 Edition - PlayStation 3
Minecraft Playststion 3 Edition - PlayStation 3
Learn your way around one block at atime in the new tutorial mode; Craft all sorts of items from boats todiamond armor and create enormousstructures
$28.00
Bestseller No. 4
Minecraft Dungeons: Hero Edition – Xbox Series X & Xbox One
Minecraft Dungeons: Hero Edition – Xbox Series X & Xbox One
Multiplayer Up to four players can team up and fight together in co-op mode.
$43.99
SaleBestseller No. 5
ThinkFun Minecraft Cave Adventure | Screen-Free Strategy Puzzle Game | 40 Logic Challenges | Ages 8+
ThinkFun Minecraft Cave Adventure | Screen-Free Strategy Puzzle Game | 40 Logic Challenges | Ages 8+
No Screens, Just Strategy – Promotes Problem-Solving with Off-Screen Minecraft Fun.; Perfect for Ages 8+ – Great Gift for Minecraft Fans Who Love a Challenge!
$20.16

Final checklist

  • Java Edition server JAR downloaded from the official Minecraft site.
  • Java version checked against the exact server release.
  • Dedicated non-root account owns /srv/minecraft.
  • First launch completed and eula=true recorded.
  • server.properties reviewed, including port, whitelist, difficulty, game mode, and player limit.
  • Persistent startup configured with systemd or another supervisor.
  • Only the selected TCP port opened in UFW and, where applicable, the router or cloud firewall.
  • Players given the correct local or public address.
  • Whitelist, operator permissions, backups, and upgrade procedure tested.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.