How to add domains, subdomains in bulk to VestaCP?

How to add domains, subdomains in bulk to VestaCP?To add domains or subdomains in bulk to the VESTACP panel - you can use the standard Vesta scripts in the folder/usr/local/vesta/bin/. You need to write a bash script that will add your domains in a loop.

1. In the /root/ folder create a file domains.txt with a list of domains or subdomains to be added.

2. Create file in the /root/ folder


for domainname in $(cat domains.txt)
/usr/local/vesta/bin/v-add-domain admin $domainname '' 'no'
echo "$domainname"
echo "-- FINISHED --"

3. If you created files in Windows, and not using server utilities, then you need to convert line breaks in the created files to Unix format

You can use the dos2unix utility under Linux.

yum install dos2unix
dos2unix domains.txt	

4. Run bash script from the /root/ folder


5. Restart VPS