🛡️
VPS

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.

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.

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.

Summary Table: Attack Type and Mitigation

Attack typeLayerPrimary mitigation
Volumetric / amplification (UDP flood)L3/4Upstream provider scrubbing / reverse proxy (TCPShield, Cloudflare Spectrum)
TCP SYN flood on 25565L4iptables connlimit + tcp_syncookies (small), scrubbing (large)
Bot join floodL7online-mode=true, whitelist, anti-bot plugins, rate-limit
IP grabbing / targeted player attackSocial/networkEducate players, hide origin IP via proxy, avoid suspicious links
Exploiting plugin vulnerabilitiesSystemRegular updates, run non-root, least privilege

Backups and Monitoring

No system is 100% safe, so being ready to recover matters as much as prevention.

  1. Back up the world and configuration files regularly, and keep off-site copies.
  2. Monitor bandwidth, CPU, RAM, and connection counts so you notice an attack quickly.
  3. 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

View all affordable VPS Thailand plans →