aaPanel commands cheat sheet

This cheat sheet brings together the most useful commands for managing an aaPanel server from the command line: the bt menu and login details, starting and stopping the panel, releasing lockouts, updates and repair, the web server, PHP, databases, files and permissions, the firewall, and log locations. You can search for a command, filter by topic, and copy it with one click.

The bt menu and login details

  • bt

    Shows the aaPanel command menu (aaPanel CLI), with a number for each option. Choose a number in the menu, or run bt with the number directly, for example bt 14. The numbers may change between versions, so check the menu before you run a command.

  • bt default

    Shows the panel login details: the full address with the port and the security entrance, the username, and the password. The bt 14 command shows the same details. The password shown is the one set during installation, and if it has changed since, set a new password with bt 5.

  • bt 5

    Changes the panel password. The command asks you to type a new password, which can include letters, digits, underscores, periods, and commas, and then shows the username and the new password.

  • bt 6

    Changes the panel username used to log in. The names admin and root aren't accepted.

  • bt 28

    Changes the panel security entrance: a secret path added to the panel address, for example /my_panel. The path starts with / and is at least 6 characters long. Opening the panel without the correct path returns a 404 error.

  • bt 8

    Changes the panel port. Ports 20, 21, 22, 80, and 443 aren't accepted. The command opens the new port in the server firewall, and when your server provider runs an external firewall (security group), open the port there too.

  • bt 27

    Turns panel SSL, the secure HTTPS connection to the panel, on or off. When it's off, you open the panel at an address that starts with http. A self-signed certificate shows a warning in the browser, and you set up a Let's Encrypt certificate for the panel in the panel settings.

  • bt 12

    Cancels the domain binding limit of the panel. When the panel is bound to a domain, it opens only at the domain address, and access by IP address returns a 403 error. The command is useful when the domain doesn't point to the server.

  • bt 13

    Removes the limit that lets only listed IP addresses open the panel. Useful when your IP address has changed and the panel blocks you. After you log in, set the limit again with your new address.

Starting and stopping the panel

  • bt status

    Shows whether the panel service (Bt-Panel) and its task service (Bt-Task) are running, with the process ID of each.

  • bt restart

    Restarts the panel, exactly like bt 1. Useful when the panel doesn't load, and websites keep running during the restart.

  • bt stop

    Stops the panel, exactly like bt 2. Websites, databases, and other services keep running, but you can't log in to the panel until you start it again.

  • bt start

    Starts the panel after it was stopped, exactly like bt 3.

  • bt reload

    Reloads the panel, exactly like bt 4. When the panel isn't running, the command starts it.

Releasing lockouts and login protections

  • bt 10

    Clears the panel login limit, so you can try to log in again.

  • bt 33

    Releases the lock set by the brute force protection, which blocks logins after many failed attempts. You can also wait until the lock expires on its own.

  • bt 23

    Turns off BasicAuth, a separate username and password prompt shown before the login screen. Useful when the BasicAuth details are lost, and turn it back on after you log in.

  • bt 24

    Turns off two-factor authentication (Google Authenticator) for the panel when you don't have access to the authenticator app. After you log in, turn it back on and link it to the app.

  • bt 11

    Turns the IP + User-Agent Authenticator on or off. It ties the panel session to the computer you logged in from and protects against reuse of a stolen session (replay attack), so it's best to keep it on.

Installation, updates, and repair

  • URL=https://www.aapanel.com/script/install_panel_en.sh && if [ -f /usr/bin/curl ];then curl -ksSO "$URL" ;else wget --no-check-certificate -O install_panel_en.sh "$URL";fi;bash install_panel_en.sh forum

    Installs aaPanel with the official installation script, as root and on a clean server. At the end, the panel address, username, and password are shown, so save them somewhere safe. You can add the -P option with a port number for the panel to the end of the command, and the --safe-path option with a name for the security entrance, without the /.

  • bt 16

    Repairs the panel: checks its files for errors and updates them to the latest version. Run it over an SSH connection, not from the panel's terminal.

  • rm -f /tmp/update_to7.pl && curl -k https://node.aapanel.com/install/update_panel_en.sh | bash

    Updates the panel to the latest version with the official update script when updating from the panel fails. Take a snapshot of the server before the update.

  • mv /www/server/panel/pyenv /www/server/panel/pyenv_bak

    Moves the panel's Python environment aside when the panel doesn't start because of a problem in that environment. Right after it, run the update command, which installs a new environment.

  • curl -k https://www.aapanel.com/script/aapanel_check.sh | sudo bash

    The official panel health check: the process, port access, the login address, free disk space, the Python environment, and the panel log. The script may restart the panel and install telnet. Before you send the output to support, hide the IP address, the port, and the security entrance in it.

  • \cp -arpf /www/backup/panel/2026-11-28/data/default.db /www/server/panel/data/default.db

    Caution: restores the panel database from the automatic backup when websites or databases disappear from the panel because of a corrupted database. First copy the current file to a backup, and extract the backup from the right date in /www/backup/panel with unzip. After copying, run bt restart. The restore returns the panel settings to their state on that day.

More bt menu options

  • bt 9

    Clears the panel cache and deletes the active sessions, so every user logged in to the panel needs to log in again.

  • bt 15

    Caution: clears system rubbish, deleting temporary files and logs to free up space, including website logs in /www/wwwlogs, PHP session files in /tmp, and files in the subdirectories of /var/spool except cron and mail. Before you run it, save any logs you need for troubleshooting.

  • bt 17

    Turns compression (gzip) on or off for the logs cut by the log cutting task (Cut Log).

  • bt 18

    Turns the automatic panel backup to /www/backup/panel on or off. It's best to keep it on, because without it there's nothing to restore the panel database from when it gets corrupted. This backup doesn't include website files or their databases.

  • bt 25

    Turns on or off saving a copy of the previous version each time you edit a file in the panel's file manager.

  • bt 26

    Sets whether to keep a local copy of the backup on the server when the backup is sent to cloud storage.

The web server

  • /etc/init.d/nginx configtest

    Checks the configuration files of the Nginx installed from the panel and shows any errors. Run it before a reload.

  • /etc/init.d/nginx reload

    Reloads Nginx after a configuration change. The start, stop, restart, and status options work the same way.

  • /etc/init.d/httpd configtest

    Checks the configuration of the Apache installed from the panel. Restart Apache with /etc/init.d/httpd restart.

  • /usr/local/lsws/bin/lswsctrl restart

    Restarts OpenLiteSpeed when it's the web server selected in the panel. A restart is also needed after you change the settings of lsphp, the PHP versions OpenLiteSpeed uses.

  • ss -lntp 'sport = :80'

    Shows which process is using port 80 when Nginx fails to start with the error Address already in use. The process /www/server/panel/webserver/sbin/webserver belongs to the panel itself, and you don't need to do anything about it.

  • systemctl stop nginx && systemctl disable nginx

    Stops and disables an Nginx installed from operating system packages when it takes port 80 instead of the panel's Nginx. Run it only when the process path is /usr/sbin/nginx, and then start the panel's Nginx with /etc/init.d/nginx start.

  • /www/server/panel/vhost/nginx

    The directory of the website configuration files for Nginx. The Apache configuration is in /www/server/panel/vhost/apache, and the OpenLiteSpeed configuration is in /www/server/panel/vhost/openlitespeed. It's best to edit them from the panel.

PHP versions

  • /etc/init.d/php-fpm-83 restart

    Restarts PHP-FPM for version 8.3. The version number is written as two digits, for example 82 for version 8.2, and the status option shows the service status. OpenLiteSpeed has no separate PHP-FPM service.

  • /www/server/php/83/etc/php.ini

    The PHP 8.3 configuration file. After a change, restart PHP-FPM for the same version. It's best to change common settings from the panel, in the PHP version settings in the App Store.

  • /www/server/php/83/bin/php -v

    Runs a specific PHP version from the command line, for example in cron jobs. You can set which version the php command runs from the panel.

  • /usr/local/lsws/lsphp83/bin/php -v

    Runs the OpenLiteSpeed PHP (lsphp) from the command line. Its configuration is in /usr/local/lsws/lsphp83/etc.

Databases and Redis

  • /etc/init.d/mysqld status

    Shows the status of the MySQL or MariaDB installed from the panel. The start, stop, and restart options work the same way. The data is stored in /www/server/data, and the configuration file is /etc/my.cnf.

  • bt 7

    Caution: forcibly changes the MySQL root password. The command stops MySQL briefly, so websites lose their database connection during the change. The password must be at least 8 characters long and can include letters, digits, underscores, @, and periods. When the panel is available, change the password on the Databases page (Root Password).

  • mysql -uroot -p

    Connects to the database as root. By default, root can connect only from the server itself, and you change its password in the panel, on the Databases page.

  • grep -i -C 10 error /www/server/data/*.err | tail -n 200

    Shows the latest errors from the MySQL error log. Read it before a restart or a password change. If the data directory was changed, adjust the path.

  • curl -k https://www.aapanel.com/script/mysql_check.sh | bash

    The official MySQL check: the installation source, the process, the version, the data directory, and the port. When the service isn't running, the error log is shown. The check doesn't fix anything and doesn't change any data.

  • mysqldump -uroot -p exampledb > /www/backup/database/exampledb.sql

    Exports a database to an SQL file in the database backup directory. Back up this way before an import, a restore, or a change, and set up regular backups in the panel's cron jobs.

  • /etc/init.d/redis restart

    Restarts the Redis installed from the panel. The configuration file is /www/server/redis/redis.conf.

Websites, files, and permissions

  • /www/wwwroot/example.com

    The default directory of a website. Website backups are saved in /www/backup/site, and database backups in /www/backup/database.

  • chown -R www:www /www/wwwroot/example.com

    Returns ownership of the website files to the www user, which the web server runs as. The command fixes 403 errors and write problems after files are uploaded as root. An Operation not permitted message for the .user.ini file is expected and doesn't indicate a problem.

  • find /www/wwwroot/example.com -type d -exec chmod 755 {} + ; find /www/wwwroot/example.com -type f -exec chmod 644 {} +

    Sets 755 permissions for directories and 644 for files, the recommended permissions for a website. Don't use 777 permissions as a permanent fix.

  • chattr -i /www/wwwroot/example.com/.user.ini

    Removes the lock from the .user.ini file, which the panel creates in the website directory when open_basedir protection is on. The protection keeps the website from accessing other websites' directories, and the lock prevents the file from being deleted or changed, so remove the lock before you delete the website directory manually. The chattr +i command puts the lock back.

  • du -sh /www/backup /www/wwwlogs

    Shows the size of the backup and log directories, the common causes of a full disk. Before you delete anything, make sure the backup isn't the only copy, and don't delete files in /www/server/data.

Firewall and ports

  • firewall-cmd --list-ports

    Shows the ports open in firewalld, the firewall on Red Hat family servers such as AlmaLinux and Rocky Linux. The firewall in the panel manages the system firewall.

  • firewall-cmd --permanent --add-port=26500/tcp && firewall-cmd --reload

    Opens a port permanently and reloads the firewall. This example opens port 26500, for instance before moving the panel to a new port. Open the new port before you change the port in the panel.

  • ufw status

    Shows the status and rules of UFW, the common firewall on Ubuntu servers.

  • ufw allow 26500/tcp

    Opens a port in UFW. When your server provider runs an external firewall (security group), open the port there too.

  • fail2ban-client status

    Shows the list of active jails in Fail2ban, which you install from the panel (Fail2ban Manager) to block addresses with failed SSH login attempts.

  • fail2ban-client unban 203.0.113.5

    Unbans an IP address blocked by Fail2ban, in all jails. To keep the address from being blocked again, add it to the allowed addresses in the panel's protection settings.

Log locations

  • bt 22

    Shows the last 100 lines of the panel error log, /www/server/panel/logs/error.log. The bt logs command shows the same log. Check it when the panel doesn't start.

  • tail -f /www/wwwlogs/example.com.error.log

    Shows a website's Nginx error log in real time. The website's access log is /www/wwwlogs/example.com.log. Stop with Ctrl+C.

  • /www/wwwlogs/example.com-error_log

    A website's Apache error log. The same directory also has example.com-access_log, the website's access log.

  • /www/wwwlogs/example.com_ols.error_log

    A website's OpenLiteSpeed error log. The access log is example.com_ols.access_log in the same directory, and the general OpenLiteSpeed log is /usr/local/lsws/logs/error.log.

  • tail -n 100 /www/wwwlogs/nginx_error.log

    The general Nginx error log, with errors that don't belong to a specific website. The general Apache log is /www/wwwlogs/error_log.

  • tail -n 100 /www/server/php/83/var/log/php-fpm.log

    The PHP-FPM 8.3 log, for troubleshooting 502 and 503 errors. Replace 83 with the website's version.

  • tail -n 100 /www/server/redis/redis.log

    The log of the Redis installed from the panel.

Before you work with aaPanel from the command line

  • Root access: Run the bt commands and the service commands as root. A user with sudo access switches to root with sudo -i before running them.
  • Over SSH: Run the bt commands over an SSH connection, not from the panel's terminal, because stopping or restarting the panel also disconnects its terminal. The bt command is short for /etc/init.d/bt, and both accept the same options.
  • Menu numbers: The numbers in the bt menu may change between versions. Before you run a command by number, run bt and check the menu.
  • Ports: The panel runs on a random port set during installation and shown in the output of bt default. Websites also use ports 80 and 443, phpMyAdmin uses 888, FTP uses 20 and 21, and FTP connections in Passive mode, where the client opens the data connection to a port the server assigns, use the range 39000 to 40000. Open them in the server firewall and in your server provider's external firewall, and when you change a port, open the new one before you close the old one.
  • Turning protections back on: After you turn off a protection to log in to the panel, such as BasicAuth, two-factor authentication, or the IP access limit, turn it back on right after you log in.
  • Backup before a change: Before an update, a repair, or a change to ports or the firewall, take a snapshot of the server, and keep an SSH connection open until you've confirmed everything works.

The domain names, ports, IP addresses, and PHP versions on this page are examples, so replace them with your real values. For the meaning of errors such as 403, 502, and 504, see HTTP status codes, and for the differences between Nginx, Apache, and OpenLiteSpeed, see Web servers.

Did you know?

On a Linux VPS, you connect over SSH with full root access and control the entire server: installing software, editing settings, managing services, and reading logs.

Linux VPS plans

aaPanel commands FAQ

How do I find the aaPanel login address?

Connect to the server over SSH as root and run bt default. The command shows the full panel address, with the port and the security entrance, and the username. Open exactly the address shown, including the http or https at the start and the path at the end. If the page doesn't load, check that the port is open in the server firewall and in your server provider's firewall, and that the panel is running with bt status.

What do I do if I forget my aaPanel password?

Connect to the server over SSH as root and run bt 5. The command asks for a new password and then shows the username and the new password. The username also appears in the output of bt default, and bt 6 changes it. When logins are locked after many failed attempts, bt 33 releases the lock.

What is the aaPanel security entrance, and how do I change it?

The security entrance is a secret path at the end of the panel address, for example /my_panel, and without it the login screen doesn't open. The path is created randomly during installation and limits access to people who know the full address. Change it in the panel settings or with bt 28, and if you've forgotten it, view it with bt default.

How do I update aaPanel or repair the panel?

Usually you update from the panel, with the update button at the top of the home page. When the panel doesn't start or the update fails, connect over SSH as root and run bt 16, which checks the panel files and updates them to the latest version. Take a snapshot of the server before the update, and afterward check the panel status with bt status.

Where are the website logs in aaPanel?

Website logs are in /www/wwwlogs. With Nginx, the access log is example.com.log and the error log is example.com.error.log, and with Apache, the names are example.com-access_log and example.com-error_log. You can also view the logs in the panel, on the Logs page. The log of the panel itself is /www/server/panel/logs/error.log.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement