Halloween 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 PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Create a Minecraft Java Server on Ubuntu

A complete Ubuntu guide for hosting a Minecraft Java Edition server, including Java compatibility, installation, firewall and router setup, systemd, backups, security, and VPS decisions.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can run a private Minecraft: Java Edition server on Ubuntu by installing a compatible Java runtime, downloading the official server JAR, accepting the EULA, configuring server.properties, and allowing the server port through your firewall and router. The software itself is free. The exact Java major version changes with server releases, so check the current official download and release notes before installing or upgrading.

This guide uses a dedicated Ubuntu account and directory, then shows how to keep the server running after you close a terminal. It also explains home hosting versus a VPS, how friends connect, and how to protect and back up the world.

As an Amazon Associate I earn from qualifying purchases.

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.

Choose the correct Minecraft edition first

This procedure is for Minecraft: Java Edition. Java and Bedrock use separate dedicated-server products; a Bedrock client cannot normally join this Java server without an additional compatibility bridge, which is outside the official setup described here.

If you specifically need the official Bedrock Dedicated Server on Linux, Minecraft lists Ubuntu 22.04 LTS or later as a requirement for its Linux build. That package and its configuration are different from the Java JAR used below.

#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

Decide where Ubuntu will run

  • Home PC or mini PC: no recurring hosting bill, but the machine must stay powered on. You must configure the home router and avoid exposing your public IP unnecessarily.
  • VPS: normally remains online and avoids forwarding a port into your home network, but adds a recurring bill and provider dependence. You configure the provider’s cloud firewall as well as Ubuntu.
  • Managed service: reduces Linux administration. Minecraft recommends Realms for a personal server with automatic backups for up to 10 players, but Realms is not an Ubuntu-hosted server.

What you need before installing

  • An Ubuntu installation with administrative access. The Java procedure is not tied to one particular Ubuntu release, but keep the operating system updated.
  • A machine with enough CPU, memory, storage, and network capacity for your chosen Minecraft release, simulation distance, mods, and player count. No authoritative source establishes a universal RAM-per-player number, so do not size a server from a fixed rule of thumb.
  • A way to connect to the machine: a local terminal, SSH, or a VPS console.
  • Permission to change the host firewall. Home hosting also requires access to the router’s port-forwarding settings.
  • The official Java server download. Minecraft says the official Java server software is free to download.

Install a compatible Java runtime

Minecraft requires a compatible Java Runtime Environment to launch the server JAR. The required major version is release-dependent and can change, so verify it against the current server download page or release notes immediately before installation rather than copying an old version number from a tutorial.

  1. Refresh Ubuntu’s package index:
    sudo apt update
  2. Install a Java runtime. Ubuntu’s default runtime is a practical starting point when it matches the server release:
    sudo apt install default-jre

    If the release documentation names a different supported Java package, install that compatible runtime instead.

  3. Confirm what is installed:
    java -version

    Record the major version. If the server later reports an unsupported class version or refuses to start, recheck the release’s Java requirement before changing other settings.

Create a dedicated server account and folder

Do not run a long-lived game server as root. A separate account limits the damage a compromised plugin, mod, or server process could cause and keeps ownership of world files predictable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Create a system account without a normal login shell:
    sudo useradd --system --home /srv/minecraft --create-home --shell /usr/sbin/nologin minecraft
  2. Move into the server directory:
    sudo -u minecraft -H bash -c 'cd /srv/minecraft && pwd'

    The expected path is /srv/minecraft. You may choose another path, but keep the JAR, configuration, logs, and worlds together so permissions and backups are straightforward.

Download and launch the official Java server

Download the versioned server JAR from Minecraft’s official Java server page. Save it as server.jar for simple commands, or retain the versioned filename consistently. Avoid unofficial mirrors when the official download is available.

After placing the file in /srv/minecraft, make sure the service account owns it:

sudo chown minecraft:minecraft /srv/minecraft/server.jar

Run the first launch

The first launch creates eula.txt and other configuration files, then stops because the EULA has not been accepted. Start it from the server directory with a headless command:

sudo -u minecraft -H bash -c 'cd /srv/minecraft && java -Xms1G -Xmx2G -jar server.jar nogui'

-Xms1G and -Xmx2G are examples, not universal requirements. Choose values that leave memory for Ubuntu and any other services. Increasing the maximum blindly can make the host swap or become unresponsive.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

Accept the EULA and configure the server

Accept the EULA

Open the generated file:

sudo nano /srv/minecraft/eula.txt

Change exactly this line:

eula=false

to:

eula=true

Save and exit. You must accept the EULA yourself; do not remove the file or bypass the check.

Set the core options in server.properties

Edit the generated configuration:

sudo nano /srv/minecraft/server.properties

Review these settings before inviting anyone:

Setting Purpose Practical decision
server-port TCP port on which the Java server listens. Leave the default 25565 unless you have a reason to use another port. Any firewall and router rule must use the same value.
gamemode Default game mode for players. Choose the mode that matches your group; player-specific changes can be made later by an operator.
difficulty World difficulty. Set it before play if you want a consistent starting experience.
max-players Connection limit configured by the server. Set a conservative limit for the hardware and network you actually have.
motd Message displayed in the multiplayer list. Use it to identify the server and its rules.
white-list Restricts joins to approved player names. Enable it for a private group and add players deliberately.

Save the file, then ensure the account still owns all generated files:

sudo chown -R minecraft:minecraft /srv/minecraft

Start the server for testing

Run the same Java command again:

sudo -u minecraft -H bash -c 'cd /srv/minecraft && java -Xms1G -Xmx2G -jar server.jar nogui'

Watch the console for a message indicating that the server has finished loading. Keep this terminal open while testing. In the server console, type stop and press Enter to shut down cleanly; do not kill the process while it is writing world data.

Keep it running with systemd

A terminal command ends when its session ends. On a real Ubuntu host, use a supervisor such as systemd so the server starts after reboot, runs as the non-root account, and writes logs to the system journal.

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

Create a systemd unit

Create the unit file:

sudo nano /etc/systemd/system/minecraft.service

Use this example and adjust the memory values if your host needs something different:

[Unit]
Description=Minecraft Java Edition 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

Reload systemd, enable the service at boot, and start it:

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
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft

Check status and logs

sudo systemctl status minecraft
sudo journalctl -u minecraft -f

Use systemctl stop minecraft before maintenance or backups. If the service repeatedly restarts, inspect the journal for a Java compatibility error, a wrong JAR filename, insufficient permissions, or a port already in use.

Open port 25565 safely

Minecraft’s default Java port is TCP 25565. Only open the port you selected in server.properties; do not open unrelated ports.

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

Ubuntu firewall with UFW

If UFW is enabled, allow the game port:

sudo ufw allow 25565/tcp
sudo ufw status

If you changed server-port, substitute that number in the rule. Keep SSH access available before enabling or tightening UFW on a remote machine.

Home-router forwarding

For players connecting over the internet to a home Ubuntu host, create a router port-forwarding rule that sends TCP 25565 to the Ubuntu machine’s local address. Give the Ubuntu host a DHCP reservation or another stable local address so the rule does not break after a reboot. The router’s external port and the Ubuntu firewall port must match the server’s configured port.

VPS firewall

On a VPS, configure the provider’s cloud firewall or security group to permit TCP 25565, then allow the same port in UFW if UFW is enabled. A cloud rule alone does not override a host-level firewall.

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

Connect to the server

From the Ubuntu machine

Use localhost in Minecraft’s multiplayer screen when the client is running on the same machine and the server uses the default port.

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

From another device on the same network

Use the Ubuntu host’s private LAN address. Find it with:

ip address

Choose the address on the local network interface, not the loopback address. Both devices must be on a network that can reach the host, and the Ubuntu firewall must permit the selected port.

From the internet

Use the host’s public address and append :25565 when the default port is in use, for example public-address:25565. If you use another port, append that port instead. Remote play requires the router or VPS network path to be configured correctly; a running server alone does not make it reachable.

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

Minecraft warns that publicly disclosing a home public IP creates a security risk to the home network. Give the address only to people who need it, and prefer a whitelist for a private server.

Protect operators, players, and world files

  • Use the whitelist: enable it in server.properties, then add trusted names from the server console with the appropriate whitelist command.
  • Limit operator privileges: grant operator status only to people who need administrative commands, and remove it when it is no longer required.
  • Keep Ubuntu and Java updated: apply security updates, but verify the Minecraft release’s Java compatibility before changing the runtime.
  • Do not run as root: keep the systemd service and files owned by minecraft.
  • Protect credentials and network details: do not publish your home public IP, SSH credentials, or router administration details.
  • Use trusted server software: download the official JAR and scrutinize every mod or plugin before installing it.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Back up and upgrade without corrupting the world

What to back up

At minimum, preserve the world directories and the settings that control access:

  • world
  • world_nether
  • world_the_end
  • server.properties
  • whitelist.json
  • ops.json

Also retain any carefully configured allowlists, ban files, datapacks, mods, or plugins used by your installation.

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!

Make a consistent copy

  1. Stop the service cleanly:
    sudo systemctl stop minecraft
  2. Copy the server directory to storage that is not the live disk. For example, archive it after stopping the server:
    sudo tar -czf /var/backups/minecraft-$(date +%F).tar.gz -C /srv minecraft
  3. Start the service again:
    sudo systemctl start minecraft
  4. Periodically restore an archive into a separate test directory. A backup that has never been restored is only an assumption.

Upgrade the JAR

Before upgrading, read the current release notes and confirm the required Java major version. Stop the service, take a verified backup, replace the JAR with the official release, and start the service while watching the journal. Keep the previous JAR until the new version has loaded successfully and you have confirmed that the world and player data are intact.

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.

Home host, VPS, or managed alternative?

Option Advantages Costs and trade-offs Best fit
Home Ubuntu host Full control, local hardware, and no recurring hosting bill. You supply power and uptime, configure the router, maintain Ubuntu, and protect your public IP. A small private group comfortable with Linux and home-network administration.
Ubuntu VPS Usually stays online, avoids forwarding a port into your home, and can be placed near your players. Recurring cost, provider dependence, cloud-firewall configuration, and ongoing Linux maintenance. Players who need continuous availability or cannot expose a home network.
Managed service such as Realms Minimal administration and automatic backups; Minecraft recommends it for a personal server of up to 10 players. It is not hosted on your Ubuntu machine, and you give up the control available from a self-managed Java server. Groups that value convenience over Ubuntu administration.

When evaluating a VPS or managed host, compare monthly cost, CPU and RAM allocation, geographic latency, backup and restore controls, DDoS protections, player capacity, mod or plugin support, and how much Linux work remains yours. Verify current prices, supported editions, locations, and backup policies directly with the provider before purchasing.

Troubleshoot the common failures

The server exits immediately and mentions Java

Run java -version and compare the result with the exact server release’s documented requirement. Install a compatible runtime, then confirm the systemd unit calls the intended Java binary.

The server says the EULA was not accepted

Open /srv/minecraft/eula.txt and confirm the line is exactly eula=true. Check that you edited the file in the same directory used by the launch command.

Friends cannot connect, but local play works

  • Confirm the server is running and listening on the expected port.
  • Check server.properties for the actual server-port.
  • Allow that TCP port in UFW.
  • For home hosting, verify router forwarding points to the Ubuntu host’s current private address.
  • For a VPS, verify the provider’s cloud firewall or security group.
  • Make sure remote players use the public address, while local players use the private address or localhost.

The router rule keeps breaking

The Ubuntu host’s private address may be changing. Create a DHCP reservation for the machine or configure a stable local address, then update the forwarding rule to that address.

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

The server becomes slow or the host runs out of memory

Do not assume a fixed RAM-per-player figure. Check the host’s available memory, CPU load, simulation distance, mods, plugins, and the number of active players. Lower resource-intensive settings or move to hardware with more capacity, and ensure the Java maximum does not consume all memory needed by Ubuntu.

A crash or upgrade damages the world

Stop the server with its stop command or systemd stop action before copying files. Restore the most recent verified backup into a separate directory first; do not overwrite the only live copy while diagnosing the problem.

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

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 quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.