Guide for Setting Up and Customizing Spigot on Debian 12
In this guide, we'll walk you through the process of setting up a high-performance Minecraft server on Debian 12 using Spigot, a popular open-source server platform known for its customization and performance capabilities.
**Step 1: Install Java Runtime Environment (JRE)**
First, let's install OpenJDK 17 or newer, as Minecraft servers require Java to run. You can do this by running the following commands in your terminal:
```bash sudo apt update sudo apt install openjdk-17-jre-headless ```
To verify the installation, type:
```bash java -version ```
**Step 2: Download Spigot Server Jar**
Next, download the `spigot.jar` file. You can either build Spigot yourself using BuildTools from their official site or download a prebuilt jar from trusted sources. Place the jar in a dedicated directory, such as `/opt/minecraft`.
**Step 3: Create a Dedicated Minecraft User (Optional but Recommended)**
For security and resource isolation, create a dedicated user for Minecraft:
```bash sudo useradd -r -m -d /opt/minecraft minecraft sudo chown minecraft:minecraft /opt/minecraft ```
**Step 4: Initial Server Startup**
Run the server once to generate configuration files:
```bash cd /opt/minecraft java -Xms1G -Xmx2G -jar spigot.jar nogui ```
Adjust `-Xms` and `-Xmx` flags to allocate appropriate RAM, depending on your server specs. The first run will create `eula.txt`. Edit it to accept EULA terms:
```bash nano eula.txt ```
Change `eula=false` to `eula=true`.
**Step 5: Configure server.properties for Performance and Gameplay**
Edit the `server.properties` file to customize server parameters critical for performance and game experience. Important options include:
- `server-port=25565` (default port) - `level-seed=YOUR_SEED` to create a specific world - `gamemode=0` (survival), or `1` (creative), etc. - `difficulty=2` (normal) — values 0–3 - `pvp=true` or `false` - `motd=Your server name here` (message shown in server list)
Tweak these based on server needs.
**Step 6: Optimize JVM and Server Settings**
For high performance, consider setting JVM flags for garbage collection tuning and CPU usage. Example:
```bash java -Xms2G -Xmx4G -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:MaxGCPauseMillis=50 -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -jar spigot.jar nogui ```
**Step 7: Run the Server as a Service (Optional)**
To keep the server running in the background and manage it easily, create a systemd service:
[...]
Follow the remaining steps for further optimizations, plugin installation, firewall and network configuration, backup, and monitoring. This setup will provide a stable, customizable, and high-performance Minecraft server on Debian 12 with Spigot, tailored for smooth gameplay and good server management.
A. The Minecraft server runs on Java, as Minecraft servers require Java to function, and we installed OpenJDK 17 or newer in Step 1.
B. To maximize performance, consider optimizing JVM settings, such as configuring garbage collection tuning and CPU usage, which we explored in Step 6 of the guide.