Plesk commands cheat sheet
Version and updates
-
plesk versionShows the installed Plesk version, the build date, the revision number, and the system architecture.
-
plesk installer install-panel-updatesInstalls only the Plesk updates, within the installed version.
-
plesk installer install-all-updatesInstalls all the updates available for the installed version, including the system components managed through Plesk.
-
plesk listupgradeLists the Plesk versions you can upgrade to from the installed version.
-
plesk checkupgradeDownloads and runs the pre-upgrade check, and shows problems that might hold up the upgrade. Without a version number, the check runs against the latest version, and you can specify a particular version after the command.
Login and server settings
-
plesk loginCreates a one-time login link to the interface as the server administrator. The link works only once and is valid for 24 hours. When you add a username after the command, the link is created for that user.
-
PSA_PASSWORD='NewStrongPass' plesk bin admin --set-admin-password -passwd ''Changes the Plesk administrator's password. Passing the password in the PSA_PASSWORD environment variable, with an empty value for the -passwd option, is safer than writing the password as a parameter in the command.
-
plesk bin server_pref -sShows the current server settings, such as the server name and the system settings.
-
plesk bin server_pref -u -hostname host.example.comChanges the server's hostname set in Plesk. The name must be a fully qualified domain name that points to the server.
Services
-
plesk bin service --listLists the services Plesk manages, with the ID of each service. You use these IDs in the commands below.
-
plesk bin service --status dnsShows whether the service is running. Replace dns with the service ID from the list.
-
plesk bin service --restart dnsRestarts a service. In the same way, --start starts a service and --stop stops it.
-
systemctl restart sw-cp-serverRestarts sw-cp-server, the web server that serves the Plesk interface itself. Useful when the interface doesn't load.
Customers and subscriptions
-
plesk bin customer --create jdoe -name "John Doe" -passwd 'StrongPass' -email jdoe@example.comCreates a customer account with the username jdoe. The username must start with a letter.
-
plesk bin customer --listLists the customers on the server. The plesk bin customer --info jdoe command shows the customer's details.
-
plesk bin subscription --create example.com -owner jdoe -service-plan "Default Domain" -ip 192.0.2.10 -login exampleuser -passwd 'StrongPass'Creates a hosting subscription for a domain, assigns it to a customer and a service plan, and sets an IP address and a system user for file access.
-
plesk bin subscription --listLists the subscriptions on the server. The plesk bin subscription --info example.com command shows the details and settings of a single subscription.
-
plesk bin subscription --webspace-off example.comSuspends a subscription and its websites. The plesk bin subscription --webspace-on example.com command reactivates it.
-
plesk bin subscription --change-owner example.com -owner jdoeMoves a subscription to a different customer. When the subscription's IP address isn't shared with the new owner, add the -map_ip option with a new address.
-
plesk bin subscription --remove example.comCaution: deletes the subscription with its websites, mailboxes, and databases. The deletion can't be undone, so back up the subscription before you run it.
Domains, websites, and DNS
-
plesk bin site --create shop.example.net -webspace-name example.comAdds another domain to an existing subscription. The domain uses the subscription's resources.
-
plesk bin subdomain --create blog -domain example.comCreates the subdomain blog.example.com.
-
plesk bin domalias --create example.net -domain example.comCreates a domain alias: example.net shows the same website as example.com.
-
plesk bin site --suspend example.comSuspends a single website within a subscription. The plesk bin site --on example.com command reactivates it.
-
plesk bin dns --info example.comShows the domain's DNS records, as Plesk manages them.
-
plesk bin dns -a example.com -txt "v=DMARC1; p=none" -domain _dmarcAdds a TXT record for the name _dmarc.example.com. You add other records the same way, for example -a www -ip 192.0.2.10 for an A record.
-
plesk bin mail --create info@example.com -passwd 'StrongPass' -mailbox true -mbox_quota 2GCreates a mailbox with a 2 GB quota. The available units are K, M, G, and T, and the value -1 applies the domain's default quota.
-
plesk bin mail -u info@example.com -mbox_quota 5GChanges the quota of an existing mailbox. With -passwd, you can change the mailbox password too.
-
plesk bin mail --info info@example.comShows a mailbox's settings. The plesk bin mail -l command lists every email account on the server.
-
plesk bin mail -u info@example.com -aliases add:sales,officeAdds aliases to the mailbox, so mail sent to sales@example.com and office@example.com arrives in it.
-
plesk bin mail -u info@example.com -forwarding true -forwarding-addresses add:user@example.netTurns on forwarding of incoming mail to another address.
-
plesk bin mail --remove info@example.comCaution: deletes the mailbox with all its messages.
Databases
-
plesk bin database --create wpdb -domain example.com -type mysqlCreates a new database and assigns it to the domain.
-
plesk bin database --create-dbuser wpuser -passwd 'StrongPass' -domain example.com -server localhost:3306 -database wpdbCreates a user for the wpdb database. With -any-database instead of -database, the user gets access to all the domain's databases.
-
plesk bin database --update-dbuser wpuser -passwd 'NewStrongPass' -server localhost:3306Changes a database user's password. After the change, update the password in the website's configuration file too.
-
plesk dbOpens the MySQL console on the internal Plesk database (psa). Caution: changing data in this database by hand can break the interface.
PHP versions
-
plesk bin php_handler --listLists the installed PHP versions and handlers, with the ID of each one, for example plesk-php83-fpm. The plesk bin php_handler --extension-list -id plesk-php83-fpm command lists the PHP extensions of that version.
-
plesk bin site -u example.com -php_handler_id plesk-php83-fpmChanges a website's PHP version and handler. Take the ID from the output of php_handler --list.
-
/opt/plesk/php/8.3/bin/php -vRuns a specific PHP version from the command line. The /opt/plesk/php directory has a folder for each installed version, and you run scripts with the website's version the same way.
SSL certificates
-
plesk bin certificate --list -domain example.comLists the certificates stored for the domain.
-
plesk bin subscription -u example.com -ssl-redirect trueTurns on a permanent (301) redirect from HTTP to HTTPS for the subscription's main website.
Backup and restore
-
plesk bin pleskbackup --serverBacks up the entire server and saves the backup in the Plesk backup storage.
-
plesk bin pleskbackup --domains-name example.comBacks up a single subscription with all its data. You can specify several subscriptions, separated by spaces.
-
plesk bin pleskbackup --domains-name example.com -output-file /root/example.com.tarExports the backup to a single file at the specified path, for example before a move to another server. The backup is exported to the file and isn't saved in the Plesk backup storage.
-
plesk bin pleskrestore --restore /root/example.com.tar -level domains -filter list:example.comCaution: restores the subscription from the backup file, and the subscription's existing data on the server may be replaced with the data from the backup. Before you restore, check the file with the --check-backup option and back up the current state.
Security, Fail2Ban, and the firewall
-
plesk bin ip_ban --bannedLists the IP addresses that Fail2Ban has blocked.
-
plesk bin ip_ban --unban 203.0.113.5,sshUnblocks a blocked IP address. Specify the address and the name of the rule (jail) that blocked it. The plesk bin ip_ban -j command lists the jails.
-
plesk bin ip_ban --add-trusted 203.0.113.5Adds an IP address to the trusted list, which Fail2Ban doesn't block.
-
plesk ext firewall --export > rules.jsonExports the Plesk firewall rules to a file, for example to copy them to another server. Requires the Firewall extension.
-
plesk ext firewall --import -config /root/rules.json && plesk ext firewall --applyCaution: imports and applies firewall rules from a file. After you apply them, make sure you can still connect over SSH, and confirm from a second SSH connection with plesk ext firewall --confirm within 60 seconds. Without confirmation, the previous settings are restored automatically.
The plesk repair tool
-
plesk repair all -nChecks the Plesk installation and all the services, and shows the problems found without making changes. It's best to run it before any repair.
-
plesk repair all -yCaution: fixes every problem found without asking, and reconfigures some services even when no problem was found in them. On a server with many domains, the run takes a long time and loads the server, so run it during low-traffic hours.
-
plesk repair installationChecks the Plesk installation itself, including file permissions and ownership, when the problem is in the interface and not in one of the services.
-
plesk repair web example.comRebuilds the web server configuration files for a single domain. Without a domain name, the command runs on the server and on all the domains.
-
plesk repair mail example.comReconfigures the mail settings of the domain and of all its mailboxes. You can also specify the address of a single mailbox.
Log locations
-
plesk log panel.logShows the Plesk interface log, /var/log/plesk/panel.log, live, like tail -f. Press Ctrl+C to stop. The --all option shows all the supported logs together.
-
/var/log/sw-cp-server/error_logThe error log of the web server that serves the Plesk interface. Check it when the interface doesn't load.
-
/var/www/vhosts/system/example.com/logs/The log directory of each domain. It holds the Apache error_log and access_ssl_log, and the nginx proxy_error_log and proxy_access_ssl_log.
-
tail -f /var/www/vhosts/system/example.com/logs/error_logShows new website errors live, such as PHP errors, while you reproduce the problem in the browser.
-
plesk log maillogShows the server's mail log live, to check messages that weren't sent or received.
No matching commands.
Before you work with Plesk from the command line
- plesk bin, plesk ext, and plesk sbin: You run the Plesk management tools as root through the plesk command. The plesk bin command runs the public management tools, plesk ext runs extension commands, such as Firewall, and plesk sbin runs internal tools. Each tool shows its options with --help, and plesk help shows general help.
- Passwords: A password written as a -passwd parameter is saved in the command history. With tools that support it, pass the password in the PSA_PASSWORD environment variable and write '' as the value of -passwd.
- Back up before changes: Before you delete, restore, upgrade, or run plesk repair with -y, create a backup with pleskbackup so you can return to the previous state.
- Linux and Windows: The commands on this page are for Plesk on a Linux server. In Plesk for Windows, the tool names and paths are different.
The usernames, domains, IP addresses, and passwords on this page are examples, so replace them with your real values. For an explanation of the records you add to a DNS zone, see DNS record types, and for commands that work with the database itself, see MySQL commands.
On a Linux VPS, you can choose Plesk as the control panel, licensed by the number of sites and installed by our team. You connect over SSH with full root access and run every command on this page directly on the server.
Plesk commands FAQ
How do I log in to Plesk when the administrator password isn't available?
Connect to the server over SSH as root and run plesk login. The command creates a one-time login link that works once and is valid for 24 hours. After you log in to the interface, you can set a new password in the administrator's profile, or change it from the command line with plesk bin admin --set-admin-password.
How do I update Plesk from the command line?
The plesk installer install-panel-updates command installs the Plesk updates within the installed version, and plesk installer install-all-updates installs the system component updates too. Before you move to a new version, run plesk listupgrade to see which versions you can upgrade to, and plesk checkupgrade to check that the server is ready. The plesk version command shows the installed version.
What does plesk repair do, and when should I use it?
The plesk repair command checks Plesk and its services, such as email, the web server, DNS, and databases, and fixes configuration problems. With -n, it only shows the problems it found. With -y, it fixes them without asking, and without an option, it asks before each fix. It's best to start with plesk repair all -n and then run a repair only on the relevant area, for example plesk repair mail or plesk repair web.
How do I unblock an IP address that Fail2Ban blocked in Plesk?
The plesk bin ip_ban --banned command lists the blocked addresses. To unblock an address, run plesk bin ip_ban --unban with the address and the name of the rule (jail) that blocked it, for example plesk bin ip_ban --unban 203.0.113.5,ssh. The plesk bin ip_ban -j command lists the jails. To keep a fixed address, such as your office's, from being blocked, add it to the trusted list with plesk bin ip_ban --add-trusted.
Where are a website's logs in Plesk?
Each domain's logs are in /var/www/vhosts/system/, in a directory named after the domain, under its logs subdirectory. The error_log file collects the website's errors, including PHP errors, and the access files record the requests to the website. The plesk log panel.log command shows the log of the Plesk interface itself.