Plesk CLI commands let you create domains, subscriptions, mail accounts and databases on a Linux VPS without opening the Plesk web interface. Everything below runs through plesk bin over SSH as root, and each step shows what you should see before you move on.
This is an administrator's reference, not a first install. You need a working Plesk installation before any of it applies.
Before you start
- A Linux VPS running Plesk Obsidian (see how to install Plesk on a Linux VPS if you have not set it up yet).
- Root SSH access to the server. Almost every
plesk binutility refuses to run as a non-root user. - Your VPS provider's control panel open in a tab, so you can use the browser console or power controls if an SSH session drops.
- A note of the IP you want new subscriptions bound to. Get it from
ipmanagebelow, not from memory.
Warning: Commands that create subscriptions, mailboxes or databases write to live data. Take a backup first and test on one domain before you run a script across all of them.
Find the right command and check its syntax
The CLI is a set of small utilities under one wrapper. Start by listing them and then reading the help for the one you need.
which plesk
sudo plesk bin --help
sudo plesk bin domain --helpplesk bin --help prints every utility name — domain, subscription, mail, database, extension, php_handler and others. Each of those takes its own --help flag.
Plesk changes option names between versions, so treat your own --help output as the source of truth and check the vendor's documentation when a flag does not behave as described here.
Inspect what is already on the server
Read before you write. These are safe, read-only commands.
sudo plesk bin site --list
sudo plesk bin domain --list
sudo plesk bin domain --info example.com
sudo plesk bin subscription --list
sudo plesk bin service_plan --list
sudo plesk bin ipmanage --listdomain --info is the one you will use most: it returns the hosting type, document root, IP address, PHP handler and status for a single domain. ipmanage --list shows which addresses are available for new subscriptions — copy the exact address from there.
Create and manage subscriptions
A subscription in Plesk bundles a domain, a system user and a service plan. Create it in one command.
sudo plesk bin subscription --create example.com \
-owner admin \
-service-plan "Default Domain" \
-ip 203.0.113.10 \
-login deploy \
-passwd 'ChangeMe-2049'-owneris the Plesk account that owns the subscription, usuallyadmin.-service-planmust match a plan name exactly, including case. Confirm it withservice_plan --list.-loginsets the system user that owns the files under/var/www/vhosts/example.com.-ipis the address fromipmanage --list.
If you only need the domain record without a full subscription, plesk bin domain --create creates it inside an existing subscription. Run plesk bin domain --create --help first, because the required flags differ from subscription --create.
To confirm:
sudo plesk bin domain --info example.comWarning: plesk bin subscription --remove example.com deletes the domain, its databases and its mail. Files under the subscription's directory may go with it. Back up first.
For a walkthrough of the same task in the web interface, including service plans, see create a domain, subscription and service plan in Plesk.
Manage mail accounts
Mailboxes are created per domain. The mail service for that domain has to be enabled first.
sudo plesk bin mail --create info@example.com -passwd 'ChangeMe-2049' -mailbox true
sudo plesk bin mail --list example.com
sudo plesk bin mail --update info@example.com -passwd 'NewPass-2049'-mailbox true creates a real mailbox that stores mail. Without it, you get a forwarder entry with no storage. Password changes through mail --update take effect immediately — no service restart needed.
To remove a mailbox:
sudo plesk bin mail --remove info@example.comWarning: Removing a mailbox deletes its stored messages. Pull anything you need with an IMAP client or an SFTP copy of the maildir first.
Create and drop databases
sudo plesk bin database --list -domain example.com
sudo plesk bin database --create mydb \
-domain example.com \
-type mysql \
-login dbuser \
-passwd 'ChangeMe-2049'-type is mysql or postgresql, depending on what the server has installed. Plesk creates the database and the user together and grants the user rights on that database only.
sudo plesk bin database --remove mydb -domain example.comWarning: database --remove drops the database and its contents with no confirmation prompt. Dump it first with mysqldump — see automating MySQL backups with mysqldump and cron.
Extensions, PHP handlers and repair
sudo plesk bin extension --list
sudo plesk bin php_handler --list
sudo plesk repair all -y
sudo plesk repair web -y
sudo plesk repair mail -yextension --list shows the extension id for everything installed. Some extensions expose their own CLI through Plesk; the exact subcommands come from that extension's own documentation, so do not guess them.
php_handler --list returns the handler ids you can pass to a domain update when you change the PHP version. For the per-domain workflow, see change the PHP version and settings per domain in Plesk.
plesk repair fixes configuration drift — permissions, vhost files, mail settings. Run all when something is broken across the board, and the narrower targets when you know where the problem is.
Check it works
Run these after any change:
sudo plesk bin domain --info example.com | head -20
sudo plesk bin mail --info info@example.com
curl -I http://example.comdomain --info should show the correct IP, document root and PHP handler. mail --info should list the mailbox you created. The curl response should return an HTTP status line rather than a connection error — a 000 code means the vhost is not serving yet.
You can also open the site in a browser and confirm Plesk serves the default page from /var/www/vhosts/example.com/httpdocs.
Troubleshooting
plesk: command not found— Plesk is not installed, or your shell path does not include it. Try the full path/usr/sbin/plesk, and confirm you are root withwhoami.Unable to find service plan— the plan name is case-sensitive or belongs to a different owner. List them withsudo plesk bin service_plan --listand copy the name exactly.Domain name is not validor the domain already exists — a leftover subscription, DNS zone or hosting entry still holds the name. Checksudo plesk bin domain --listand remove the stale record first.- Permission denied writing to
httpdocs— the files are owned by a different system user than the one you passed with-login. Inspect withls -l /var/www/vhosts/example.comand fix ownership, or recreate the subscription user. - Mail creation fails with the mail service disabled — enable the mail service for that domain in the Plesk interface, or check
sudo plesk bin mail --helpfor the flag that toggles it in your version.
Next steps
- Install Plesk on a Linux VPS if you are still setting the panel up.
- Create a domain, subscription and service plan in Plesk for the same tasks in the web interface.
- Install and manage WordPress with the Plesk WordPress Toolkit once your first site is live.
- Give a user sudo access to specific commands only if you want a helper to run a narrow set of
plesk binutilities.
