DEV Community

Shivansh Tuteja
Shivansh Tuteja

Posted on

Host your own Minecraft Server on Linux in 10 Mins

Overview

  • Type : Vanilla/Spigot/Paper server (supports cracked with settings)
  • Goal : Minimal setup to play with friends (cracked clients allowed)
  • Instance Type : Any Linux Machine or a VM, 1-2 vCPUs & 8GB Ram would be enough for 5-10 people

Step-by-Step Setup

1. Create a VM Instance (or skip this and get a Linux Machine up)

  • personally using ubuntu
  • allow http & https traffic
  • connect via ssh

2. Setup Machine

update packages

sudo apt update && sudo apt upgrade -y
sudo apt install openjdk-17-jre-headless -y
Enter fullscreen mode Exit fullscreen mode

downloading minecraft server, here paper for performance

mkdir minecraft && cd minecraft
curl -o paper.jar https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/123/downloads/paper-1.20.1-123.jar
Enter fullscreen mode Exit fullscreen mode

Replace version/build with latest from https://papermc.io/downloads

3. Getting the server running

java -Xms1G -Xmx2G -jar paper.jar
Enter fullscreen mode Exit fullscreen mode

It will fail first time, asking you to accept EULA
Accept EULA

echo "eula=true" > eula.txt
Enter fullscreen mode Exit fullscreen mode

Optional : Enable Cracked Clients

edit server properties:

nano server.properties
Enter fullscreen mode Exit fullscreen mode

you may need to install nano using sudo apt install bash or you may use vim as per the convenience

set

online-mode=false
Enter fullscreen mode Exit fullscreen mode

save with CTRL + X => Y => Enter

Re-Run the Server (Mandatory)

java -Xms1G -Xmx2G -jar paper.jar nogui
Enter fullscreen mode Exit fullscreen mode

4. Expose the Port for Connections

sudo ufw allo 25565
Enter fullscreen mode Exit fullscreen mode

note : if you are using a VM, you may need to configure the firewall/VPC to allow the traffic from the set port

5. Run it in Background

using screen

sudo apt install screen -y
screen -S mc
java -Xms1G -Xmx2G -jar paper.jar nogui
Enter fullscreen mode Exit fullscreen mode

Top comments (3)

Collapse
 
nevodavid profile image
Nevo David •

honestly this makes me wanna spin up a server myself right now, gotta ask though, you ever feel like messing with stuff like this teaches you more than most classes?

Collapse
 
shivansh12t profile image
Shivansh Tuteja •

Definitely, cause thats what engineers do!

Collapse
 
kurealnum profile image
Oscar •

You could also use itzg's Docker minecraft server.