DEV Community

Celso Nery
Celso Nery

Posted on

Minecraft Server - Part 1: Bare Metal Installation

🇧🇷 Versão em português

Minecraft Server - Part 1: Bare Metal Installation

Introduction

Running your own Minecraft server gives you full control over the game, mods, rules, a persistent world, and no dependency on third-party servers. This is the first part of a series that will provide three installation options: we start here with a bare metal installation (directly on the operating system), then move on to Docker, and finally to Kubernetes.

There are two main editions of the game, with incompatible servers between them:

  • Bedrock Edition: cross-platform (Windows, consoles, mobile), uses the UDP protocol;
  • Java Edition: the "classic" PC version, with the largest ecosystem of mods and plugins, uses the TCP protocol.

I will cover the installing of both.

System requirements

Requirements vary mainly with the number of simultaneous players and whether the world uses heavy mods/plugins:

Players Recommended RAM CPU
1-5 2GB 2 cores
5-10 4GB 2-4 cores
10-20+ 8GB+ 4+ cores

The Java edition tends to consume more resources than Bedrock for the same number of players, especially with plugins like Spigot/Paper.

Installing the Minecraft Bedrock Server

Download

Download the official Bedrock server package for Linux directly from the official page:

minecraft.net/download/server/bedrock

Minecraft Bedrock Server download page

After downloading, extract the .zip file into a dedicated directory:

mkdir -p ~/minecraft-bedrock
cd ~/minecraft-bedrock
unzip bedrock-server-*.zip
chmod +x bedrock_server
Enter fullscreen mode Exit fullscreen mode

Running the server

LD_LIBRARY_PATH=. ./bedrock_server
Enter fullscreen mode Exit fullscreen mode

The Bedrock server relies on shared libraries in its own directory, that's why the LD_LIBRARY_PATH=. variable is needed for it to find them correctly.

To keep the server running even after closing the terminal, use screen or tmux:

screen -S minecraft-bedrock
LD_LIBRARY_PATH=. ./bedrock_server
# Ctrl+A, D to detach without stopping the process
Enter fullscreen mode Exit fullscreen mode

Configuring the server

Bedrock server options live in the server.properties file, automatically generated on first run. Full documentation for all available properties is on the official wiki:

minecraft.fandom.com/wiki/Server.properties

Some of the most commonly used:

server-name=My Bedrock Server
gamemode=survival
difficulty=normal
max-players=10
online-mode=true
white-list=false
level-name=Bedrock level
Enter fullscreen mode Exit fullscreen mode

After editing the file, restart the server to apply the changes.

Installing the Minecraft Java Server

Prerequisite: Java

The Java server needs a JRE/JDK installed, the exact version depends on the Minecraft version (more recent versions require Java 17 or 21). To install on Debian:

sudo apt install openjdk-21-jre-headless
java -version
Enter fullscreen mode Exit fullscreen mode

Download

Download the server.jar for the desired version from the official Minecraft Java Server download page.

www.minecraft.net/en-us/download/server

Minecraft Java Server download page

mkdir -p ~/minecraft-java
cd ~/minecraft-java
# Download the server.jar for the desired version into this directory
Enter fullscreen mode Exit fullscreen mode

Accepting the EULA

On first run, Minecraft creates an eula.txt file and refuses to start until you manually accept the terms:

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

Running the server

java -Xmx2G -Xms1G -jar server.jar nogui
Enter fullscreen mode Exit fullscreen mode
  • -Xmx2G: maximum memory the JVM can use;
  • -Xms1G: initial memory allocated;
  • nogui: runs without the graphical interface, ideal for servers.

Just like with Bedrock, use screen or tmux to keep the process running in the background.

Managing the server

Player list (whitelist)

Restricting who can join the server is done via a whitelist.

On Bedrock, edit whitelist.json:

[
  { "name": "your_username" }
]
Enter fullscreen mode Exit fullscreen mode

And enable it in server.properties: white-list=true.

On Java, use the server console (the terminal where it's running):

whitelist add your_username
whitelist on
Enter fullscreen mode Exit fullscreen mode

User permissions (ops)

Granting administrator permissions (operator commands) also differs between editions.

On Bedrock, edit permissions.json:

[
  { "permission": "operator", "xuid": "your_xuid" }
]
Enter fullscreen mode Exit fullscreen mode

On Bedrock, you need the player's XUID (Xbox Live account identifier), not just their username.

On Java, from the console:

op your_username
Enter fullscreen mode Exit fullscreen mode

Exposing it to the internet

By default, the server is only accessible on the local network. To allow external connections:

  1. Open the port in the machine's firewall:

    • Bedrock: port 19132/UDP
    • Java: port 25565/TCP
  2. Set up port forwarding on your router, pointing the external port to the internal IP of the machine running the server.

Setting up dynamic DNS with No-IP

Most home internet connections have a dynamic public IP, it changes periodically, breaking access for anyone who saved the old IP. No-IP solves this, associating a fixed domain (for example, myserver.ddns.net) with your current IP, updated automatically.

  1. Create a free account at noip.com;
  2. Register a hostname (for example, my-minecraft.ddns.net);
  3. Install the DUC (Dynamic Update Client) on your server or router (many routers already have native No-IP support in their dynamic DNS settings);
  4. Share the hostname with your friends instead of the IP, it will keep working even when your IP changes.

Next steps

With the server running bare metal, manually managed with screen/tmux, you can already play with friends. But this model has limitations: no isolation, no automatic restart on failure, and manual configuration from scratch if you need to migrate to another machine. In Part 2 of this series, we'll run the same server in a Docker container, solving these problems with a declarative and reproducible configuration.

Continued in Part 2.

Top comments (0)