How to Host a Minecraft Server in the Cloud: RAM Sizing, Backups, Plugins, and DDoS Protection

17 min read
minecraft servergame hostingcloud gamingserver managementDDoS protectionminecraft plugins

Hosting a Minecraft server in the cloud gives you reliable uptime, low-latency connections for players worldwide, automated backups, and the ability to scale resources as your community grows. This guide covers everything from choosing the right RAM for your player count to protecting against DDoS attacks.

A well-configured cloud Minecraft server provides a dramatically better experience than shared hosting: consistent 20 TPS (ticks per second), no neighbor noise from other servers, and full control over every configuration option.

RAM requirements by player count

Q: How much RAM does a Minecraft server need?

RAM requirements depend on the number of players, world size, installed plugins/mods, and view distance. These recommendations assume a Paper (Java Edition) server with 5-15 plugins:

PlayersMinimum RAMRecommended RAMArxentra planMonthly cost

1-51 GB2 GBStarter Plus$10/mo
5-152 GB4 GBPro$20/mo
15-304 GB8 GBPro Plus$40/mo
30-508 GB12 GBBusiness$60/mo
50-10012 GB16 GBBusiness Plus$80/mo
100+16 GB+24 GB+EnterpriseCustom

Key factors that increase RAM needs:

  • Modded servers (Forge/Fabric): Add 2-4 GB on top of vanilla requirements. Modpacks like All The Mods 9 need a minimum of 8 GB.
  • Large worlds: Pre-generated worlds beyond 10,000 block radius need additional RAM for chunk loading.
  • High view distance: Each increase in view distance from 10 to 16 chunks roughly doubles the loaded chunk count.
  • Plugin-heavy servers: Dynmap, WorldEdit, and economy plugins each add 200-500 MB of RAM usage.

CPU requirements:

Minecraft is predominantly single-threaded. The main game loop runs on one core, with I/O and network on secondary threads. For the best performance:

PlayersMinimum CPURecommended

1-151 vCPU (3.0 GHz+)2 vCPU
15-502 vCPU (3.0 GHz+)4 vCPU
50+4 vCPU (3.5 GHz+)4+ vCPU (high-frequency)

Arxentra's compute instances use AMD EPYC or Intel Xeon processors with base clocks of 3.0 GHz+, which provide consistent single-thread performance for Minecraft.

Paper server setup

Q: Why Paper instead of vanilla Minecraft server?

Paper is a high-performance fork of Spigot that includes over 200 optimizations for server performance. Paper typically provides 30-50% better TPS compared to vanilla at the same player count. It also supports the full Bukkit/Spigot plugin ecosystem and includes built-in anti-cheat improvements.

Initial setup

Create a Dockerfile for your Minecraft server:

FROM eclipse-temurin:21-jre-alpine

<h1>Create minecraft user</h1>

RUN addgroup -S minecraft && adduser -S minecraft -G minecraft

WORKDIR /server

<h1>Download Paper</h1>

ARG MC_VERSION=1.21.4

ARG PAPER_BUILD=latest

RUN wget -O paper.jar \

"https://api.papermc.io/v2/projects/paper/versions/${MC_VERSION}/builds/${PAPER_BUILD}/downloads/paper-${MC_VERSION}-${PAPER_BUILD}.jar" \

|| wget -O paper.jar \

"https://api.papermc.io/v2/projects/paper/versions/${MC_VERSION}/builds/latest/downloads/paper-${MC_VERSION}-latest.jar"

<h1>Accept EULA</h1>

RUN echo "eula=true" > eula.txt

<h1>Copy configurations</h1>

COPY server.properties .

COPY bukkit.yml .

COPY spigot.yml .

COPY config/paper-global.yml config/

<h1>Copy plugins</h1>

COPY plugins/ plugins/

<h1>Data volume for world persistence</h1>

VOLUME ["/server/world", "/server/world_nether", "/server/world_the_end", "/server/logs"]

USER minecraft

EXPOSE 25565

CMD ["java", \

"-Xms4G", "-Xmx4G", \

"-XX:+UseG1GC", \

"-XX:+ParallelRefProcEnabled", \

"-XX:MaxGCPauseMillis=200", \

"-XX:+UnlockExperimentalVMOptions", \

"-XX:+DisableExplicitGC", \

"-XX:+AlwaysPreTouch", \

"-XX:G1NewSizePercent=30", \

"-XX:G1MaxNewSizePercent=40", \

"-XX:G1HeapRegionSize=8M", \

"-XX:G1ReservePercent=20", \

"-XX:G1HeapWastePercent=5", \

"-XX:G1MixedGCCountTarget=4", \

"-XX:InitiatingHeapOccupancyPercent=15", \

"-XX:G1MixedGCLiveThresholdPercent=90", \

"-XX:G1RSetUpdatingPauseTimePercent=5", \

"-XX:SurvivorRatio=32", \

"-XX:+PerfDisableSharedMem", \

"-XX:MaxTenuringThreshold=1", \

"-jar", "paper.jar", "--nogui"]

JVM optimization flags explained

Q: What do these JVM flags do and why are they important?

The JVM flags in the Dockerfile are the Aikar flags, widely considered the optimal GC configuration for Minecraft servers. Here is what the critical ones do:

FlagPurpose

`-Xms4G -Xmx4G`Set min and max heap equal to prevent heap resizing pauses
`-XX:+UseG1GC`Use G1 garbage collector (best for Minecraft's allocation patterns)
`-XX:MaxGCPauseMillis=200`Target max GC pause of 200ms (prevents TPS drops)
`-XX:G1NewSizePercent=30`Allocate 30% of heap to young generation (Minecraft creates many short-lived objects)
`-XX:G1MaxNewSizePercent=40`Cap young generation at 40% to leave room for long-lived objects
`-XX:G1HeapRegionSize=8M`8 MB regions balance fragmentation and collection efficiency
`-XX:G1ReservePercent=20`Reserve 20% heap as safety buffer for allocation spikes
`-XX:InitiatingHeapOccupancyPercent=15`Start background GC early at 15% occupancy to avoid full GC pauses
`-XX:+AlwaysPreTouch`Pre-allocate memory pages at startup (avoids runtime page faults)
`-XX:+PerfDisableSharedMem`Disable perf counters that cause disk I/O and minor GC pauses
`-XX:MaxTenuringThreshold=1`Promote objects to old gen after 1 GC cycle (matches MC's allocation pattern)

Important: Always set `-Xms` and `-Xmx` to the same value. If they differ, the JVM wastes CPU cycles resizing the heap. Set both to approximately 70-80% of your container's available RAM, leaving 20-30% for the OS, JVM overhead, and plugins.

server.properties configuration

Q: What are the optimal server.properties settings?

The server.properties file controls core server behavior. These settings are optimized for performance and a good player experience:

<h1>Network</h1>

server-port=25565

server-ip=0.0.0.0

network-compression-threshold=256

max-players=20

online-mode=true

<h1>Performance</h1>

view-distance=10

simulation-distance=8

max-tick-time=60000

entity-broadcast-range-percentage=100

<h1>Gameplay</h1>

difficulty=normal

gamemode=survival

pvp=true

allow-nether=true

spawn-protection=16

allow-flight=false

<h1>World</h1>

level-name=world

level-seed=

level-type=minecraft\:normal

generate-structures=true

max-world-size=29999984

<h1>RCON (for remote management)</h1>

enable-rcon=true

rcon.port=25575

rcon.password=your-secure-rcon-password

<h1>Misc</h1>

motd=My Cloud Minecraft Server

enable-command-block=false

white-list=false

Key performance settings:

SettingDefaultRecommendedWhy

view-distance108-10Each increment loads ~20% more chunks
simulation-distance106-8Limits entity processing range (biggest TPS impact)
network-compression-threshold256256Compress packets over 256 bytes (saves bandwidth)
max-tick-time6000060000Watchdog timeout in ms (60s is safe)

Reduce `simulation-distance` first if you experience TPS drops. This has the largest performance impact because it reduces the number of entities (mobs, villagers, redstone) that the server simulates each tick.

Essential plugins

Q: What plugins should every Minecraft server have?

PluginPurposeRAM impact

EssentialsXCore commands (teleport, home, spawn, kits)~100 MB
LuckPermsPermission management (groups, roles)~50 MB
WorldGuard + WorldEditRegion protection and world editing~200 MB
CoreProtectBlock logging and rollback (anti-grief)~150 MB
SparkPerformance profiling and monitoring~30 MB
ViaVersionMulti-version support (let older clients connect)~50 MB

Install only the plugins you need. Each plugin adds RAM usage, increases startup time, and potentially introduces compatibility issues. A server with 30+ plugins will have significantly worse performance than one with 10 well-chosen plugins.

Performance monitoring with Spark:

Spark is essential for diagnosing performance issues. Run `/spark profiler start` in the server console to generate a CPU profile. The profile shows which plugins and game systems consume the most CPU time per tick. If your TPS drops below 20, Spark will tell you exactly why.

Automated backup script

Q: How do I set up automated backups?

World corruption from crashes, griefers, or failed updates can destroy hundreds of hours of player progress. Automated backups are non-negotiable.

Create a backup script that runs every 6 hours:

#!/bin/bash

<h1>backup.sh - Minecraft world backup script</h1>

BACKUP_DIR="/backups"

WORLD_DIR="/server"

RETENTION_DAYS=14

TIMESTAMP=$(date +%Y%m%d_%H%M%S)

BACKUP_FILE="${BACKUP_DIR}/world_${TIMESTAMP}.tar.gz"

<h1>Notify players</h1>

screen -S minecraft -X stuff "say Backup starting in 10 seconds. Brief lag expected.\n"

sleep 10

<h1>Disable auto-save during backup (prevents corruption)</h1>

screen -S minecraft -X stuff "save-off\n"

screen -S minecraft -X stuff "save-all\n"

sleep 5

<h1>Create compressed backup</h1>

tar -czf "${BACKUP_FILE}" \

-C "${WORLD_DIR}" \

world/ world_nether/ world_the_end/ \

plugins/ server.properties bukkit.yml spigot.yml

<h1>Re-enable auto-save</h1>

screen -S minecraft -X stuff "save-on\n"

screen -S minecraft -X stuff "say Backup complete.\n"

<h1>Delete backups older than retention period</h1>

find "${BACKUP_DIR}" -name "world_*.tar.gz" -mtime +${RETENTION_DAYS} -delete

<h1>Log backup info</h1>

BACKUP_SIZE=$(du -sh "${BACKUP_FILE}" | cut -f1)

echo "[$(date)] Backup created: ${BACKUP_FILE} (${BACKUP_SIZE})"

Schedule this script as a cron job in your Arxentra service configuration:

<h1>In arxentra.yaml</h1>

services:

minecraft:

build: ./Dockerfile

port: 25565

protocol: tcp

volumes:

- world-data:/server/world

- backups:/backups

cron:

- schedule: "0 */6 * * *"

command: /server/backup.sh

For additional safety, upload backups to object storage weekly:

<h1>Upload latest backup to object storage</h1>

arx storage upload "${BACKUP_FILE}" "minecraft-backups/${TIMESTAMP}/"

DDoS protection

Q: How do I protect my Minecraft server from DDoS attacks?

DDoS attacks are the most common threat to public Minecraft servers. Attackers flood the server with traffic to make it unreachable for legitimate players. Protection works at multiple layers:

Layer 1: Platform-level protection

Arxentra provides built-in DDoS mitigation for all services. Network-level (L3/L4) attacks are filtered automatically before reaching your container. This handles volumetric attacks (UDP floods, SYN floods) up to 10 Gbps on standard plans.

Layer 2: Application-level protection

For application-level attacks (login floods, join/quit spam), configure these protections:

ProtectionImplementationEffect

Connection throttlingPaper config: `settings.connection-throttle`Limit connections per IP per second
Proxy protocolTCPShield or Cloudflare SpectrumHide server IP, filter at edge
Whitelistserver.properties: `white-list=true`Only allowed players can connect
Rate limitingPlugin: AntiBot or BotSentryBlock bot join floods
GeoIP blockingPlugin: CountryBlockBlock connections from non-player regions

Layer 3: TCP proxy services

For serious DDoS protection, use a TCP proxy that sits in front of your server:

ServiceFree tierProtection levelMonthly cost

TCPShieldYes (5 Gbps)Good$0-25/mo
Cloudflare SpectrumNoExcellent$1/GB
OVH Game DDoSWith OVH serversGoodIncluded
Cosmic GuardYes (limited)Good$0-15/mo

TCPShield is the most popular choice for Minecraft. It provides a proxy IP that players connect to, hiding your real server IP. Attacks hit TCPShield's network (which has multi-Tbps capacity) instead of your server.

To set up TCPShield:

  • Create a TCPShield account and add your domain
  • Point your Minecraft SRV record to TCPShield's proxy
  • Install the TCPShield plugin on your Paper server (required for real player IPs)
  • Add TCPShield's IP ranges to your firewall whitelist
  • Firewall configuration

    Restrict incoming connections to only trusted sources:

    <h1>Allow only TCPShield IPs to connect to port 25565</h1>
    

    <h1>(TCPShield publishes their IP ranges at tcpshield.com/ip-ranges)</h1>

    <h1>Block all other connections to Minecraft port</h1>

    iptables -A INPUT -p tcp --dport 25565 -j DROP

    <h1>Allow TCPShield IPs (example ranges, check current list)</h1>

    iptables -I INPUT -p tcp --dport 25565 -s 51.79.0.0/16 -j ACCEPT

    iptables -I INPUT -p tcp --dport 25565 -s 198.251.80.0/22 -j ACCEPT

    On Arxentra, configure these rules in the service's network settings rather than using iptables directly.

    Performance monitoring

    Q: How do I know if my server is performing well?

    The most important metric is TPS (ticks per second). Minecraft targets 20 TPS. Below 18 TPS, players experience noticeable lag. Below 15 TPS, the game becomes unplayable.

    TPSPlayer experienceAction needed

    20PerfectNone
    18-19.9Minor lag, barely noticeableMonitor, no immediate action
    15-17.9Noticeable lag (block break delay, mob rubber-banding)Run Spark profiler, optimize
    10-14.9Severe lag (unplayable for PvP, redstone broken)Reduce simulation-distance, remove plugins
    <10Server is essentially frozenUpgrade RAM/CPU, major optimization needed

    Monitor TPS with the Spark plugin:

    • `/spark tps` -- Current TPS and recent averages
    • `/spark profiler start` -- Start CPU profiling
    • `/spark health` -- System health overview (CPU, memory, GC)
    • `/spark gc` -- Garbage collection statistics

    Arxentra's built-in monitoring shows CPU and memory usage for the container. Combine this with Spark's in-game metrics for complete visibility.

    Frequently asked questions

    Q: Java Edition or Bedrock Edition for cloud hosting?

    Java Edition. The server software (Paper, Spigot, Fabric) is more mature, has a vastly larger plugin ecosystem, and runs well on Linux containers. Bedrock Dedicated Server (BDS) is limited in plugin support and configuration options. If you need cross-platform play, use the GeyserMC plugin on a Paper server to allow Bedrock players to join a Java server.

    Q: Can I run a modded server (Forge/Fabric) on cloud hosting?

    Yes. Replace Paper with Forge or Fabric in the Dockerfile. Modded servers need more RAM (add 2-4 GB to the vanilla requirements). Fabric is lighter weight and recommended for servers with fewer than 50 mods. Forge is required for most large modpacks. Test your modpack locally first to determine actual RAM requirements.

    Q: How do I set up a custom domain for my Minecraft server?

    Create an SRV record at your DNS provider:

    TypeNamePriorityWeightPortTarget

    SRV_minecraft._tcp.play0525565your-server.arxentra.app

    Players can then connect using `play.yourdomain.com` instead of an IP address.

    Q: How do I migrate an existing world to cloud hosting?

    Compress your world folder locally and upload it to the cloud server:

    <h1>Local machine: compress world</h1>
    

    tar -czf world.tar.gz world/ world_nether/ world_the_end/

    <h1>Upload to server</h1>

    arx storage upload world.tar.gz minecraft-data/

    <h1>On server: extract</h1>

    tar -xzf world.tar.gz -C /server/

    Stop the server before extracting. Start it after the world files are in place. The first startup after migration may take 2-5 minutes as Paper converts chunk data to its optimized format.

    Q: Can I run multiple Minecraft servers on one container?

    Not recommended. Each Minecraft server should be a separate container/service. Running multiple servers in one container makes resource management, backups, and updates difficult. On Arxentra, create separate services for each server (survival, creative, minigames). They can share a BungeeCord/Velocity proxy for cross-server teleportation.

    Q: How do I update Minecraft/Paper to a new version?

    Update the `MC_VERSION` and `PAPER_BUILD` build arguments in your Dockerfile, commit, and push. Arxentra rebuilds and deploys automatically. Always backup your world before updating. Major version updates (1.20 to 1.21) may require plugin updates -- check plugin compatibility first. Run `/spark profiler start` after updating to verify performance has not degraded.

    Q: What is the expected monthly bandwidth usage?

    A Minecraft server with 10-20 active players uses approximately 50-100 GB of bandwidth per month. At 50 players, expect 200-400 GB. Arxentra's plans include 1-5 TB of bandwidth, which is more than sufficient for even large Minecraft communities. Bandwidth usage increases with player count, view distance, and entity density. Mods with custom textures/models increase bandwidth significantly.

    Q: How do I protect against griefers?

    Install CoreProtect for block logging and rollback. It records every block placement, destruction, and container access with timestamps and player names. To roll back grief damage: `/co rollback u:griefername t:1h r:50` (undo the last hour of a player's actions within 50 blocks). Combine with WorldGuard for region protection: define protected areas where only authorized players can build. For a full server setup guide, see the Arxentra documentation.

    For hosting other types of applications, see our SaaS hosting guide or FastAPI deployment guide.