PROMO20% OFF with code QY3UJAEZ59 - Limited time offer!
Gaming

Install a Minecraft Server on Debian

Complete guide to install and configure a Minecraft Java Edition server on Debian/Ubuntu. Installation, optimization, and management with Screen.

📖9 min read
Beginner
📅1/14/2026

Install a Minecraft Server on Debian

Create your own Minecraft Java Edition server on Debian or Ubuntu. This guide covers vanilla installation, optimization, and server management.


📋 Before You Begin

Linux VPS Debian 11/12 or Ubuntu 20.04/22.04 ✅ Minimum 2 GB RAM (4 GB recommended for 10+ players) ✅ SSH access with sudo rights ✅ Java 17 or higher (installed in this guide) ✅ Port 25565 available

💡 AtmosNode Recommendation: A VPS with Ryzen 9 9950X3D, 4 GB DDR5 RAM, and NVMe Gen5 provides excellent performance for 20-30 simultaneous players.


1

Update the System

Start by updating your Debian/Ubuntu system.

Update packages
# Update package list
sudo apt update

# Upgrade the system
sudo apt upgrade -y

2

Install Java (OpenJDK 17)

Minecraft requires Java to run. Install OpenJDK 17, the recommended version.

Install Java 17
# Install OpenJDK 17
sudo apt install openjdk-17-jre-headless -y

# Verify installation
java -version

✅ You should see something like: openjdk version "17.0.x"

💡 Java versions by Minecraft version:

  • Minecraft 1.17 and below: Java 8 or 11
  • Minecraft 1.18 to 1.20.4: Java 17
  • Minecraft 1.20.5+: Java 21 recommended

3

Create a Dedicated User

For security reasons, create a dedicated user for Minecraft.

Create minecraft user
# Create the user
sudo useradd -r -m -U -d /opt/minecraft -s /bin/bash minecraft

# Switch to minecraft user
sudo su - minecraft

⚠️ Best Practice

Never run a Minecraft server as root! Always use a dedicated user with limited permissions.


4

Download Minecraft Server

Download the latest Minecraft Java Edition server.

Create Directory Structure

# Create server directory
mkdir -p ~/server
cd ~/server

Download the Server

Download Vanilla Minecraft
# Download the latest version (1.21.1 at time of writing)
wget https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar -O minecraft_server.jar

# Or for a specific version, visit:
# https://www.minecraft.net/en-us/download/server

💡 Tip: Always check the latest URL at minecraft.net/download/server for the most recent version.


5

Accept EULA and First Run

Before starting the server, you must accept the EULA (End User License Agreement).

First run to generate files
# Start the server for the first time
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
Accept the EULA
# The server will stop and create an eula.txt file
# Edit the file to accept the EULA
nano eula.txt

# Change "eula=false" to "eula=true"
# Save with Ctrl+O then Enter, exit with Ctrl+X

⚠️ Important

By accepting the EULA, you agree to Minecraft's terms of use. Read them at account.mojang.com/terms.


6

Configure Firewall

Allow Minecraft port (25565) in your firewall.

UFW Configuration (Ubuntu/Debian)
# Allow Minecraft port
sudo ufw allow 25565/tcp

# Check status
sudo ufw status

💡 Note: If you have an external firewall (AtmosNode panel, OVH, etc.), remember to also open port 25565 in your management interface.


7

Configure server.properties

Customize your server settings.

Edit server.properties
# Edit configuration file
nano server.properties
Recommended configuration
# Server information
server-name=My Minecraft Server
motd=§aWelcome to my server! §7| §ePlayers: {ONLINE}/{MAX}
server-ip=
server-port=25565

# Game settings
gamemode=survival
difficulty=normal
hardcore=false
pvp=true
max-players=20

# World
level-name=world
level-seed=
generate-structures=true
spawn-protection=16
view-distance=10
simulation-distance=10

# Performance
max-tick-time=60000
max-world-size=29999984

# Whitelist and security
white-list=false
enforce-whitelist=false
online-mode=true
enable-command-block=false

# RCON (remote administration)
enable-rcon=false
rcon.password=
rcon.port=25575

Important parameters:

  • max-players → Maximum number of players (adjust based on your RAM)
  • view-distance → Render distance (10 = 160 blocks, reduced to save RAM)
  • simulation-distance → Entity calculation distance (10 recommended)
  • online-mode → Mojang verification (true = premium accounts only)
  • white-list → Enable whitelist (true = only authorized players can join)

8

Create Startup Script

Create a script to easily start the server.

Create start.sh
# Create the script
nano start.sh
Script content
#!/bin/bash

# RAM configuration (adjust according to your VPS)
MIN_RAM="2G"
MAX_RAM="4G"

# Start server
java -Xms$MIN_RAM -Xmx$MAX_RAM \
  -XX:+UseG1GC \
  -XX:+ParallelRefProcEnabled \
  -XX:MaxGCPauseMillis=200 \
  -XX:+UnlockExperimentalVMOptions \
  -XX:+DisableExplicitGC \
  -XX:+AlwaysPreTouch \
  -XX:G1HeapWastePercent=5 \
  -XX:G1MixedGCCountTarget=4 \
  -XX:G1MixedGCLiveThresholdPercent=90 \
  -XX:G1RSetUpdatingPauseTimePercent=5 \
  -XX:SurvivorRatio=32 \
  -XX:+PerfDisableSharedMem \
  -XX:MaxTenuringThreshold=1 \
  -Dusing.aikars.flags=https://mcflags.emc.gs \
  -Daikars.new.flags=true \
  -jar minecraft_server.jar nogui
Make script executable
# Add execute permissions
chmod +x start.sh

💡 Aikar's optimization flags: These JVM parameters are specifically designed to optimize Minecraft performance. More info at aikar.co/flags.


9

Use Screen to Manage the Server

Screen allows you to keep the server running in the background.

Install Screen

# Return to root to install screen
exit

# Install screen
sudo apt install screen -y

# Switch back to minecraft user
sudo su - minecraft
cd ~/server

Start with Screen

Screen commands
# Create a screen session named "minecraft"
screen -S minecraft

# Start the server
./start.sh

# Detach session: Ctrl+A then D
# The server keeps running in the background

# To return to the session
screen -r minecraft

# List all sessions
screen -ls

10

Configure Auto-Start

Create a systemd service to automatically start the server.

Create systemd service
# Return to root
exit

# Create service file
sudo nano /etc/systemd/system/minecraft.service
Service content
[Unit]
Description=Minecraft Server
After=network.target

[Service]
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft/server
ExecStart=/opt/minecraft/server/start.sh
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
Enable and start service
# Reload systemd
sudo systemctl daemon-reload

# Enable at startup
sudo systemctl enable minecraft

# Start server
sudo systemctl start minecraft

# Check status
sudo systemctl status minecraft

# View logs in real-time
sudo journalctl -u minecraft -f

✅ Your Minecraft server now starts automatically when the VPS boots!


11

Useful Administration Commands

Stop server properly

sudo systemctl stop minecraft

Restart server

sudo systemctl restart minecraft

View logs

sudo journalctl -u minecraft -n 50

Access console (with screen)

sudo su - minecraft
screen -r minecraft

Save the world

# In Minecraft console
save-all

Add player to whitelist

# In Minecraft console
whitelist add PlayerName
whitelist on

Minecraft console commands:

CommandDescription
whitelist add <player>Add to whitelist
whitelist remove <player>Remove from whitelist
op <player>Give admin rights
deop <player>Remove admin rights
kick <player>Kick a player
ban <player>Ban a player
pardon <player>Unban a player
stopStop the server
save-allSave the world
listList connected players

12

Performance Optimization

RAM Adjustment

RAM based on player count
# 1-5 players: 2 GB RAM
MIN_RAM="1G"
MAX_RAM="2G"

# 5-10 players: 3-4 GB RAM
MIN_RAM="2G"
MAX_RAM="4G"

# 10-20 players: 4-6 GB RAM
MIN_RAM="3G"
MAX_RAM="6G"

# 20+ players: 6-8 GB RAM
MIN_RAM="4G"
MAX_RAM="8G"

⚠️ Important

Never allocate ALL your VPS RAM to Minecraft! Leave at least 1 GB for the operating system.

Optimize server.properties

Parameters for better performance
# Reduce view distance
view-distance=8
simulation-distance=8

# Limit entities
max-players=15

# Disable resource-intensive features if needed
spawn-monsters=true
spawn-animals=true
spawn-npcs=true

13

Alternatives: Paper and Spigot

For better performance, consider Paper or Spigot instead of Vanilla.

Install Paper (Recommended)

Download Paper
# Switch to minecraft user
sudo su - minecraft
cd ~/server

# Download Paper (version 1.21.1)
wget https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/119/downloads/paper-1.21.1-119.jar -O paper.jar

# Modify start.sh to use paper.jar instead of minecraft_server.jar
nano start.sh
# Replace "minecraft_server.jar" with "paper.jar"

💡 Paper advantages:

  • Better performance (up to 50% faster)
  • Bukkit/Spigot plugin support
  • Built-in anti-lag optimizations
  • Advanced configuration with paper.yml

Install Spigot

Compile Spigot with BuildTools
# Install Git (if not already installed)
sudo apt install git -y

# Switch to minecraft user
sudo su - minecraft
mkdir ~/buildtools && cd ~/buildtools

# Download BuildTools
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar

# Compile Spigot (takes 5-10 minutes)
java -jar BuildTools.jar --rev 1.21.1

# Copy to server folder
cp spigot-*.jar ~/server/spigot.jar

14

Automatic Backups

Create regular backups of your world.

Backup script
# Create backup script
sudo nano /usr/local/bin/minecraft-backup.sh
Script content
#!/bin/bash

# Configuration
BACKUP_DIR="/opt/minecraft/backups"
SERVER_DIR="/opt/minecraft/server"
DATE=$(date +%Y-%m-%d_%H-%M-%S)
BACKUP_FILE="minecraft-backup-$DATE.tar.gz"

# Create backup folder
mkdir -p $BACKUP_DIR

# Create archive (exclude backups and logs)
tar -czf "$BACKUP_DIR/$BACKUP_FILE" \
    -C $SERVER_DIR \
    --exclude='backups' \
    --exclude='logs' \
    world world_nether world_the_end server.properties ops.json whitelist.json

# Keep only the last 7 backups
cd $BACKUP_DIR
ls -t | tail -n +8 | xargs -r rm

echo "Backup created: $BACKUP_FILE"
Automate with cron
# Make script executable
sudo chmod +x /usr/local/bin/minecraft-backup.sh

# Add to crontab (backup every 6 hours)
sudo crontab -e

# Add this line:
0 */6 * * * /usr/local/bin/minecraft-backup.sh

💬 Need Help?

If you encounter any difficulties with your Minecraft server:


⛏️ Congratulations!

Your Minecraft server is now operational on Debian! Share your server IP with friends and start building your world!

To connect: Open Minecraft → Multiplayer → Add Server → YOUR_VPS_IP:25565

Tags

#minecraft#debian#ubuntu#gaming#java
Questions? Let’s chat.
contact [at] atmosnode [dot] com
Live Chat
AtmosNode
© 2025 AtmosNode.com • Company number: 899 139 182
Loading...
Company not subject to VAT

🔒 Secure Payment Methods (Crypto accepted)

Visa
MasterCard
PayPal
Apple Pay
Google Pay