
Spigot is a high-performance, open-source Minecraft server implementation built on top of CraftBukkit. It improves server efficiency, supports most Bukkit plugins, and allows you to customize gameplay using plugins and configuration tweaks.
In this article, you will install and configure a Spigot server on Ubuntu 24.04, set up Java, allocate system resources, and launch the server with a custom startup script. This setup provides a reliable foundation for hosting Minecraft multiplayer worlds with plugin support.
Before you begin, ensure you have:
sudo privileges.Install the required system tools and Java runtime environment to build and run Spigot.
Install essential utilities.
Install OpenJDK 17 (LTS), the recommended Java version for modern Minecraft servers.
Confirm the Java installation.
Output:
Add a swap file to extend your server's virtual memory, which improves stability when running resource-intensive tasks like Spigot.
On Ubuntu 24.04, a default swap file (e.g., 2–5 GB) is typically preconfigured. You can skip creating a swap file unless you need to increase the available swap memory manually.
Create a 1 GB swap file. You can adjust the size as needed.
Set the correct file permissions.
Format the file as swap.
Enable the swap file.
Make the swap permanent by editing the fstab file.
Add the following line at the end of the file:
Download Spigot's BuildTools utility and compile the Spigot server JAR.
Create a folder for building Spigot and switch into it.
Download the latest BuildTools JAR file from the official Spigot repository.
Build Spigot version 1.20.4 (or replace with the version you want).
After the build completes, list the output to find the generated Spigot JAR.
The output will include a file named spigot-1.20.4.jar.
Create a directory to host your Spigot server and navigate to it.
Move the compiled Spigot JAR into the server directory.
Create a startup script and launch the Spigot server for the first time.
Create a new startup script.
Paste the following content into the file. This script allocates 4 GB of RAM to Spigot and automatically restarts the server on failure.
Adjust -Xms4G -Xmx4G to match the amount of memory you want to allocate. For example, on a server with 8 GB RAM, use -Xms6G -Xmx6G to leave enough memory for the operating system.
Save the file and make it executable.
Start the server.
The first run generates configuration files and exits with an EULA error. Press Ctrl + C to stop the loop when you see the message.
Open the eula.txt file.
Change the following line:
to:
Save and close the file.
Start the server again.
If you want other players to join your Minecraft server, allow traffic through UFW on port 25565.
Verify that the rule is applied.
Output:
Use screen to run your Minecraft server in the background, allowing it to continue running after you disconnect from SSH.
Install screen if it's not already available.
Start a new screen session named spigot.
Start the server inside the screen session.
To detach from the session and leave the server running, press Ctrl + A, then D.
To return to the session later:
You can now configure your server settings and install plugins while the server runs in the background.
In this article, you installed and configured a Spigot Minecraft server on Ubuntu 24.04. You set up Java, built the Spigot JAR using BuildTools, created a startup script, and launched the server. You also enabled persistent background execution with screen.
With your Spigot server running, you can now install plugins, configure gameplay settings, and invite players to join your custom Minecraft world.
0 Comments
Be the first to comment and share your perspective with the community.