Short answer: secure the aaPanel itself first (unique panel username and password, a custom security entrance path, two-factor authentication, restricted panel port and IP access, current panel version), then harden the server (firewall allowing only needed ports, SSH keys instead of passwords, automatic security updates), and finally harden each WordPress site (correct ownership and permissions, PHP disabled functions and open_basedir isolation, SSL, automated off-site backups, and file-change monitoring). Check cron jobs regularly, because attackers abuse them for persistence.
aaPanel is a popular free server control panel that makes it easy to run WordPress on a VPS with Nginx or Apache, PHP, MySQL and SSL. That convenience also means the panel is a powerful target: anyone who gets into aaPanel can control every site on the server. We run sites on aaPanel ourselves, and the steps below reflect what we apply after cleaning up a WordPress compromise in November 2026.

1. Lock down panel access
In aaPanel Settings: change the default panel username to something non-obvious and set a long unique password; set a security entrance (a random path required to reach the login page); enable Google Authenticator two-factor authentication for panel login; change the panel port from the default and, if you have a static IP, restrict panel access to your IP using the authorised IP setting; and enable HTTPS for the panel itself. Keep aaPanel updated, because panel vulnerabilities have been exploited in the past.
2. Harden the server
Use aaPanel’s firewall (or the system firewall) to allow only the ports you need: typically 80 and 443 for websites, your SSH port and the panel port. Close database ports to the outside world. For SSH, disable password login in favour of SSH keys, consider changing the port, and disable direct root login where practical. Enable automatic security updates for the operating system (for example unattended-upgrades on Ubuntu). Install fail2ban or aaPanel’s equivalent protection to block repeated login attempts.
3. Isolate sites and harden PHP
For each site, aaPanel can enable anti-cross-site attack (open_basedir), which restricts PHP to that site’s directory. Keep it on so a compromised site cannot read others. In the PHP settings, use a supported PHP version, and review disabled functions; aaPanel disables many dangerous functions such as exec and shell_exec by default, so only re-enable a function if a specific plugin genuinely requires it. Set reasonable upload and memory limits.
4. File ownership and permissions
On aaPanel, site files are usually owned by the www user. Apply 755 for folders and 644 for files, and tighten wp-config.php. aaPanel’s file manager can set permissions in bulk. Consider making core directories non-writable where your workflow allows, and block PHP execution in wp-content/uploads with an Nginx or Apache rule. See WordPress file permissions explained.
5. SSL and headers
Use aaPanel’s Let’s Encrypt integration to issue certificates, force HTTPS and enable automatic renewal. Add security headers such as Strict-Transport-Security, X-Content-Type-Options and a sensible Content Security Policy. See WordPress security headers setup.

6. WordPress-level hardening
Inside WordPress: keep core, plugins and themes updated, require two-factor authentication for admins, limit login attempts, disable XML-RPC if unused, set DISALLOW_FILE_EDIT, and remove unused plugins and themes. See the WordPress security checklist.
7. Backups
Use aaPanel’s scheduled tasks to back up each site’s files and database daily, and send copies off the server to object storage, another server or a cloud bucket the website cannot delete. Keep at least 30 days of history and test restores. A backup stored only on the same server is lost if the server is compromised or fails.
8. Monitor cron and files
Review aaPanel’s Cron page regularly. Attackers who gain panel or server access sometimes add shell script tasks that re-download malware. Also check system crontabs. Monitor recently changed files in each site, especially mu-plugins, themes and uploads; see monitoring WordPress file changes. aaPanel’s security and log viewers help spot brute-force attempts and unusual requests.
Frequently asked questions
Is aaPanel safe to use for WordPress?
Yes, when kept updated and properly locked down. The panel itself must be protected as strongly as root access.
Should I use a CDN or WAF in front of aaPanel?
A service like Cloudflare adds DDoS protection and firewall rules and can hide your server’s IP if configured correctly.
What does the security entrance do?
It hides the login page behind a random path, cutting automated attacks on the panel.
Can one hacked site infect others on the same server?
Without isolation, yes. Keep open_basedir enabled and use separate database users per site.



