Minecraft is one of the most popular games ever made — a sandbox game where players explore, build, and survive in procedurally generated worlds. Running your own server gives you full control: custom rules, an allowlist, and a private environment for friends or a small community.
This guide walks you through installing a Minecraft server on Ubuntu 18.04, running it as a systemd service, managing it with the mcrcon RCON console utility, and scheduling automatic daily backups.
<strong>Prerequisite:</strong> You need sudo access. Start by installing the build tools:bashsudo apt update && sudo apt install git build-essential
Minecraft requires Java 8 or higher. Install the headless JRE — it uses fewer system resources and is better suited for server workloads:
bashsudo apt install openjdk-8-jre-headless
Create a dedicated system user for the server. Running Minecraft as root is a security risk. This account has no login password and cannot connect via SSH:
bashsudo useradd -r -m -U -d /opt/minecraft -s /bin/bash minecraft
Switch to the new user and create the working directories:
bashsudo su - minecraftmkdir -p ~/{backups,tools,server} The backups directory stores compressed snapshots, tools holds mcrcon and the backup script, and server contains the Minecraft world and all configuration files.
mcrcon is a lightweight RCON client that lets you run commands on a live Minecraft server from the terminal. Clone and compile it:
bashcd ~/tools && git clone https://github.com/Tiiffi/mcrcon.gitcd ~/tools/mcrcongcc -std=gnu11 -pedantic -Wall -Wextra -O2 -s -o mcrcon mcrcon.c
Download the official Minecraft server JAR. Check the Minecraft download page for the current URL, then fetch it into the server directory:
bashwget https://launcher.mojang.com/v1/objects/ed76d597a44c5266be2a7fcd77a8270f1f0bc118/server.jar -P ~/server
Run the server once to generate the configuration files. It will exit immediately with an EULA warning:
bashcd ~/server && java -Xmx1024M -Xms512M -jar server.jar nogui
Open ~/server/eula.txt and change eula=false to eula=true to accept the Minecraft EULA. Then open ~/server/server.properties and enable RCON:
rcon.port=25575rcon.password=your-strong-passwordenable-rcon=true
Use a strong, unique password. If you do not need remote console access, block port 25575 at your firewall.
Switch back to your sudo user with exit, then create the service file:
bashsudo nano /etc/systemd/system/minecraft.service
Paste the following:
ini[Unit]Description=Minecraft ServerAfter=network.target[Service]User=minecraftNice=1KillMode=noneWorkingDirectory=/opt/minecraft/serverExecStart=/usr/bin/java -Xmx1024M -Xms512M -jar server.jar noguiExecStop=/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 25575 -p your-strong-password stop[Install]WantedBy=multi-user.target
Adjust Xmx (max RAM) and Xms (starting RAM) to match your server. Reload systemd, then start and enable the service:
bashsudo systemctl daemon-reloadsudo systemctl start minecraftsudo systemctl enable minecraft
Open the Minecraft game port in UFW:
bashsudo ufw allow 25565/tcp
Switch to the minecraft user and create /opt/minecraft/tools/backup.sh. The script pauses world saves, archives the server directory with tar, resumes saves, and deletes backups older than 7 days. Make it executable with chmod +x, then schedule it daily in cron:
bashcrontab -e# Add this line to run backups every night at 23:00:0 23 * * * /opt/minecraft/tools/backup.sh
To connect to the live Minecraft console from the terminal:
bash/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 25575 -p your-strong-password -t
Type Q to exit the console session.
Your Minecraft server is now running on Ubuntu 18.04, managed by systemd, secured under a dedicated user account, and backed up automatically every night. Leave a comment below if you run into any issues during setup.
PHP 8.5 is included in Ubuntu 26.04's default repositories and is the recommended version for…
Ubuntu 26.04 LTS "Resolute Raccoon" arrived on April 23, 2026 with Linux kernel 7.0, GNOME 50,…
Kubernetes is the standard platform for running containerized workloads across multiple servers with self-healing, rolling…
Ubuntu 26.04 LTS "Resolute Raccoon" was released on April 23, 2026 with Linux kernel 7.0, GNOME desktop, and standard security support until April 2031. A clean install gives you a known-good starting point on new hardware, when replacing another operating system, or when an upgrade path is not practical. This guide walks through how to install Ubuntu 26.04: downloading and verifying the ISO, writing a bootable USB drive, completing the installer, and doing the initial setup after the first boot. Before you start: You need a USB drive with at least 12 GB of free space. Back up any existing data on the target machine — the installer can erase the entire disk. Install Ubuntu 26.04: Download the ISO…
The correct timezone affects more than the clock on your screen. It drives cron job scheduling, systemd timer execution, log file timestamps, database record timing, and SSL certificate validity checks. A mismatched timezone can cause scheduled jobs to fire at the wrong hour and make log timestamps impossible to match with real-world events. This guide shows how to change timezone on Ubuntu using the timedatectl command (the recommended approach for servers and remote machines) and through the graphical Date & Time settings on desktop systems. The steps apply to all current Ubuntu releases including 24.04 and 26.04. <strong>Prerequisite:</strong> Only the root user or a user with sudo access can change the system timezone. Check the Current Timezone Before You Change It Run timedatectl with no arguments to see the active timezone and clock status: bashtimedatectl Sample output: Local…
Atom is a free, open-source, cross-platform code editor developed by GitHub. Built on Electron, it uses…