Skip to main content
This guide walks you through installing every component on a clean Linux system: the required packages, the serv CLI, the startup scripts, and the Minecraft server jar itself.
PopLock requires Java to run the Minecraft server. Install it before starting:
sudo apt install openjdk-21-jre-headless
PaperMC 1.21.4 requires Java 21. Check java -version to confirm.

Prerequisites

Install the system packages that PopLock’s scripts depend on:
sudo apt install tmux jq curl unzip
PackagePurpose
tmuxRuns the Minecraft server in a persistent background session
jqParses JSON for version checks and the API
curlDownloads server jars and checks for updates
unzipReads version info embedded inside the server jar
You also need Node.js if you plan to run the REST API. Install it from the official Node.js site or via your distribution’s package manager.

Installation

1

Create the server directory

Create the directory that will hold all server files and give your user ownership of it:
sudo mkdir -p /usr/local/games/minecraft_server/java
sudo chown -R $USER:$USER /usr/local/games/minecraft_server/java
The full directory structure after setup will look like this:
/usr/local/games/minecraft_server/java/
├── server.jar
├── start.sh
├── log4j2.xml
├── server.properties
├── whitelist.json
├── eula.txt
├── world/
│   └── datapacks/
└── backups/
    ├── jars/
    ├── snapshot_YYYYMMDD_HHMMSS.tar.gz
    └── minecraft_backup_YYYYMMDD_HHMMSS.tar.gz
2

Install serv and snapshot.sh

Copy both management scripts to /usr/local/bin/ and mark them executable:
sudo cp serv /usr/local/bin/serv
sudo chmod +x /usr/local/bin/serv

sudo cp snapshot.sh /usr/local/bin/snapshot.sh
sudo chmod +x /usr/local/bin/snapshot.sh
serv is the primary command you’ll use to control the server. snapshot.sh is the automated daily backup script, typically run by cron.
3

Install start.sh and log4j2.xml

Copy the startup loop and the Log4j configuration into the server directory:
cp start.sh /usr/local/games/minecraft_server/java/start.sh
chmod +x /usr/local/games/minecraft_server/java/start.sh

cp log4j2.xml /usr/local/games/minecraft_server/java/log4j2.xml
start.sh contains the server launch loop with automatic restart logic. log4j2.xml suppresses noisy console output from server commands.
4

Download server.jar

Get the latest PaperMC build for your target Minecraft version. Replace BUILDNUM with the current build number, which you can find on papermc.io/downloads:
curl -o /usr/local/games/minecraft_server/java/server.jar \
  "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/BUILDNUM/downloads/paper-1.21.4-BUILDNUM.jar"
The file must be named exactly server.jar.
After initial setup, you can run serv update at any time to automatically pull and apply the latest PaperMC build for your current Minecraft version.
5

Accept the EULA

Mojang requires you to accept the Minecraft End User License Agreement before the server will start:
echo "eula=true" > /usr/local/games/minecraft_server/java/eula.txt
6

Start the server

Launch the server in a background tmux session:
serv start
After it boots (usually 15–30 seconds), check that it came up cleanly:
serv status
You should see the server version, uptime, memory usage, and current player count.
Run serv console to attach to the live server console and watch it in real time. Press Ctrl+B then D to detach without stopping the server.

Next steps

Your server is running. Here are a few things to set up next:

REST API

Install the lightweight Node.js HTTP API so you can manage the server remotely — including from Discord via n8n.

Resource pack

Install the PopLock custom textures and redesigned UI for all Java Edition players.

Automated snapshots

Set up the nightly cron job that takes automated daily snapshots with in-game countdown warnings.

serv commands

Full reference for every serv subcommand — backup, restore, update, and more.