bryankaraffa/vestacp-admin-scriptsmore_vert Shell Last Updated: 2019-02-19T18:50:06Z

VestaCP Admin Scripts

Developed by Bryan Karaffa

These scripts are meant to automate common workflows for administrators that use VestaCP.


  • You must have Vesta CP installed and running on a server. Instructions for how to do this are available at the Vesta CP website []

  • Scripts are written in bash and must be run on Linux, OS X, or equivalent. You can run them on the remote server if you wanted, but they are designed to be run remotely from any machine.

  • You must have an account created in Vesta with SSH Access (the default admin account is okay)

  • SSH/rsync is used to upload files. You must have SSH Key based authentication configured to prevent being prompted for a password multiple times. I have provided which will configure this automatically (only needs to be done once per account that you will be managing)

How to Use

Step 1: Use git to download/clone the repo


Use git to clone the repo from github

$ git clone

Change directory into the scripts directory

$ cd vestacp-admin-scripts ```

Step 2: Setup SSH Key Authentication [Recommended]

If you haven't already done so, we configuring SSH Key based authentication with the remote server for secure authentication and to prevent being prompted for a password multiple times throughout the scripts.

You can run which will copy your ssh key to the remote server's ~/.ssh/authorized_keys and grant SSH access without a password.

```bash $ ./ Your VestCP username, followed by [ENTER]: admin Your VestaCP hostname, followed by [ENTER]: [setup-ssh-key-authentication] SSH Key added to successfully!


To verify SSH Key authentication was setup successfully, simply try to login to the server using SSH, and you should not be prompted for a password:

```bash $ ssh

Last login: Fri Feb 13 16:20:00 2015 from admin@yourserver:~$ # You've successfully logged into the server ```

When you have the scripts downloaded and SSH Key authentication setup, you are now ready to use the operational scripts!

Operational Scripts NEWDOMAIN [IPADDRESS]

This script will create a new Domain and DB in Vesta CP; download and extract the latest WordPress archive to the public_html directory. The final WordPress configuration is done via a web browser.

bash $ ./ Your VestaCP hostname, followed by [ENTER]: Your VestaCP username, followed by [ENTER]: admin Your VestaCP user password, followed by [ENTER]: [create-wordpress-site] Creating domain via API call [create-wordpress-site] Rebuilding the web configs via API call [create-wordpress-site] Downloading WordPress latest.tar.gz [create-wordpress-site] Unpacking wordpress latest.tar.gz [create-wordpress-site] Uploading wordpress files to ~/web/ [create-wordpress-site] Removing ~/web/ [create-wordpress-site] Creating Database via API call [create-wordpress-site] ******************************************** [create-wordpress-site] MySQL DB Credentials [create-wordpress-site] Database: admin_wp_wordpressyourservercom [create-wordpress-site] Username: admin_wp_wordpre [create-wordpress-site] Password: UuqD+Iji6ZHzN3wZqmV/ww== [create-wordpress-site] ******************************************** [create-wordpress-site] Completed! [create-wordpress-site] You can now visit the website to finish the installation.

Task List (TODOs)

  • [ ] Modularize so that it can be used to deploy other PHP scripts other than WordPress

    ** Scripts to implement **

    • [ ] Simple Machines Forum (SMF)
    • [ ] phpBB
    • [ ] bbPress
    • [ ] phpMyFAQ
    • [ ] DokuWiki
    • [ ] MediaWiki
    • [ ] Tiki Wiki
    • [ ] Geeklog
    • [ ] Joomla
    • [ ] Drupal
    • [ ] SugarCRM
    • [ ] Feng
    • [ ] Magento
    • [ ] Moodle
    • [ ] LimeSurvey
    • [ ] osTicket
    • [ ] Gallery
    • [ ] Coppermine
    • [ ] Zenphoto
    • [ ] Piwigo
    • [ ] Mantis
    • [ ] PHPProjekt
    • [ ] Gregarius
    • [ ] SimplePie
    • [ ] Roundcube
    • [ ] liveSite
    • [ ] BasicPages
    • [ ] concrete5