aaPanel Security Hardening: Protect Your VPS
Harden aaPanel security. Change ports, enable SSL, set firewall rules, configure 2FA, patch vulnerabilities, and protect against common attacks.
On this page
aaPanel is a control panel for managing your VPS. It provides web interface access to administer websites, databases, email, and server settings. Because aaPanel is the gateway to your entire server, securing it prevents unauthorized access, data theft, and malware installation. A compromised aaPanel means a compromised VPS.
Why Harden aaPanel
- Control panel access = full server access: Anyone who gets into aaPanel can delete sites, steal databases, install backdoors
- Brute force attacks: Bots constantly scan the internet for default aaPanel credentials
- Default insecurity: aaPanel installs on standard port (8888) without SSL by default
- Plugin vulnerabilities: Unpatched plugins are common attack vectors
- User weakness: Shared login credentials or weak passwords are most common breach cause
Access Control
Change aaPanel admin port:
# Default port 8888 is well-known
# SSH into your VPS, then:
sudo /etc/init.d/bt restart # Restart aaPanel
# Edit port in /www/server/panel/data/port.pl
# Change from 8888 to custom port (e.g., 18765)
# Then access at: https://yourip:18765
Change default admin user:
- aaPanel dashboard → Settings → Change admin username
- Never use "admin" or "root"
Set strong password:
- Minimum 16 characters
- Mix uppercase, lowercase, numbers, symbols
- Change password every 90 days
- Never reuse old passwords
Firewall Configuration
Restrict aaPanel port access:
# Only allow your office/home IP
sudo ufw allow from 203.0.113.42 to any port 18765 # Your IP
# Block aaPanel access from everywhere else
sudo ufw deny 18765
# Verify rules
sudo ufw status
IP whitelist in aaPanel:
- aaPanel → Settings → IP Whitelist
- Add your office and home IPs
- Anyone else sees "Access denied"
Enable HTTPS for Panel
aaPanel default: unencrypted HTTP
- Passwords transmitted in plain text
- Sessions can be hijacked on public WiFi
- Man-in-the-middle attacks possible
Enable SSL certificate:
# aaPanel → Settings → SSL Certificate
# Install Let's Encrypt free certificate
# Or generate self-signed for private use:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /www/server/panel/ssl/privateKey.pem \
-out /www/server/panel/ssl/certificate.pem
# Then access: https://yourip:18765 (with warnings, but encrypted)
Strong Authentication
Enable 2-factor authentication (2FA):
- aaPanel → Settings → Two-factor Authentication
- Scan QR code with Google Authenticator or Authy app
- Even if password stolen, attacker can't login without phone
Set account recovery options:
- Add backup email address
- Generate recovery codes (store securely)
- Enable login notifications (email alerts for new logins)
Plugin & Extension Security
Remove unnecessary plugins:
- Uninstall unused extensions immediately
- Each plugin is a potential vulnerability
- aaPanel → Plugins → Uninstall old ones
Keep plugins updated:
- Check for updates weekly
- aaPanel → Plugins → Check for Updates
- Install security patches immediately
Monitor for Threats
Enable login logging:
- aaPanel → Settings → Login Log
- Review daily for unauthorized access attempts
- Notice unusual IP addresses or failed logins
Set up alerts:
- Email notification on failed login attempts (3+ failures)
- Alert on password changes
- Alert on plugin installations
Keep Systems Updated
Update aaPanel regularly:
# Check for updates
/bt.sh
# Update aaPanel
/bt.sh update
# Update Linux system
sudo apt update && sudo apt upgrade
Update PHP and MySQL:
- aaPanel → Software Manager → Update PHP, MySQL
- Patch vulnerabilities promptly
- Test on staging before production update
Bots scan the internet for aaPanel instances daily. Using default settings guarantees compromise. Change all defaults immediately. Use IP whitelisting for maximum security.
Related: aaPanel setup | Firewall setup | SSL certificates | Security hardening
Need aaPanel hosting?
Install aaPanel on an UnderHost VPS or dedicated server when you want a simple web interface for sites, databases, SSL, and apps.





















