Tutorial | Build A Paper Minecraft Server

Prerequisites

Before we get started, make sure you have:

  • Ubuntu 24.04 LTS (or simillar) installed and running.

  • Java Development Kit (JDK) 17 installed (Paper requires Java 17).

  • Basic command-line knowledge.

  • An active internet connection.

Step 1: Update Your System

First, let’s ensure your system is up-to-date: Use sudo apt update && sudo apt upgrade -y to start software update and confirm all updates. Paper Spigot requires Java 17, you can install it using sudo apt install openjdk-17-jdk -y (why are we using JDKs instead of JREs?) After the installation, verify using java -version, and you should get an output similar like openjdk version "17.0.x" xxxx-xx-xx

Step 2: Downolad and Build

  • Create a dedicated directory for your Paper server using mkdir, then cd to the directory.
  • Download the BuildTools. Paper Spigot uses BuildTools to compile the server.jar, you can use wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar to download this file.
  • Run BuildTools to generate the Paper Spigot Jar file: java -jar BuildTools.jar --rev. This process fetches the latest version of Paper and compiles it. It might take several minutes, so sit tight.

Step 3: Launch and Configure

  • Rename the Compiled: Once the build is complete, you should see a paperclip-x.x.x.jar file. You can use “mv” command to rename it for simplicity: mv paperclip-*.jar paper.jar
  • Accept the EULA before starting the server.
  • Create a Startup Script: Let’s make it starting the server easier with a script: nano start.sh
    In the editor, add the following lines:
    #!/bin/bash
    java -Xms2G -Xmx4G -jar paper.jar
  • At last, make this script executable by chmod +x start.sh.
    After that, you can start your server under current directory using ./start.sh

Step 4: Optimize Your Server

Optimize the Spigot.yml

  1. Entity Activation Range:
    • What it does: Controls how close a player needs to be before entities become active.
    • Optimization Tip: Lowering these values reduces the number of active entities, decreasing CPU usage.
    • Suggested Values:
      • animals: 32 → Reduce to 24 or 16
      • monsters: 32 → Reduce to 24
      • Note: Be cautious; too low can affect gameplay, like mob farms.
  2. Entity Tracking Range:
    • What it does: Determines how far away entities are visible to players.

    • Optimization Tip: Reducing these ranges decreases network load.

    • Suggested Adjustments:

      • animals: 48 → Reduce to 32

      • monsters: 48 → Reduce to 32

  3. Mob Spawn Range:
    • What it does: Sets the radius around players in which mobs can spawn.

    • Optimization Tip: Lowering this can reduce the number of mobs spawned.

    • Recommended Value: 4

  4. Tick Settings:
    • What it does: Controls how often the server attempts to spawn mobs.

    • Optimization Tip: Increasing animal-spawns value reduces spawn frequency, easing server load.

    • Suggested Change:

      • animal-spawns: 400 → Increase to 600 or 800

  5. View Distance:
    • What it does: Controls how many chunks are loaded and sent to clients.

    • Optimization Tip: Lowering these values can significantly reduce server strain.

    • Recommended Values:

      • view-distance: 6

      • simulation-distance: 6

  6. Async Chunk Loading:
    1. What it does: Enables asynchronous chunk loading to reduce lag spikes.

    2. Optimization Tip: Keep this enabled for smoother performance.

Optimize the Bukkit.yml

  1. Spawn Limits:
    • What it does: Sets the maximum number of mobs that can spawn.

    • Optimization Tip: Adjusting these limits can control mob population.

    • Suggested Values:

      • monsters: 70 → Reduce to 50

      • animals: 15 → Reduce to 10

  2. Chunk Garbage Collector:
    • What it does: Determines how often the server attempts to unload unused chunks.

    • Optimization Tip: Lowering the period can help free memory but may cause lag if too frequent.

    • Recommended Value: Keep at 600 unless noticing issues.

  3. Ticks Per:
    • What it does: Controls intervals for various server tasks.

    • Optimization Tip: Increasing autosave interval reduces save-related lag.

    • Suggested Change:

      • autosave: 6000 → Increase to 12000 or 18000

Scroll to Top