Run a server on Ubuntu
Install Ubuntu Server, Java and Paper, then run it safely as a service.
On this page
The short path1. Install Ubuntu Server LTS2. Install Java3. Create the server folder4. Start once and accept the EULA5. Open only the game port6. Test at home7. Start it automaticallyNextThe short path#
Ubuntu Server → Java → Paper → `start.sh` → EULA → local test → systemd.
Choose Ubuntu when the PC is dedicated to hosting and you are comfortable using a terminal. Prefer Windows for familiar desktop folders or ZimaOS for a browser dashboard.
1. Install Ubuntu Server LTS#
- 1Back up the PC. Installing Ubuntu can erase the selected drive.
- 2Download the current Ubuntu Server LTS ↗.
- 3Follow Ubuntu's basic installation guide ↗.
- 4Select OpenSSH server during installation if you want to manage it from another computer.
- 5Sign in and update the system:
sudo apt update && sudo apt upgrade -y2. Install Java#
Current Paper 26.x uses Java 25; Paper 1.20 through 1.21.11 uses Java 21. Follow Paper's official Ubuntu/Debian Java steps ↗, then confirm:
java -version3. Create the server folder#
sudo mkdir -p /opt/minecraft
sudo chown "$USER":"$USER" /opt/minecraft
cd /opt/minecraftDownload Paper from the official Paper page ↗, move the jar into /opt/minecraft, and rename it paper.jar.
4. Start once and accept the EULA#
chmod +x start.sh
./start.shThe first run creates eula.txt and stops. Read the linked Minecraft EULA. Change eula=false to eula=true only if you agree, then run ./start.sh again and wait for Done.
5. Open only the game port#
If you manage the machine through SSH, allow SSH before enabling UFW:
sudo ufw allow OpenSSH
sudo ufw allow 25565/tcp
sudo ufw enable
sudo ufw statusUbuntu documents UFW as its default firewall tool. Open only the Minecraft port you use.
6. Test at home#
Find the server's local address:
hostname -IJoin that address from Minecraft on another device at home. Finish the LAN test before Playit or port forwarding.
7. Start it automatically#
After the manual server works, create /etc/systemd/system/minecraft.service:
[Unit]
Description=Minecraft Paper Server
After=network.target
[Service]
User=YOUR_LINUX_USERNAME
WorkingDirectory=/opt/minecraft
ExecStart=/opt/minecraft/start.sh
Restart=on-failure
TimeoutStopSec=60
[Install]
WantedBy=multi-user.targetReplace YOUR_LINUX_USERNAME, then enable it:
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo systemctl status minecraftStop it before a manual backup with sudo systemctl stop minecraft. View recent logs with sudo journalctl -u minecraft -n 100 --no-pager.