A Minecraft server is a favorite DDoS target: its IP is usually exposed to every player who connects, and ready-made attack tools are cheap and widely sold. This article gives an honest overview of the threats and lays out a layered defense — from the network layer, which depends on your provider, to hardening both the operating system and the game itself. The goal is to make clear what a single VPS can genuinely do, and what requires infrastructure beyond your own box.
Threats a Minecraft Server Faces
Before planning a defense, you must understand what you are defending against. Attacks on a Minecraft server come in several forms that each demand a different response.
- Volumetric / amplification DDoS (Layer 3/4) — massive UDP traffic sent via amplification vectors such as DNS, NTP, or memcached to saturate your bandwidth until players cannot connect. Attacks of tens to hundreds of Gbps are far beyond what one VPS can absorb.
- TCP SYN flood on port 25565 — floods of SYN packets meant to exhaust the server's connection table. This can be partly mitigated at the iptables/ufw level if the attack is small.
- Application-layer bot join flood — fake bots repeatedly try to join with random names, burning RAM and CPU until the server crashes even while bandwidth is fine.
- IP grabbing and targeted player attacks — attackers trick players into clicking links to grab their IP, or use snooping plugins, then DDoS the player's home connection directly.
The Hard Truth: One VPS Cannot Absorb a Large DDoS
Do not believe claims that "a few config lines make you 100% DDoS-proof." No iptables rule, ufw policy, or plugin can save a single VPS from a large volumetric attack. Once traffic saturates the uplink into the machine, packets are dropped upstream before they ever reach your firewall. On-host filtering only helps against small attacks.
Real network-layer DDoS protection must happen upstream — at the provider's edge or at a scrubbing center with enormous bandwidth that absorbs and filters malicious traffic before it reaches you. That is why serious protection relies on provider infrastructure, not on configuration alone.
Hide the Origin IP with a TCP Reverse Proxy (Optional)
A popular strategy for Minecraft is to place a reverse proxy / anti-DDoS layer in front of the server to hide its real IP. Players connect through a domain pointed at the proxy, so attackers only ever see the proxy's IP, not your machine. When an attack comes, it hits the proxy's scrubbing layer instead.
- TCPShield — a reverse proxy purpose-built for Minecraft (Java Edition) that hides the IP and filters attacks, working with a verification plugin to prevent bypass.
- Cloudflare Spectrum — a general TCP/UDP proxy that extends DDoS protection to non-web ports.
Both are third-party external services and are optional add-ons, not requirements. If your server is a small community of friends, hiding the IP through a whitelist and basic hardening may be enough.
Hardening at the Operating-System Level
This layer is fully within your control on a VPS: make the host resilient and shrink its attack surface.
Run the server as a non-root user
Never run the Minecraft process as root. Create a dedicated user such as mcserver to limit the damage if a plugin vulnerability is exploited.
Open only the ports you need with UFW
# Default-deny inbound, then open only what you use
sudo ufw default deny incoming
sudo ufw default allow outgoing
# SSH (consider changing the port or restricting by IP)
sudo ufw allow 22/tcp
# Minecraft Java Edition port
sudo ufw allow 25565/tcp
sudo ufw enable
sudo ufw status verbose
Protect SSH with fail2ban and disable passwords
Install fail2ban to ban IPs that repeatedly fail SSH login, then switch to key-based authentication and disable password login in /etc/ssh/sshd_config by setting PasswordAuthentication no and PermitRootLogin no.
Keep everything updated
Regularly update the OS, the Java runtime, the server software (Paper/Spigot/Vanilla), and every plugin. Past vulnerabilities such as Log4Shell showed that running outdated software is a serious risk.
Rate-Limit Connections with iptables (Small Attacks Only)
You can use iptables to cap new connections per IP on port 25565 to slow down small SYN floods and bot join floods.
# Cap new connections: drop if an IP holds too many, and rate-limit new SYNs
sudo iptables -A INPUT -p tcp --dport 25565 --syn -m connlimit \
--connlimit-above 10 --connlimit-mask 32 -j DROP
sudo iptables -A INPUT -p tcp --dport 25565 --syn -m recent --name mc --set
sudo iptables -A INPUT -p tcp --dport 25565 --syn -m recent --name mc \
--update --seconds 60 --hitcount 4 -j DROP
# Basic SYN-flood protection
sudo sysctl -w net.ipv4.tcp_syncookies=1
These rules help against low-volume attacks and bots hammering from the same IP, but they do nothing against a large volumetric attack spread across tens of thousands of distributed sources. Treat them as a way to "slow down," not "fully prevent."
Hardening on the Minecraft Side
Settings in server.properties and the right plugins block a great deal of application-layer abuse.
online-mode=true— forces players to authenticate with Mojang's servers, blocking cracked clients that are commonly used for join floods.- Whitelist — for private servers, set
white-list=trueand add only known players; bots not on the list cannot join at all. - Anti-bot / anti-VPN plugins — detect bot join floods and block suspicious IPs from VPNs or proxies.
- Set
max-playerssensibly — do not set it beyond what the machine can handle, so RAM is not exhausted into a crash. network-compression-threshold— tune it to your player count to reduce CPU and bandwidth load.- Disable
enable-command-blockif unused, reducing the attack surface. - Restrict op and use LuckPerms — do not hand out op freely; use a permissions system like LuckPerms for fine-grained control.
Summary Table: Attack Type and Mitigation
| Attack type | Layer | Primary mitigation |
|---|---|---|
| Volumetric / amplification (UDP flood) | L3/4 | Upstream provider scrubbing / reverse proxy (TCPShield, Cloudflare Spectrum) |
| TCP SYN flood on 25565 | L4 | iptables connlimit + tcp_syncookies (small), scrubbing (large) |
| Bot join flood | L7 | online-mode=true, whitelist, anti-bot plugins, rate-limit |
| IP grabbing / targeted player attack | Social/network | Educate players, hide origin IP via proxy, avoid suspicious links |
| Exploiting plugin vulnerabilities | System | Regular updates, run non-root, least privilege |
Backups and Monitoring
No system is 100% safe, so being ready to recover matters as much as prevention.
- Back up the world and configuration files regularly, and keep off-site copies.
- Monitor bandwidth, CPU, RAM, and connection counts so you notice an attack quickly.
- Review server and SSH logs regularly for anomalies, such as unusually frequent joins from a single IP.
The Hosting Provider's Role
Because large-scale DDoS filtering must happen upstream, choosing a provider with solid network infrastructure matters. AsiaGB's Linux VPS starts at 500 THB/month, uses SSD storage, and is backed by a 99% uptime guarantee, with a DirectAdmin panel for server management. You can freely install Java, Paper, and configure UFW/iptables exactly as described here. If you expect frequent large attacks, also consider placing an anti-DDoS reverse proxy such as TCPShield in front.
Frequently Asked Questions
Can UFW or iptables alone stop DDoS?
Only small attacks. A large volumetric attack saturates your bandwidth before traffic ever reaches your firewall, so you also need upstream scrubbing or a reverse proxy that hides your origin IP to survive serious attacks.
Are TCPShield or Cloudflare Spectrum required?
Not for every server. Both are optional third-party external services best suited to public servers that get attacked often. For a small private server, a whitelist plus basic hardening is usually enough.
How does online-mode=true improve security?
It forces players to authenticate with Mojang's servers, which blocks cracked clients that are commonly used for application-layer join floods. Pair it with a whitelist for private servers for the strongest protection.
What should I do if my server IP is exposed and attacked?
If you use a reverse proxy, rotate to a fresh origin IP and re-bind it to the proxy, close unnecessary ports, enable rate limiting, and notify your provider — then restore from backups if the service was damaged.
Ready to launch your Minecraft server?
AsiaGB Linux VPS (SSD, DirectAdmin, 99% uptime) from 500 THB/month — Thailand & Singapore datacenters for low ping, perfect for Minecraft servers of any size.
View VPS Plans