Back to tutorials
Tutorial

cPanel Brute Force Protection Tutorial (2026): Configure cPHulk + WHM Firewall Rules Without Locking Out Customers

cPanel brute force protection tutorial for 2026: configure cPHulk, safe allowlists, and login alerts without blocking real users.

By Anurag Singh
Updated on Oct 11, 2026
Category: Tutorial
Share article
cPanel Brute Force Protection Tutorial (2026): Configure cPHulk + WHM Firewall Rules Without Locking Out Customers

Most cPanel compromises start the same way. A bot hammers /cpanel, /whm, or webmail until it finds a weak password.

You don’t need a sprawling security stack to stop that. This cPanel brute force protection tutorial walks through a practical, support-friendly setup.

You’ll use cPHulk, tight allowlists, and a few WHM-side guardrails. The goal is to cut abuse without turning customer logins into a help-desk event.

The steps below assume you manage a VPS or dedicated server running cPanel/WHM. If you want the security upside without owning every OS task, managed VPS hosting from HostMyCode is a solid option for teams that still want root-level control.

What you’ll build (and what you won’t)

You’ll enable cPHulk and tune it for normal hosting traffic. That includes shared IPs, roaming users, API access, and support workflows.

Then you’ll add a small set of firewall-side controls. These should complement cPHulk, not compete with it.

  • You will harden WHM/cPanel logins, webmail logins, and common brute-force entry points.
  • You will set safe allowlists for your office/VPN and monitoring endpoints.
  • You will build a repeatable process for unlocks and false positives.
  • You won’t get a general-purpose firewall guide. (That’s a separate topic.)

Prerequisites and quick safety checks

Before you touch thresholds or allowlists, make sure you can recover access if you lock yourself out. Five minutes now beats a long night later.

  1. Out-of-band access: Confirm you have VPS console access in your provider portal (or IPMI/KVM on a dedicated server).
  2. Know your admin IPs: Record your current public IP(s) and any VPN exit IPs.
  3. Update cPanel: In WHM, open cPanel & WHM Update and apply updates.

If you’re running a multi-tenant hosting node, sanity-check your broader hardening posture too. This pairs well with: secure cPanel/WHM without breaking customers.

cPanel brute force protection tutorial: enable cPHulk in WHM

cPHulk is cPanel’s built-in brute-force protection. It watches authentication failures across services (WHM, cPanel, Webmail, FTP, and others).

When failures spike, it blocks abusive sources.

WHM path: Security Center → cPHulk Brute Force Protection

  1. Click Manage Settings.
  2. Toggle Enable cPHulk.
  3. Click Save.

This enables cPHulk, but the defaults rarely fit real hosting traffic. The next steps keep protection high and lockouts low.

Tune lockout thresholds for hosting behavior (not lab behavior)

Two settings drive most results: how many failures trigger a block, and how long the block lasts. The goal is to stop fast, automated guessing without punishing normal human mistakes.

Recommended starting point for typical SMB hosting nodes

  • Brute Force Protection Period: 15 minutes
  • Maximum Failures by Account: 8
  • Maximum Failures by IP Address: 20
  • Initial Brute Force Protection Period (lockout): 30 minutes
  • Maximum Brute Force Protection Period: 24 hours

These values usually land well because bots fail quickly and repeatedly. Real users often mistype a few times, then reset a password.

A 30-minute first lockout shuts down automated retries. It also avoids effectively “banning” someone for the day.

Avoid this common mistake

Don’t set Maximum Failures by IP Address too low on servers with many users behind one NAT (offices, schools, mobile carriers). One person fat-fingering a password can block everyone sharing that public IP.

Allowlist the right things (office IPs, VPNs, monitoring) and nothing else

Allowlisting keeps admins from locking themselves out. It can also create permanent exceptions attackers love.

Keep allowlists narrow, documented, and reviewed.

What to allowlist

  • Your company office IPs
  • Your VPN egress IPs (prefer these over home ISP IPs)
  • Uptime monitoring IPs (only if they must reach WHM/cPanel endpoints)

What not to allowlist

  • Entire countries or broad IP ranges “just in case”
  • Customer IP addresses (they change and become risky long-lived exceptions)
  • CDN IP ranges (they’re enormous; don’t do this for login pages)

WHM path: Security Center → cPHulk Brute Force Protection → Whitelist Management

  1. Add your admin IP(s) as single IP entries (or tight CIDRs you control).
  2. Label each entry (example: HQ-VPN, NOC).
  3. Review quarterly and remove anything stale.

If you’re tightening admin authentication at the same time, pair this with: enforcing 2FA in WHM/cPanel without lockouts.

Protect the real targets: WHM, cPanel, Webmail, and XML-API access

cPHulk can monitor several services. On hosting servers, prioritize the services attackers hit most often.

WHM path: Security Center → cPHulk Brute Force Protection → Manage Settings

  • Enable monitoring for:
    • cPanel logins
    • WHM logins
    • Webmail logins
    • FTP logins (if you still offer FTP/FTPS)
    • Mail services (IMAP/POP) if you host mailboxes on the server
  • Be careful with: aggressive blocks on mail services if lots of devices are misconfigured. A single bad password saved on a phone can generate a burst of failures.

If email is part of your hosting stack, tighten DNS and auth too. That reduces “mystery” login issues and deliverability problems.

These are good companion reads:

Add firewall-side guardrails that complement cPHulk (without turning this into a firewall guide)

cPHulk reacts after repeated failures. You can reduce background noise by limiting who can reach admin endpoints.

Also confirm services only listen where you intend. Fix exposure before you tune thresholds.

1) Confirm cPanel service ports are what you expect

From SSH as root:

ss -lntp | egrep ':(2082|2083|2086|2087|2095|2096)\b'
  • 2087 = WHM (HTTPS)
  • 2083 = cPanel (HTTPS)
  • 2096 = Webmail (HTTPS)

If you spot unexpected bindings (for example, listening publicly when you meant private-only), fix that first. Otherwise you’ll end up tuning lockouts for traffic that should never reach these ports.

2) If you use a cloud firewall, restrict admin ports to trusted IPs

This is the cleanest first layer because it drops traffic before it hits the server. Keep it simple:

  • Allow 2087, 2083, 2096 only from your office/VPN IPs.
  • Leave 80/443 open to the world for websites.

Even on a small hosting VPS, this can cut brute-force attempts by 90%+ because bots can’t reach the login ports. Customers don’t need WHM.

Many customers also don’t need direct cPanel access if you front it with a branded portal. Choose based on how you support users.

3) On-server firewall: avoid double-blocking conflicts

If you run ConfigServer Security & Firewall (CSF) alongside cPHulk (common on cPanel servers), avoid overlapping brute-force systems with different thresholds.

Pick one system to handle login lockouts. Let the other focus on baseline filtering.

If you want a production firewall build, follow a dedicated guide like: build a production firewall for a hosting VPS. Keep your cPHulk changes isolated and easy to test.

Set up alerts and a repeatable unlock workflow

Brute-force protection only pays off if your team can quickly separate bot noise from real users who forgot passwords. Build the workflow before tickets pile up.

Enable notifications

WHM path: Security Center → cPHulk Brute Force Protection

  • Enable notifications for lockouts.
  • Send them to a shared ops mailbox (not one person’s inbox).

Unlock safely (and quickly)

WHM path: Security Center → cPHulk Brute Force Protection → History Reports

  1. Search by username or IP.
  2. Verify the source: customer IP? your VPN? a known monitoring system?
  3. Use Release for a one-off unlock.
  4. Only whitelist an IP if it’s static and admin-controlled.

Operational tip: if the lockout is tied to webmail/IMAP, have the customer remove and re-add the mailbox on their device.

If the wrong password stays saved, it will re-trigger the lockout within minutes.

Harden authentication so cPHulk doesn’t carry the whole load

cPHulk slows guessing attacks. It doesn’t fix weak passwords, reused credentials, or shared admin access.

Two changes raise the baseline quickly.

1) Enforce 2FA for WHM admins and resellers

Use WHM’s built-in 2FA enforcement policies. Pilot it with one reseller first.

This HostMyCode tutorial is written to avoid self-inflicted lockouts: enforce 2FA in WHM/cPanel without lockouts.

2) Prefer SSH keys for server admins (and disable password SSH)

Incidents often don’t stop at cPanel. Attackers probe SSH next.

SSH keys plus disabled password logins remove a major brute-force target. Follow: disable password logins for WHM/cPanel users and SFTP.

Test your setup without harming production users

You want evidence that you’re blocking bots, not customers. Run a controlled test from a non-whitelisted IP (a phone hotspot is fine).

  1. Attempt 8–10 failed logins to a test cPanel user on https://yourdomain.com:2083.
  2. Confirm you get a lockout.
  3. Check WHM History Reports to confirm the event logged correctly.
  4. Release the block and confirm login works with the correct password.

If you lock out too quickly (say, after 3–4 failures), raise the threshold.

If you never lock out, confirm the service is monitored and that you didn’t accidentally whitelist your test IP.

Common problems and fixes

Problem: Customers behind a shared IP keep getting blocked

  • Symptom: Multiple unrelated users report cPanel/Webmail lockouts around the same time.
  • Fix: Increase Maximum Failures by IP Address and shorten the brute-force tracking period slightly (example: 10–15 minutes) so older failures age out sooner.
  • Process fix: Encourage password manager use and self-service password resets.

Problem: IMAP/POP clients trigger repeated lockouts

  • Symptom: A user gets unlocked, then re-locks within minutes.
  • Fix: The mail client is still trying the old password. Remove and recreate the account on the device.
  • Prevent: If this is common in your environment, set slightly higher thresholds for mail services than for WHM.

Problem: You’re getting hammered on WHM specifically

  • Symptom: Thousands of attempts per day on :2087.
  • Fix: Use a cloud firewall or provider ACL to restrict 2087 to admin IPs only. Treat cPHulk as the backstop, not the front line.

Brute-force protection checklist (printable)

  • cPHulk enabled and monitoring cPanel/WHM/Webmail
  • Account failures: ~8; IP failures: ~20 (adjust to your user profile)
  • Admin IPs allowlisted (tight CIDRs only)
  • Notifications enabled to a shared ops mailbox
  • 2FA enforced for WHM admins/resellers
  • SSH keys in place; password SSH disabled for admins
  • Provider firewall restricts 2087 where possible
  • Quarterly review of allowlists and lockout history

Summary: keep bots out, keep support load down

cPHulk works best when you tune it for real hosting patterns. Add minimal restrictions on admin ports, and enforce 2FA for high-privilege users.

Don’t chase “maximum blocking.” Aim for fewer successful guesses and fewer legitimate lockouts.

If you’d rather run cPanel on infrastructure that can scale with demand, start with a HostMyCode VPS for single-server hosting, or move to dedicated servers when you need consistent performance for busy nodes and resellers.

On client-facing hosting servers, there’s a big difference between “security enabled” and “security that stays enabled.” HostMyCode offers managed VPS hosting and VPS plans that work well for cPanel deployments, with a clean path from a single node to a reseller platform.

FAQ

Does cPHulk replace Fail2Ban or CSF?

No. cPHulk targets authentication events inside cPanel services. CSF/Fail2Ban can protect broader services, but don’t run overlapping brute-force rules unless you’ve planned how thresholds and bans interact.

Should I whitelist my customers’ IP addresses to prevent lockouts?

Usually no. Customer IPs change, and a whitelist exception becomes permanent risk. Tune thresholds instead, and whitelist only admin-controlled IPs.

What’s a safe lockout time for shared hosting users?

Start with 30 minutes for the initial lockout. It disrupts bots while still giving real users a quick path back through support or a password reset.

Can I restrict WHM access to my office IP only?

Yes, and it’s one of the highest-impact changes you can make. Apply it at the provider/cloud firewall layer when possible, and keep console access available as your fallback.

How do I know if cPHulk is causing “false positives”?

Review cPHulk History Reports for repeat lockouts from shared NAT IPs and for mail-client password loops. Those patterns usually point to configuration problems, not targeted attacks.

cPanel Brute Force Protection Tutorial (2026): Configure cPHulk + WHM Firewall Rules Without Locking Out Customers | HostMyCode