cPanel Terminal opens a command line on your hosting account inside the browser. It is the same restricted shell you get over SSH, but with no client or keys to set up. It is handy for jobs that are slow or impossible in File Manager, such as extracting a big archive, searching thousands of files or running WP-CLI.
Before you start
- Terminal must be enabled for your account (it uses shell access). If Advanced → Terminal is missing, ask support.
- Commands run with your account's permissions. A wrong
rmcommand deletes files immediately, with no Recycle Bin. Take a backup before big changes.
Open Terminal
- Go to cPanel → Advanced → Terminal.
- The first time, read the warning and click I understand and want to proceed.
- You start in your home directory,
/home/cpuser. Your website's main folder ispublic_html.
Useful commands
| Task | Command |
|---|---|
| Go to the web root | cd ~/public_html |
| List files with sizes | ls -lah |
| Largest folders | du -sh ~/* | sort -h |
| Count files (inodes) | find ~ -type f | wc -l |
| Extract a ZIP | unzip site.zip -d ~/public_html |
| Extract tar.gz | tar -xzf backup.tar.gz |
| Search text in files | grep -rl "old-domain.com" ~/public_html |
| Files changed in last 2 days | find ~/public_html -type f -mtime -2 |
| Fix permissions | find ~/public_html -type d -exec chmod 755 {} \; and find ~/public_html -type f -exec chmod 644 {} \; |
| Import a database | mysql -u cpuser_user -p cpuser_db < dump.sql |
| Export a database | mysqldump -u cpuser_user -p cpuser_db > dump.sql |
WordPress with WP-CLI
WP-CLI is installed on most cPanel servers. Run commands from the WordPress folder:
cd ~/public_html && wp core version && wp plugin list- Update everything:
wp core update && wp plugin update --all && wp theme update --all - Replace a domain safely, including serialized data:
wp search-replace 'http://old.com' 'https://new.com' --skip-columns=guid - Reset an admin password:
wp user update admin --user_pass='NewStrongPass!' - Disable all plugins when the site is broken:
wp plugin deactivate --all
Tip: Long-running commands stop when you close the tab. For large jobs use nohup command &, or schedule them with cron jobs.
Limits of the shell
- No
sudoor root access; you cannot install system packages or restart services. - Processes count toward your CloudLinux CPU and memory limits and are stopped if they exceed them.
- Language versions:
php -vshows the CLI PHP. For a specific version use paths like/opt/cpanel/ea-php83/root/usr/bin/phpor/opt/alt/php83/usr/bin/php.
Troubleshooting
- Terminal does not load: browser extensions or a network proxy may block the WebSocket. Try another browser or network.
- "command not found": the tool is not installed for users, or not in your PATH. Ask support.
- "Permission denied": you are trying to write outside your home directory, or file ownership is wrong; contact support to fix ownership.
