Install and configure a Minecraft server on elementary OS
A dedicated Minecraft server lets friends, classmates, or a community play from separate computers while the world remains on one machine. elementary OS provides a comfortable Ubuntu-based desktop, although a server works better when the system is quiet, updated, and managed as a Linux service rather than an application left open.
This guide explains how to install and configure a Minecraft server on elementary OS, including Java, server files, player access, networking, automatic startup, and routine maintenance. It suits a small group on a home network as well as an internet-facing community needing a dependable public address.
The examples use Java Edition. Fabric or Forge can be added for mods, while Bedrock Edition players require different server software and a separate UDP port.
Prepare the server environment
Use a dedicated, unprivileged account for the server. Running the Java process as root gives it unnecessary access to the rest of the system and increases the impact of a compromised dependency. Create the account and its working directory with:
sudo adduser --disabled-password --gecos "" minecraft
sudo install -d -o minecraft -g minecraft /srv/minecraft
The account has no ordinary password and should remain dedicated to the game server. Administrators can enter it with sudo -iu minecraft. Store the server JAR, configuration, plugins, and world files inside /srv/minecraft so ownership and backups remain straightforward.
Plan memory according to the number of players and whether mods are installed. A small Vanilla world may start with 1–2 GB of Java memory, while a busy modded server often needs considerably more. Check available capacity with free -h, disk space with df -h, and processor information with lscpu. Leave some memory available for the desktop, file cache, and other services.
A wired network connection is preferable for a public server because it usually provides steadier upload speed and lower latency. An Australian household on NBN may have an adequate connection, but upload capacity and carrier-grade NAT can still determine whether remote players can connect directly.
Install Java and server files
Current Minecraft Java Edition releases use Java 21, while older servers or mod packs may require Java 17. Confirm the requirement for the exact game and loader version before installing anything. On elementary OS, install the headless runtime with:
sudo apt update
sudo apt install openjdk-21-jre-headless curl
java -version
If Java 21 is unavailable in the repositories for the installed elementary OS release, use apt-cache search openjdk to identify supported packages. Do not force an incompatible Java version onto a server or mod pack.
Download the official Vanilla server JAR from Minecraft’s official downloads page and copy its current URL into this command:
cd /srv/minecraft
sudo -u minecraft curl -fLO 'CURRENT_OFFICIAL_SERVER_URL'
Fabric and Forge require their respective installers and launch files. Follow the loader’s version-specific instructions, and keep the loader, game version, and every installed mod compatible with one another. Download loaders and mods only from their official or reputable project sources.
The first launch creates the world, configuration files, and EULA file:
cd /srv/minecraft
sudo -u minecraft java -Xms1G -Xmx2G -jar server.jar nogui
Read the Minecraft EULA at its official site before accepting it. The server normally stops until eula.txt contains eula=true. After accepting the terms, restart it with the same command to generate the initial world.
Configure gameplay and player access
Edit server.properties as the minecraft user. Common settings include server-port=25565, online-mode=true, a suitable max-players value, a server motd, and the desired difficulty. View and simulation distances affect the number of loaded chunks, so increasing them can consume substantial memory and processor time on a modest system.
Whitelisting is the simplest way to restrict access to a known group. From the server console, use commands such as whitelist on and whitelist add PlayerName. Grant operator privileges sparingly with op PlayerName, because operators can change world settings and execute powerful commands. When the server runs under systemd, player changes can be made through a secure management channel or by stopping the service and editing whitelist.json and ops.json.
Leave online-mode=true unless there is a deliberate technical reason to use offline mode. Offline mode can allow players to assume another identity and introduces additional authentication concerns. Plugins or loaders should be used carefully as well, especially on a public server, because they run with the same operating-system account as the game.
Log timestamps are easier to interpret when the system uses an Australian time zone. For example, sudo timedatectl set-timezone Australia/Sydney sets the eastern daylight-time zone. Melbourne, Brisbane, Perth, Adelaide, Darwin, and Hobart have their own identifiers. The operating system handles daylight-saving changes automatically, although scheduled jobs should be checked when clocks move.
Compare deployment and hosting options
The same server software can run on the elementary OS computer, a virtual private server, or a managed Minecraft hosting plan. A local installation provides the greatest control, while a hosted option usually offers steadier availability and a public IP address.
| Deployment | Best suited to | Indicative Australian cost | Main strength | Main constraint |
|---|---|---|---|---|
| elementary OS computer | Owners and regular local players | Existing broadband and electricity | Full control over Linux and files | Upload speed, power, and home-network uptime |
| Australian virtual private server | Always-on community servers | Often A$10–A$50+ per month | Public IP and remote administration | Memory limits and ongoing management |
| Managed Minecraft hosting | Groups wanting simple administration | Often A$15–A$80+ per month | Convenient control panel and backups | Less control over the operating system |
| Local network server | Private sessions and LAN play | No hosting charge | Low latency for nearby devices | No direct connection for remote players |
Australian hosts such as Bisect Hosting and OzHost offer VPS or game-server products with local currency billing, while larger cloud providers provide regional infrastructure. For players in Sydney, Melbourne, Brisbane, or Perth, the physical server region can affect latency. Route quality and peering sometimes matter more than the city printed on a plan, so testing from the community’s usual locations is valuable.
Many Australian NBN connections use carrier-grade NAT, meaning the router receives a shared public IP address. Some fixed-wireless and regional internet plans also have upload limits or throttling. Port forwarding cannot overcome carrier NAT. A VPS provides a straightforward public address, while a home host may need a public IPv4 allocation from its internet provider or a properly secured tunnel. This choice affects both player latency and the effort required for administration.
Open the game port safely
A home-hosted server needs a router rule. Give the elementary OS machine a reserved local IPv4 address, then forward external TCP and UDP port 25565 to that machine. Keep the external and internal port numbers consistent with server-port. The router configuration varies by ISP-provided equipment, but its port-forwarding or NAT settings should contain the destination address, protocol, and port.
The host firewall must permit the same traffic. If the machine is administered remotely, allow SSH before enabling the firewall:
sudo ufw allow OpenSSH
sudo ufw allow 25565/tcp
sudo ufw allow 25565/udp
sudo ufw enable
sudo ufw status
TCP and UDP rules cover game traffic and server-status queries. Review existing rules before enabling UFW, because an incorrect configuration could interrupt remote access.
Keep administrative services separate from the public game port. Do not forward RCON port 25575 or expose it directly to the internet; use an SSH tunnel or a private network when remote console access is required. A dynamic public IPv4 address can also change after a reconnection, so a reputable dynamic DNS record is useful. Minecraft accounts should remain protected with unique passwords, and server software should be updated without delay.
Automate the server with systemd
A systemd unit starts the server at boot, restarts it after an unexpected failure, and keeps it running independently of the desktop session. Create /etc/systemd/system/minecraft.service with the following content:
[Unit]
Description=Minecraft Java server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=minecraft
Group=minecraft
WorkingDirectory=/srv/minecraft
ExecStart=/usr/bin/java -Xms1G -Xmx2G -jar server.jar nogui
ExecStop=/bin/kill -SIGINT $MAINPID
Restart=on-failure
RestartSec=15
TimeoutStopSec=120
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Load and activate the service with:
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo systemctl status minecraft
sudo journalctl -u minecraft -f
The journal captures startup errors and console output. sudo systemctl stop minecraft sends the configured interrupt signal, allowing Minecraft to save and close cleanly. The standard systemd service does not provide an interactive console, so administrative commands require secure RCON access or a carefully managed alternative.
Review the memory values whenever the player count or mod set changes. The -Xms value sets initial heap size, while -Xmx sets the maximum. Increasing them without sufficient physical memory can lead to swapping, server stalls, or termination by the operating system.
Maintain and troubleshoot the server
Back up the world, server.properties, player lists, plugins or mods, and other custom configuration. A file-level copy is safest when the server is stopped; otherwise, use a snapshot mechanism provided by a trusted plugin. Keep at least one copy on separate storage and test that it can restore the world. A backup stored only on the same disk is vulnerable to the same failure as the original installation.
Monitor disk usage, memory consumption, service restarts, and network errors. df -h, free -h, systemctl status minecraft, and journalctl -u minecraft cover most routine checks. Common faults include a missing EULA acceptance, incompatible Java or loader versions, mismatched client and server releases, exhausted memory, and firewall or port-forwarding errors. Test local connections before diagnosing a wider network problem.
For an Australian community, schedule maintenance around peak evening play and recheck automated jobs after daylight-saving changes. The practical takeaway is to run the process as an unprivileged user, pin compatible Java and game versions, maintain tested off-device backups, restrict the firewall, and let systemd handle clean shutdowns and automatic restarts.