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.
Godlike.Host offers hosted Minecraft Java servers with its own game panel, SFTP access and free DDoS protection, if you would rather not host it yourself.
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.
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
- 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.
- Refresh Ubuntu’s package index:
sudo apt update - Install a Java runtime. Ubuntu’s default runtime is a practical starting point when it matches the server release:
sudo apt install default-jreIf the release documentation names a different supported Java package, install that compatible runtime instead.
- Confirm what is installed:
java -versionRecord 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.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match- Create a system account without a normal login shell:
sudo useradd --system --home /srv/minecraft --create-home --shell /usr/sbin/nologin minecraft - 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.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #2
- 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.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →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
- 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.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →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.
Recommended Free Tools
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 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.
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.
Back up and upgrade without corrupting the world
What to back up
At minimum, preserve the world directories and the settings that control access:
worldworld_netherworld_the_endserver.propertieswhitelist.jsonops.json
Also retain any carefully configured allowlists, ban files, datapacks, mods, or plugins used by your installation.
Best Value
- 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
- Stop the service cleanly:
sudo systemctl stop minecraft - 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 - Start the service again:
sudo systemctl start minecraft - 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.
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.propertiesfor the actualserver-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.
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
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.




