How to Set Up a Minecraft Bukkit (CraftBukkit) Server on Debian 13
Build a current CraftBukkit or Spigot Minecraft server with BuildTools on Debian 13 and run it as a systemd service.
Bukkit is the plugin API for Minecraft Java Edition servers, and CraftBukkit is the server that implements it. This guide builds a current CraftBukkit (or Spigot) server on Debian 13 with the official BuildTools program, runs it under a dedicated user as a systemd service and opens the firewall for players. The same steps work on Debian 12 with one difference in the Java package, described below.
Debian 7 "Wheezy" and OpenJDK 7 are long out of support, and ready-made craftbukkit-latest.jar downloads of the kind older tutorials used no longer exist from the project: since 2014 the Bukkit and CraftBukkit code has been maintained by the SpigotMC team, and for licensing reasons the server jar is not distributed. You build it on your own machine with BuildTools, which takes a few minutes.
Requirements
- A Debian 13 server with at least 2 GB of RAM; the build and the game server both need memory.
- A user with
sudorights. - Java 25. Minecraft 26.1 and later require Java 25, and BuildTools for the current release accepts Java 25 or 26.
Step 1: Install Java and Git
BuildTools needs Git and a full JDK. Debian 13 carries OpenJDK 25 in its main repository:
sudo apt update
sudo apt install -y openjdk-25-jdk-headless git
java -version
The last command should report version 25. Debian 12 only ships OpenJDK 17, which can build and run Minecraft up to 1.20.4 but nothing newer; on Debian 12 either upgrade to Debian 13 or install a Java 25 build from another trusted source such as Eclipse Temurin.
Step 2: Create a user for the server
Do not run a game server as root. Create an unprivileged account with its home in /opt/minecraft and switch to it:
sudo useradd --system --create-home --home-dir /opt/minecraft --shell /bin/bash minecraft
sudo -u minecraft -i
Step 3: Build CraftBukkit with BuildTools
As the minecraft user, download BuildTools from the SpigotMC build server into its own directory:
mkdir ~/buildtools ~/server
cd ~/buildtools
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
Run it. --rev latest selects the newest supported Minecraft release (you can give a version number such as 26.3 instead), and --compile craftbukkit builds CraftBukkit:
java -jar BuildTools.jar --rev latest --compile craftbukkit
BuildTools downloads the official server, applies the Bukkit and CraftBukkit changes and compiles the result. When it finishes, the jar is in the current directory, named after the Minecraft version. Copy it to the server directory under a fixed name so the service file does not need editing after each update:
ls ~/buildtools/*.jar
cp ~/buildtools/craftbukkit-*.jar ~/server/server.jar
If you would rather run Spigot, which is CraftBukkit plus performance changes and extra configuration and loads the same Bukkit plugins, leave out --compile craftbukkit. BuildTools then produces spigot-*.jar; copy that file instead.
Step 4: Accept the EULA and do a first start
Start the server once from its directory. It creates its configuration files and stops, because the Minecraft End User Licence Agreement has not been accepted yet:
cd ~/server
java -Xms1G -Xmx1G -jar server.jar nogui
Read the agreement at the address shown in eula.txt. If you agree, set the flag to true:
sed -i 's/eula=false/eula=true/' eula.txt
Start the server again with the same java command. It generates the world and prints a line beginning with Done when it is ready. Type stop at the server console to shut it down cleanly, then return to your own account:
exit
Step 5: Run the server as a systemd service
A systemd unit starts the server at boot and restarts it after a crash, which replaces the screen session older guides relied on. Create the unit file:
sudo nano /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft CraftBukkit server
After=network-online.target
Wants=network-online.target
[Service]
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft/server
ExecStart=/usr/bin/java -Xms1G -Xmx1G -jar server.jar nogui
Restart=on-failure
RestartSec=10
SuccessExitStatus=0 143
[Install]
WantedBy=multi-user.target
Adjust -Xms and -Xmx to the memory you want to give the server, leaving at least 512 MB for the operating system. Then enable and start it:
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo systemctl status minecraft
Follow the server log with:
sudo journalctl -u minecraft -f
Step 6: Open the firewall
Minecraft Java Edition listens on TCP port 25565 unless you change server-port in server.properties. If you use nftables or ufw on the server, allow that port; with ufw:
sudo ufw allow 25565/tcp
Also allow the port in your provider's firewall if one sits in front of the server. Players then connect to your server's IP address or DNS name from the Minecraft client.
Plugins, administration and updates
- Plugins: copy plugin
.jarfiles into/opt/minecraft/server/plugins, make sure they belong to theminecraftuser, and restart withsudo systemctl restart minecraft. Only install plugins built for your Minecraft version. - Operators: the service has no interactive console. Add your player name to the operator list by enabling RCON in
server.properties, or stop the service, start the server by hand as in step 4, runop yournameandstop, and start the service again. - Updates: download a fresh
BuildTools.jar, run the build again, stop the service, replaceserver.jarwith the new jar and start the service. Back up the world directories first. - Backups: the worlds are the
world,world_netherandworld_the_enddirectories in/opt/minecraft/server. Copy them while the server is stopped, or after runningsave-offandsave-allover RCON.
The BuildTools page on the SpigotMC wiki lists all build options and the Java version each Minecraft release needs.
Frequently asked questions
What is the difference between Bukkit, CraftBukkit and Spigot?
Bukkit is the programming interface that plugins are written against. CraftBukkit is the modified Minecraft server that implements it. Spigot is a fork of CraftBukkit with performance improvements and more settings; it runs Bukkit plugins unchanged and is what most plugin authors test against today.
Why can I not just download a CraftBukkit jar?
The jar contains Mojang's server code, which the project is not allowed to redistribute. BuildTools solves that by downloading the official server from Mojang on your machine and patching it there. Jars offered on third-party download sites are unofficial; you cannot verify what is in them.
The build fails or is killed. What should I check?
Run java -version: an unsupported Java release is the most common cause, and BuildTools says so in its output. On small servers the build can also run out of memory; add swap space or build on a machine with more RAM and copy the jar over. A full log is written to BuildTools.log.txt in the build directory.
Can I build an older Minecraft version?
Yes, pass its number to --rev, for example --rev 1.21.11. Older releases need older Java: 1.20.5 to 1.21.11 use Java 21, which Debian 13 also packages as openjdk-21-jdk-headless.