HestiaCP CLI commands let you create and remove hosting accounts, domains and databases from a shell instead of clicking through the web panel. This guide walks through the v-add-* and v-delete-* scripts you need to script provisioning on a Linux VPS, with the exact syntax and the checks that catch mistakes before they hit production.
The commands are small shell wrappers that live in /usr/local/hestia/bin/. They talk to the same backend as the panel, so anything you create from the CLI shows up in the dashboard immediately.
Before you start
You need:
- A Linux VPS with HestiaCP already installed. If you have not done that yet, follow how to install HestiaCP on a Linux VPS.
- Root access, or a sudo user. The
v-scripts must run as root. - The name of a hosting package that exists on the server. List them with
v-list-user-packages. - A note of what you are about to create. Write the usernames and domains down first so you do not create duplicates.
Warning: v-delete-* commands are immediate and do not ask for confirmation. v-delete-user removes the account, its websites, mail, databases and files. Take a backup first if there is any chance you will need the data.
Open a root shell:
sudo -iIf you prefer to stay as your sudo user, remember that sudo resets PATH, so /usr/local/hestia/bin will not be on it. Call the full path, for example sudo /usr/local/hestia/bin/v-list-users.
How HestiaCP CLI v-add and v-delete commands work
Every command follows the same shape: a verb, a resource and positional arguments.
v-add-<resource> <user> <name> <extra arguments>
v-delete-<resource> <user> <name>The first argument is almost always the hosting user the resource belongs to. Names are case-sensitive. If you get the argument order wrong, the script usually fails with a usage line rather than doing something unexpected, but check the output every time.
Useful discovery commands:
v-list-users
v-list-user-packages
v-list-web-domains deploy
v-list-databases deployCreate a user, domain and database with v-add
Add a hosting user
v-add-user deploy 'StrongPass!23' deploy@example.com defaultThe arguments are username, password, email and package. The package name must already exist on the server. If you leave it out, HestiaCP uses the default package.
Confirm it landed:
v-list-user deployAdd a domain
v-add-domain is the wrapper that creates everything the package allows — web, DNS and mail:
v-add-domain deploy example.comIf you only want a web vhost and no DNS or mail records, use the narrower command:
v-add-web-domain deploy example.comAdd a database
v-add-database deploy appdb deployuser 'DbPass!23' mysqlThe arguments are user, database name, database user, password and type. HestiaCP prefixes the database and database user with the hosting username, so the real names become deploy_appdb and deploy_deployuser. Use those full names in your application config.
Issue a Let's Encrypt certificate
v-add-letsencrypt-domain deploy example.com www.example.comThe domain must already resolve to your server's IP and port 80 must be reachable from the internet. Pass any aliases as extra arguments; check the script header in /usr/local/hestia/bin/v-add-letsencrypt-domain if your release expects a different separator.
Add a cron job for the user
v-add-cron-job deploy '0 3 * * *' 'php /home/deploy/web/example.com/public_html/cron.php'This is handy when you want the same schedule for every account you provision. See schedule tasks with cron on Linux for the time field syntax.
List and check what you created
Before deleting anything, list it. This is the single best habit when working from the CLI.
v-list-web-domains deploy
v-list-databases deploy
v-list-cron-jobs deployTo see the raw config HestiaCP wrote for a domain:
cat /usr/local/hestia/data/users/deploy/web.confRemove resources with v-delete
Delete in the reverse order you created things. Remove the database before the user, and the domain before the user.
v-delete-database deploy appdb
v-delete-domain deploy example.com
v-delete-user deployThe narrower equivalents work the same way:
v-delete-web-domain deploy example.com
v-delete-mail-domain deploy example.com
v-delete-cron-job deploy 1Warning: v-delete-user deletes the home directory, mail, databases and DNS zones for that account. There is no undo. Verify the username with v-list-users before you press Enter, especially if you are looping over a list in a script.
Check it works
- Log in to the HestiaCP dashboard and confirm the user, domain and database appear under the expected account.
- Run
v-list-web-domains deployand check the domain is listed with the status you expect. - Request the site over HTTP:
curl -I http://example.comshould return a response from your server, not a connection error. - Connect to the database with the full prefixed name:
mysql -u deploy_deployuser -p deploy_appdb. - After a delete, re-run the matching
v-list-*command and confirm the entry is gone.
Troubleshooting
Error: user deploy already exists— the username is taken. Runv-list-usersand pick another name, or delete the old account first.Error: package default does not exist— the package name is wrong or was never created. Runv-list-user-packagesand use one of the names it prints.Permission deniedorcommand not found— you are not root, orsudodropped/usr/local/hestia/binfromPATH. Open a root shell withsudo -ior use the full path.- Let's Encrypt validation fails — the domain does not resolve to this server yet, or port 80 is blocked. Check DNS with
dig +short example.comand confirm your firewall allows HTTP. See delete, insert and reorder UFW rules safely if you need to adjust rules. - Database connection refused with the short name — HestiaCP prefixes database and user names with the hosting username. Use
deploy_appdb, notappdb.
Next steps
- Automate provisioning by calling these scripts from a cron job or a config management run: schedule tasks with cron on Linux.
- If you are moving from another panel, compare the workflow with Plesk CLI commands for common admin tasks.
- Restrict which
v-commands a helper account may run with give a user sudo access to specific commands only.
