ESC

Start typing to search across invoices, services, domains, tickets, and more...

Search... Ctrl+K
aaPanel / BaoTa

Fix Common aaPanel/BaoTa Problems: Panel Won't Open, 502/504, Disk Full, Forgotten Password

7 steps 14 min read 5 views 0
On this page

The most common aaPanel/BaoTa problems are a panel that won't open, 502/504 errors on PHP sites, a full disk and a forgotten panel password. This guide gives you the commands to diagnose each of them on aaPanel/BaoTa Linux panel running Debian/Ubuntu or CentOS/Rocky/AlmaLinux. Almost everything is done over SSH; see our "SSH login" guide if you need help connecting.

Step 1: aaPanel Won't Open — Find the Correct Panel URL

Recent panel versions generate a random port and a "security entry" path during installation, so opening IP:8888 often fails or shows an entry error. Log in over SSH and run bt default, or run bt and choose 14 (view panel default info), to get the full URL, port and default account. If the panel service is not running, restart it with bt restart.

# Show panel URL (with security entry), port and default account
bt default
# or open the menu and choose 14 (view panel default info)
bt

# Restart the panel service
bt restart
Menu numbers can differ slightly between versions; always follow the descriptions printed after you run bt. If you forgot the security entry, the bt menu also has an option to change it.

Step 2: Check the Panel Port, OS Firewall and Security Policies

If the URL is right but still unreachable, the port is usually blocked. Confirm which port the panel listens on and allow it in the OS firewall (8888 is used below; replace it with yours). If you use any additional network protection or security policy in front of the server, allow the port there too. Also check whether your local network blocks uncommon ports — try from a mobile hotspot.

# Which port is the panel listening on?
cat /www/server/panel/data/port.pl
ss -lntp | grep -E "BT-Panel|python"

# Debian / Ubuntu (ufw)
ufw allow 8888/tcp && ufw status
# CentOS / Rocky / AlmaLinux (firewalld)
firewall-cmd --permanent --add-port=8888/tcp && firewall-cmd --reload

Step 3: Forgot the aaPanel/BaoTa Password or Username

Log in over SSH, run bt to open the management menu, enter 5 to change the panel password or 6 to change the username, and type the new value. The change takes effect immediately. If you also forgot a custom port, use 8 to set a new panel port (and allow it in the firewall).

bt
# 5  -> change panel password
# 6  -> change panel username
# 8  -> change panel port
Use a strong panel password of at least 12 characters and keep the security entry and access restrictions enabled. See our "BaoTa panel security" guide.

Step 4: 502 Bad Gateway on PHP Websites

A 502 means Nginx cannot get a response from PHP-FPM, usually because PHP-FPM crashed, is not running or has run out of workers. Check the process and the socket file, restart the matching PHP version and read the site error log and PHP-FPM log. If you see "server reached pm.max_children", raise the worker count in the PHP performance settings of the panel, keeping an eye on available memory.

# Is PHP-FPM running? (74 = PHP 7.4, adjust to your version)
ps aux | grep php-fpm | head
ls -l /tmp/php-cgi-74.sock
/etc/init.d/php-fpm-74 restart

# Read the logs
tail -n 50 /www/wwwlogs/example.com.error.log
tail -n 50 /www/server/php/74/var/log/php-fpm.log
tail -n 50 /www/server/php/74/var/log/slow.log

Step 5: 504 Gateway Timeout on PHP Websites

A 504 means a PHP request ran longer than Nginx is willing to wait — typical for large imports, scraping scripts or slow SQL queries. Find the slow code with slow.log and the MySQL slow query log first. If long runtimes are genuinely needed, increase the FastCGI timeouts in the site's Nginx config and raise max_execution_time in php.ini accordingly.

# Inside the site's Nginx config (location ~ \.php$ or server block)
fastcgi_connect_timeout 60s;
fastcgi_send_timeout    300s;
fastcgi_read_timeout    300s;

Step 6: Test the Nginx Configuration with nginx -t

If Nginx refuses to start or all sites go down after you edited a vhost, rewrite rules or SSL, test the syntax first. nginx -t shows the file and line with the error; fix it and reload. If port 80/443 is reported as in use, find the program holding it with ss.

/www/server/nginx/sbin/nginx -t
/etc/init.d/nginx reload

# Debian / Ubuntu / CentOS: see what holds port 80/443
ss -lntp | grep -E ":80 |:443 "

Step 7: Disk Full Breaks the Panel and Websites

A full disk causes a chain of failures: panel login fails, MySQL stops, sites throw errors. Use the commands below to find the biggest directories; the usual suspects are site logs in /www/wwwlogs, local backups in /www/backup and MySQL binary logs. Empty logs that are still open with truncate instead of deleting them. Check inodes with df -i too (many small or session files). Our "low disk space" guide has more clean-up tips.

df -h
df -i
du -h --max-depth=1 /www 2>/dev/null | sort -h | tail -n 15
du -sh /www/wwwlogs /www/backup /www/server/data 2>/dev/null

# Empty (not delete) a huge log that is still open
truncate -s 0 /www/wwwlogs/example.com.log

# Purge old MySQL binary logs (run in mysql -uroot -p)
PURGE BINARY LOGS BEFORE NOW() - INTERVAL 3 DAY;

FAQ

The bt command says "command not found".

Use /etc/init.d/bt default or /etc/init.d/bt restart instead. If that file is missing too, the panel files are damaged; back up your data and repair or reinstall the panel with the official script.

502 comes back soon after restarting PHP.

Usually memory runs out or the worker count is too high and the kernel kills processes. Check free -m and OOM entries in dmesg, lower the worker count or add swap (see our "Linux swap" guide), or upgrade the plan.

The panel opens but says my IP or domain is not authorized.

Authorized IPs or a bound domain were configured earlier. Choose the matching option in the bt menu to remove the IP restriction or the domain binding.

Still stuck after following these steps? Open a support ticket and the IMIDC 24/7 technical team will help. Please include the server IP, OS version, the commands you ran and a screenshot of the error so we can pinpoint the issue faster.

Was this answer helpful?

Related Tutorials