How to setup a Minecraft Server (PaperSpigot) on Ubuntu

How to easily setup a Minecraft environment for you and your friends to play on.

Setting up Ubuntu

Run everything as ‘sudo’ or be root.

First, ensure the server is up to date.

sudo apt update
sudo apt upgrade

Now, you need to install Java 11.

sudo apt install default-jre

Install PaperSpigot

I install my minecraft servers in the ‘/’ directory, so that’s what I’ll be doing here. I will use ‘MC’ as the name of the directory that my server will sit in.

First, make the necessary directory.

cd /
mkdir MC
cd MC

Now you need to download PaperSpigot.

Use a web browser to navigate to https://papermc.io/downloads/ and then right click on the latest build and choose ‘Copy Link Address’.

Then, use wget to download the file.

wget -O paperclip.jar https://papermc.io/api/v2/projects/paper/versions/1.16.5/builds/443/downloads/paper-1.16.5-443.jar

Now you need to create a script so that you can start your minecraft server.

nano start.sh

Here’s what you’ll need in the script

#!/bin/sh

java -Xms512M -Xmx1024M -jar paperclip.jar

Replace the ‘1024M’ with the maximum amount of RAM you want the MC Server to have.

You now need to make the script executable.

chmod +x start.sh

Start the server

./start.sh

You’ll get an error saying the EULA needs to be accepted. To accept the EULA, run

sudo nano eula.txt

and change eula=false to eula=true and save.

Start the server again, after a few seconds, if you see an info message in the terminal with ‘Done!’, then the server is setup.

To stop your server, simply type ‘stop’

Run your server in the background

If you are hosting your server on a VPS, or a linux box with no GUI, you’ll probably want to run PaperSpigot in the background.

To do this, install screen

sudo apt install screen

Now, you’ll need to open an instance of screen, call it MC for Minecraft. Screen is essentially like different windows for your terminal, so you can multitask within one terminal.

screen -S "MC"

Then start your server script.

cd /MC
./start.sh

To return to your standard terminal, simply hold down CTRL+A+D

To return back to the MC Console, run

screen -ls

This will return your screen ID

There is a screen on:
      73470.MC

Then run

screen -rd 73470.MC

And you’ll reattach to the minecraft log.

That’s it! You have successfully setup your Minecraft PaperSpigot server on Ubuntu, please share this tutorial if you found it useful.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>