Larry Myers

Cover Image for How to Run Your Own Minecraft Server

How to Run Your Own Minecraft Server

If you were remotely aware of video games in 2009 you know what Minecraft is. You probably played the original Java version of the game. If you have kids older than six you definitely know what Minecraft is. If you have a home server running Linux and want to perform an act of wizardry for your kids, run a Minecraft server. As an added bonus it means you’ll be able to do a fun activity together1 when it’s cold, rainy, or dark outside.

These instructions are for the bedrock version of Minecraft, because most kids are going to be introduced to Minecraft through their iPads or the Nintendo Switch. Desktop computers that can run Java are a weird immovable relic for my kids.

Prerequisites

My home server is an Intel NUC with 16gb of ram and an Intel i5 processor. It runs Ubuntu 22.04. It seems to run the bedrock server with ease, so I imagine similar hardware should be fine. These instructions assume you have remote SSH or direct access to the server, with root or sudo priviledges, and are comfortable on the command line.

Config Files

minecraft.service

[Unit]
Description=Minecraft Service
After=network.target

[Service]
Type=Simple
WorkingDirectory=/usr/local/minecraft-server
Environment="LD_LIBRARY_PATH=."
ExecStart=/usr/local/minecraft-server/bedrock_server
Restart=on-failure
User=minecraft
Group=minecraft

[Install]
WantedBy=multi-user.target

server.properties

The below is only a subset of the available properties, but are the ones you’ll want to consider modifying.

server-name=My Awesome Home Server
gamemode=survival
difficulty=easy
online-mode=false
level-seed=968565878525959881

Your kids will likely appreciate a fun world to build in, so ask the internet what the best seeds are and pick one to use.

Install

Download the latest bedrock server for Linux:

https://www.minecraft.net/en-us/download/server/bedrock

Get the current version from the URL referenced in the Download button below the heading:

MINECRAFT DEDICATED SERVER SOFTWARE FOR UBUNTU (LINUX)

Then on the command line

export BEDROCK_VERSION="1.20.32.03"

sudo groupadd -g 500 minecraft
sudo useradd \
  -g minecraft \
  --no-user-group \
  --no-create-home \
  --shell /bin/false \
  --system \
  --uid 501 \
  minecraft
sudo mkdir /usr/local/minecraft-server
sudo chown minecraft:minecraft /usr/local/minecraft-server
cd /usr/local/minecraft-server
wget https://minecraft.azureedge.net/bin-linux/bedrock-server-$BEDROCK_VERSION.zip
unzip bedrock-server-$BEDROCK_VERSION.zip
cp server.properties /usr/local/minecraft-server/.

cp minecraft.service /etc/systemd/system/.
sudo systemctl enable minecraft.service
sudo systemctl start minecraft

After you’ve started the server you should be able to test it out from the Minecraft app. Just use <your-server-IP>:19132 as the hostname.

Upgrades

You’ll have to do this whenever the Minecraft apps auto-update to a new version, since clients will refuse to connect to an older version of the server software.

sudo systemctl stop minecraft
sudo mv /usr/local/minecraft-server /usr/local/minecraft-server-old
sudo mkdir /usr/local/minecraft-server
sudo chown minecraft:minecraft /usr/local/minecraft-server
cd /usr/local/minecraft-server
wget https://minecraft.azureedge.net/bin-linux/bedrock-server-$BEDROCK_VERSION.zip
unzip bedrock-server-$BEDROCK_VERSION.zip
cp /usr/local/minecraft-server-old/server.properties .
cp -r /usr/local/minecraft-server-old/worlds .
sudo systemctl start minecraft

Footnotes

  1. My kids somehow make do with the virtual controls on the iPad. I grew up with actual controllers, and cannot enjoy Minecraft without a bluetooth controller paired with my iPad. Your kids will also be amazed at the ease at which you navigate the world and kill zombies.