Minecraft is quite a popular game among kids and teenagers, featuring amazing survival adventures and a unique presentation style that portrays various aspects of reality.

When you purchase the game, you receive the default vanilla (or universal) server from the server download section of Mojang’s website, which is good enough for beginners.

Yet, it could soon turn your adventure into a nightmare when you want to play with hundreds of users at once, which drastically reduces performance and overall spoils your gaming experience.

Instead of vanilla, you can install, configure, and start your own custom Minecraft PaperMC server on your PC or VPS to achieve better performance and anytime adjust the system configuration based on demand to control the budget.

Paper is a high-performance fork of Spigot that is more optimized, fixing gameplay and mechanic inconsistencies present in Spigot and thus providing better performance on both the server and client sides.

In this article, you will learn how to install, configure, and start a custom-hosted Minecraft PaperMC server on Ubuntu.

Prerequisites

The following is a requirement that must be fulfilled to set up your custom Minecraft server.

  • A stable system, VPS, or server running on Ubuntu or an Ubuntu-based distribution.
  • It could be better if the system was running on an x64 architecture.
  • 1GB+ RAM, 2+ CPU cores, and 2GB+ HD/SDD storage.
  • Good internet connection if using a VPS or server.

How to Host a Minecraft (PaperMC) Server on Ubuntu

1. First, open your terminal, update your system repository information, and upgrade your system packages to their latest version.

  • sudo apt update
  • sudo apt upgrade -y

Output:

updating the ubuntu system

2. Install tmux and wget packages that will come in handy later.

  • sudo apt install tmux wget -y

Output:

installing tmux and wget package in ubuntu

3. The default user account can be used for running the server, but it is advisable to create a separate user account to simplify the management and identification of the server and its related processes later on.

  • Create a new "papercraft" user account.
  • sudo useradd -ms /bin/bash papercraft
  • Setting a password for the "papercraft" user account.
  • sudo passwd papercraft
  • (Optional) Adding a "papercraft" user account to the sudo group.
  • sudo usermod -aG sudo papercraft

Output:

create new user account setting it password and adding to sudo group in ubuntu

4. Switch to the newly created "papercraft" user account.

  • sudo su - papercraft

Output:

Switching user to papercraft user account in ubuntu

5. Create a directory for the paper server and Minecraft world files to make the management of servers and worlds easier.

  • mkdir papermc && cd papermc

Output:

create a directory for paper server in ubuntu

6. Navigate to the PaperMC download page, download the latest version of the Paper Java file, or execute the following command to download the current Paper 1.20.4 version using the wget command.

  • wget https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/416/downloads/paper-1.20.4-416.jar

Output:

download latest version of paper server java file on ubuntu

7. Now, you need to install Java on your system; it's kind of a tricky process, but the best way to install is the one supported by Minecraft. For instance, Minecraft 1.19 requires running the server with Java 17 or above.

  • wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.4.1%2B1/OpenJDK17U-jdk_x64_linux_hotspot_17.0.4.1_1.tar.gz

Output:

downloading java 17 for minecraft server in ubuntu

8. Extract the downloaded Java tar file and rename the extracted folder to "java".

  • tar -xvf OpenJDK* && mv jdk* java

Output:

extract the download java tar file and rename output directory to java

9. Before starting the Minecraft server, execute the following command to accept Mojang's EULA (end-user license agreement).

  • echo "eula=true" > eula.txt

Output:

creating an EULA file for running the minecraft server

10. Finally, launch a tmux session (to later detach it from the shell session and keep the server running in the background), and within the tmux session, start the Minecraft PaperMC server.

  • tmux
  • java/bin/java -Xms512M -Xmx1G -jar paper*.jar nogui

Output:

starting the tmux and minecraft papermc server on ubuntu

11. Once your Minecraft server is started, it opens port 25565; here, you can detach the tmux session using Ctrl+b and then d on your keyboard. Later, you can check if your tmux session is running by executing the following command:

  • tmux ls

Output:

listing the running tmux session

12. Later, when you want to check the logs or terminate the Minecraft server, simply attach to the tmux session running in the background by executing the following command:

  • tmux a

Output:

attaching to background tmux session