DigitalOcean Minecraft Server Guide 2026 — Complete Setup
Building your own Minecraft Server on a DigitalOcean Droplet gives you full control over resources, plugins, and world data.
Building your own Minecraft Server on a DigitalOcean Droplet gives you full control over resources, plugins, and world data—unlike managed Minecraft hosting that restricts customization. This guide walks through choosing a Droplet spec matched to your player count, installing Java and the server, setting up Firewall, auto-restart, world backups, and adding plugins or mods.
Contents
Choose Droplet Specs Based on Player Count
Choosing a Droplet spec for a Minecraft Server should start with the maximum number of concurrent players you expect, not the cheapest plan available. Minecraft, especially Paper with additional plugins, consumes more RAM as concurrent player count increases. The value of view-distance and accumulated world size after exploration also matters. As a rough guide, for a friend group of 2–5 playing vanilla or Paper on a small world, a Droplet with 2 GiB RAM / 1 vCPU / 50 GB SSD / 2,000 GiB transfer at $12/month works fine. If you scale to 5–10 concurrent players with light plugins like EssentialsX or LuckPerms, a Droplet with 4 GiB RAM / 2 vCPU / 80 GB SSD / 4,000 GiB transfer at $24/month is recommended. For a server with 10–20 concurrent players or modded Forge servers (which eat more RAM from loading multiple mods), use at least a Droplet with 8 GiB RAM / 4 vCPU / 160 GB SSD / 5,000 GiB transfer at $48/month. Avoid Droplet sizes of 512 MiB or 1 GiB because even though they cost only $4–6/month, the OS and JVM overhead alone consume so much RAM that there's barely room left to load the world, causing the server to hang or crash with OutOfMemoryError on the first run. For vCPU, both vanilla and Paper Minecraft process the main world on a single thread for the most part, so clock speed per core matters more than core count to a point. However, extra cores still help with JVM garbage collection and async plugins to avoid impacting the main world's TPS (ticks per second). For region, choose sgp1 (Singapore) first, then blr1 (Bangalore) for the lowest latency to Thai players. Both regions and all 15 DigitalOcean datacenters worldwide support all Droplet sizes.
- Friend group 2–5 players: Droplet 2 GiB RAM / 1 vCPU / 50 GB SSD at $12/month
- 5–10 players + light plugins: Droplet 4 GiB RAM / 2 vCPU / 80 GB SSD at $24/month
- 10–20 players or modded Forge: Droplet 8 GiB RAM / 4 vCPU / 160 GB SSD at $48/month
- Avoid 512 MiB or 1 GiB Droplets because OS + JVM overhead leaves no room to run the world
- Choose region sgp1 (Singapore) first, then blr1 (Bangalore) for lowest latency to Thai players
Install Java and Minecraft Server
From multiple reviews, start by SSH-ing into your Droplet (recommend fresh Ubuntu 24.04 LTS with system updates applied). Install Java using sudo apt update && sudo apt install -y openjdk-21-jre-headless because Minecraft 1.20.5+ requires Java 21 or later. (Always check your Minecraft version's requirements first.) Avoid running the server as root; instead, create a separate user with sudo adduser minecraft and switch to it with sudo su - minecraft.
Create a server directory using mkdir -p ~/server && cd ~/server then download your server software. If you choose Paper (recommended for beginners—compatible with Bukkit/Spigot plugins and performs better than vanilla), download the latest build from papermc.io as paper.jar. Before your first run, accept the EULA with echo "eula=true" > eula.txt or the server will shut down immediately.
Finally, run the server with the Java command and appropriate heap memory for your Droplet. For a 4 GiB Droplet, use java -Xmx3G -Xms3G -jar paper.jar nogui—always reserve at least 20–25% of your Droplet's RAM for the OS and other processes. Never set -Xmx to your Droplet's total RAM because SSH, the OS, and other services also need memory. Best practice is to set -Xmx and -Xms equal to reduce JVM overhead from heap resizing, which can cause temporary lag spikes.
- Install OpenJDK 21 with
sudo apt install -y openjdk-21-jre-headless(Minecraft 1.20.5+ requires Java 21+) - Create a separate user (
sudo adduser minecraft)—don't run the server as root - Accept EULA with
echo "eula=true" > eula.txtbefore the first run - Set -Xmx and -Xms equal, e.g.
java -Xmx3G -Xms3G -jar paper.jar noguifor a 4 GiB Droplet
Open Necessary Firewall Ports
Minecraft Java Edition uses port 25565 (TCP) by default to accept player connections. If you don't open this port correctly, players won't be able to connect even if the process is running normally. The recommended approach is to use DigitalOcean Cloud Firewall, a free feature with no extra charge beyond your regular Droplet cost. In the Control Panel, go to Networking > Firewalls, select Create Firewall, name it (e.g. minecraft-fw), and add an Inbound Rule for TCP port 25565 open to All IPv4/IPv6 (or restrict to known player IPs for maximum security). At the same time, restrict SSH port 22 to only your own IP, not open to everyone. Then attach the Firewall to your Droplet via Tags for easier management if you add more Droplets later.
Beyond DigitalOcean's Cloud Firewall, also configure ufw on the Droplet itself as a second defense layer using sudo ufw allow 25565/tcp, sudo ufw allow OpenSSH, then enable it with sudo ufw enable. Two firewall layers reduce the risk if one layer misconfigures. Check status with sudo ufw status. If players still can't connect after enabling both layers, verify the process is listening with sudo ss -tulpn | grep 25565. Note: this guide covers Minecraft Java Edition only. Supporting Bedrock Edition requires a separate UDP port and additional configuration outside this guide's scope.
- Open TCP port 25565 on DigitalOcean Cloud Firewall (free, no extra cost)
- Restrict SSH port 22 to your own IP only
- Attach the Firewall to your Droplet via Tags for easy multi-Droplet management
Set Up Auto-restart and World Backup
To avoid keeping an SSH session open all the time (it stops when SSH disconnects), set up a systemd service instead. Create /etc/systemd/system/minecraft.service with content summarized as [Unit] Description=Minecraft Server After=network.target [Service] User=minecraft WorkingDirectory=/home/minecraft/server ExecStart=/usr/bin/java -Xmx3G -Xms3G -jar paper.jar nogui Restart=on-failure RestartSec=10 [Install] WantedBy=multi-user.target. Then enable and start it with sudo systemctl enable --now minecraft.service. The Restart=on-failure setting makes systemd automatically restart the server if the process crashes without manual intervention. Check status and logs with sudo systemctl status minecraft.service and journalctl -u minecraft.service -f.
Backup should happen at two levels. First, back up just the world folder with a cron job using tar and rsync on a regular schedule—add a line to crontab via crontab -e that runs tar czf /home/minecraft/backups/world-$(date +%Y%m%d).tar.gz -C /home/minecraft/server world every night, then sync those backups off the main Droplet using rsync or upload to Spaces so backups survive if the Droplet fails. Second, use DigitalOcean Droplet Snapshots to back up the entire machine at $0.06 per GiB per month—ideal before major Minecraft version updates or risky config changes because you can restore the whole system with one click instead of just the world file.
Restart=on-failure to automatically restart the server on crash- Use a systemd unit with
Restart=on-failureto automatically restart the server on crash - Enable it with
sudo systemctl enable --now minecraft.service - Add a cron job to back up the world folder with
tar czfevery night - Store backups off the main Droplet, e.g. rsync to another machine or Spaces
Add Plugins/Mods (Paper/Forge)
Worth highlighting here — if you use Paper, adding plugins is straightforward: download the plugin .jar file and drop it in the plugins/ folder inside your server directory, then restart the server with sudo systemctl restart minecraft.service. Plugins load automatically. Popular plugins include EssentialsX for basic commands like teleport, home, and warp; LuckPerms for fine-grained player permission management; and WorldGuard to protect areas from damage or building by unauthorized players. Most plugins have config files in plugins/<plugin-name>/ that you can customize after the first restart.
For a full modpack (not just plugins), use Forge or Fabric instead of Paper. To install Forge, download the forge installer and run java -jar forge-installer.jar --installServer to get a Forge jar. Then drop each mod's .jar file in the mods/ folder. The critical caveat: every client connecting must have the exact same mod set and versions as the server, or they won't connect and will get a handshake error immediately. Forge/Fabric strictly validates mod parity between client and server.
Modded servers typically use 2× or more RAM than plain Paper because each mod adds entities, block types, and processing. If you ran Paper on a 4 GiB Droplet, a medium to large modpack needs at least an 8 GiB RAM / 4 vCPU Droplet or larger.
- Paper: drop plugin .jar files in
plugins/then restart the server - Popular plugins: EssentialsX (basic commands), LuckPerms (permissions), WorldGuard (area protection)
- Forge: run
java -jar forge-installer.jar --installServerthen drop mods inmods/ - Clients must install the exact same mods as the server in the same versions or connection fails
- Modded servers consume 2× or more RAM than plain Paper—upgrade to 8 GiB Droplet or larger
When to Use This (Real-World Use Cases)
Running your own Minecraft Server on DigitalOcean Droplet is best for users who need full control over plugins, mods, and config—unlike managed Minecraft hosting that locks you into preset packages. The most common case is a private server for a friend group or family (roughly 5–15 people) wanting a persistent personal world without sharing with strangers. You control costs clearly via Droplet size based on actual player count. Another good use case is testing a modpack or config before committing to long-term managed hosting. Because Droplets charge per-second, you can spin up, test, and destroy multiple times at minimal cost—perfect for finding the right -Xmx value or checking if a modpack runs smoothly before paying for dedicated hosting long-term. Short-term events also fit well: LAN parties or community tournaments can spin up a temporary server then tear it down and save a snapshot, avoiding paying for a whole month you won't use. It's also excellent for learning Linux server administration hands-on—covering SSH, systemd, firewall, and backup skills that transfer to other infrastructure work. Conversely, if you want a ready-to-go server without managing the OS, or if you're running a large public server needing dedicated support, managed Minecraft hosting may be a better fit.
- Private server for friend/family group (5–15 people) needing full config control and clear cost per player count
- Test modpack/config before long-term managed hosting, leveraging per-second billing for low-cost iteration
- Short-term events (LAN party, tournament) spin up, tear down, snapshot—avoid paying for unused month
Common Mistakes and How to Fix Them
The most common mistake is OutOfMemoryError from setting -Xmx too low for the actual player count and plugins. Watch for log messages showing java.lang.OutOfMemoryError: Java heap space. Fix it by raising -Xmx, or if you're already near your Droplet's RAM limit, upgrade the Droplet instead of forcing it.
Server lag that players notice usually stems from heavy plugin processing or view-distance set too high in server.properties. Use the in-game command /timings (Paper only) to see which plugin or task is eating the most tick time, then lower view-distance or disable unnecessary plugins.
Players can't connect even though the process runs normally? Most likely you forgot to open port 25565 on DigitalOcean Cloud Firewall or ufw is blocking it. Check both layers as described in the Firewall section. If you get Failed to bind to port on startup, another process is already using port 25565—check with sudo ss -tulpn | grep 25565, kill the hung process, and restart.
A final common beginner mistake: forgetting to accept the EULA causes the server to shut down immediately after generating config files on the first run. Fix it by setting eula=true in eula.txt and running again. If the server crashes and corrupts the world file, have a tested backup ready to restore—never rely on backups you haven't actually restored at least once.
- OutOfMemoryError: heap too small → raise -Xmx or upgrade Droplet if already near RAM limit
- Server lag: check with
/timingsor lower view-distance in server.properties - Can't connect: verify Cloud Firewall and ufw both open port 25565
Best Practices
For a private server that doesn't accept strangers, enable a whitelist by setting white-list=true in server.properties, then add approved players with the in-game command /whitelist add <player-name>. This is a stronger defense than opening the Firewall to the public with no extra layer.
Enable DigitalOcean Monitoring (free) to watch RAM, CPU, and disk usage in real-time, and set Alert Policies to email you before resource maxes out. That way you can upgrade your Droplet in advance before the server begins degrading.
On security: if you enable RCON for remote control, use a strong, unique RCON password—or disable RCON altogether if you don't need it. Keep your Paper/Forge build updated regularly to get the latest security patches and bug fixes, especially on public servers where old versions may have exploitable vulnerabilities.
Lastly, set a cron job to restart the server automatically during the quietest hours (e.g. 4 AM daily) to clear memory leaks that accumulate in plugins or mods over long uptime. Always test a full restore of at least one backup before relying on it in an emergency—if disaster strikes, you'll know the backup is trustworthy.
- Enable whitelist (
white-list=true) for private servers to block strangers - Enable DigitalOcean Monitoring (free) with Alert Policy to notify before RAM/disk fills
- Use a strong RCON password or disable RCON if not needed
- Update Paper/Forge builds regularly for the latest security patches
Frequently Asked Questions
plugins/ then restart. For Forge, drop mod .jar files in mods/ and ensure every client has the exact same mod set and versions as the server.