Tutorial: Installing VestaCP (cPanel alternative) on Ubuntu 16.04

Installing VestaCP tutorial: the VestaCP logo

VestaCP is another open source hosting control panel that provides a set of features to manage domains, DNS, mail, databases, cron jobs, backups and much more. Compared with other control panels, it’s a very lightweight web hosting control panel that runs smoothly even with very low system specifications.

In this article, We will look at how to install VestaCP and configure its various services in Ubuntu 16.04.

Prerequisites

  • You will require a fresh Ubuntu 16.04 machine with at least 1 GB of RAM.
  • A valid DNS name pointing its A record to the IP address of your Ubuntu machine.

Step 1. Configure FQDN of the host

To change the hostname of your system, use the hostnamectl command. hostnamectl will directly update the kernel about the change in the hostname, and you don’t need to reboot the machine afterward.

$ sudo hostnamectl set-hostname dwijadasdey

Next, edit the file /etc/hosts and add the following line at the end. The format is IP_ADDRESS HOSTNAME.TLD HOSTNAME. This is an example using a domain of mine and a fake IP.

$ sudo vi /etc/hosts
123.456.78.9 dwijadasdey.tk dwijadasdey

Run the command below to restart the network manager and apply these changes:

$ sudo systemctl restart networking

Check the hostname and FQDN of the host:

$ hostname
dwijadasdey
$ hostname -f
dwijadasdey.tk

Now that your FQDN has been set let’s proceed toward the process of installing VestaCP in detail.

Step 2. Install VestaCP

Update the system

Make sure all the packages in the system are up-to-date by issuing the following commands in the terminal:

$ sudo apt-get update
$ sudo apt-get upgrade

Download the VestaCP install script

Next, download the Vesta Control panel install script with the following command and make it executable:

$ curl -O http://vestacp.com/pub/vst-install.sh
$ sudo chmod u+x vst-install.sh

Generate the install command

VestaCP provides an intuitive way to generate the install command. Visit http://vestacp.com/install/, scroll down the page a little bit, and find the Advanced Install Settings section.

enter image description here

Now, judiciously choose the advanced install settings according to your requirements.

  • For Web options, choose nginx + apache if you plan to use a reverse proxy at a later stage.
  • Choose named in the DNS section if you want a DNS server, too. Otherwise, choose No.
  • If you want an extra repository for packages, then select Remi.
  • Type in the FQDN that we configured in Step 1.
  • VestaCP does not provide a file system browser of its own, so choose either vsftpd or proftpd as a FTP server for easy file upload and download.
  • Next is the firewall. You can choose whether to use iptables and fail2ban, iptables only, or no firewall at all. It is advisable to use at least one of the options for a secure system.
  • If you are going to use VestaCP as Shared Web Hosting service then choose File System Quota, to yes. Otherwise, choose no.
  • Provide your email.
  • For the email server, choose Exim + dovecot + SpamAssassin + ClamAV. SpamAssassin will protect the email server from spam. ClamAV will mitigate virus activity in your server but the CPU load on the server will increase significantly.
  • It is always better to choose Softaculous option to yes. This auto-installer will make your life easier by installing scripts in your server with a click.
  • Choose a database from MySQL or PostgreSQL.
  • Finally, choose a password.

After selecting the options that suit you, click the Generate Install Command button. It will generate installation command for you like below:

enter image description here

Running the installation command

Finally, run the install command that you have generated above in the terminal.

$ bash vst-install.sh --nginx yes --apache yes --phpfpm no --named yes --remi no --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin yes --clamav yes --softaculous yes --mysql yes --postgresql no --hostname dwijadasdey.tk --email youremail.com --password Passw0rd!

VestaCP will show you the components it will install. Press ‘Y’ to continue.

 _|      _|  _|_|_|_|    _|_|_|  _|_|_|_|_|    _|_|
 _|      _|  _|        _|            _|      _|    _|
 _|      _|  _|_|_|      _|_|        _|      _|_|_|_|
   _|  _|    _|              _|      _|      _|    _|
     _|      _|_|_|_|  _|_|_|        _|      _|    _|

                                  Vesta Control Panel

Following software will be installed on your system:
   - Nginx Web Server
   - Apache Web Server (as backend)
   - Bind DNS Server
   - Exim mail server + Antivirus Antispam
   - Dovecot POP3/IMAP Server
   - MySQL Database Server
   - Vsftpd FTP Server
   - Softaculous Plugin
   - Iptables Firewall + Fail2Ban


Would you like to continue [y/n]: y

Installation of the above components should take no more than 10 minutes. Once the installation completes successfully, VestaCP will provide you a link, username, and password to login to the panel. VestaCP will also send login details to the email address that you mentioned in the generation of install command earlier.

Congratulations, you have just successfully installed Vesta Control Panel

    https://HOSTNAME.DOMAIN:8083
    username: admin
    password: Passw0rd!

We hope that you enjoy your installation of Vesta. Please feel free to contact us anytime if you have any questions.
Thank you.

--
Sincerely yours
vestacp.com team

Step 3. Configuring VestaCP

Now that you have successfully installed VestaCP in your Ubuntu 16 server, Login to the control panel using the URL https://HOSTNAME.DOMAIN:8083 and credentials provided by VestaCP at the end of the installation. The browser will warn you about the self-signed certificate—you can safely add it to your exception list and proceed with logging to VestaCP.

enter image description here

Changing the admin password

Once logged in successfully, the first thing you want to do is change the admin password. Click the admin link at the top right corner of the dashboard. You can also change other settings through this page.

Configuring services

To view the services that are installed on the server, click the server link from the menu bar (extreme right). All the services will be listed, with the first one being the VestaCP server itself. Hover the mouse over it to restart or configure VestaCP. You can configure, stop, and restart the rest of the services after hovering the mouse over them.

Configuring the firewall

To configure the firewall, click the firewall link from the menu. All the firewall rules created during install time will be listed. You can edit, delete, or suspend them according to your requirements. To add new rules, click the green plus icon and then choose the action, protocol, and port to add it. You will see a confirmation that a new rule was added successfully.

enter image description here

Creating and adding a nameserver

Remember how we selected named as part of VestaCP installation in step 1? We chose that option because we want to create private child nameservers for our VestaCP installation. Nameservers are servers with specialized DNS software installed and are used to handle queries regarding the services running under a given domain name.

By using child nameservers, you’ll have more control over the services you start using VestaCP later on.

First, you need to register your chosen domain name through any domain name registrar, if you haven’t already. SSD Nodes provides domain registration and domain management service at ease through an easy-to-use interface, but you can choose any registrar.

Registering a domain through SSD Nodes"

Once you’ve registered your domain, you need to manage your domain’s DNS settings. More specifically, you need to change which nameservers the domain points to. Please refer to your domain registrar’s documentation or help for more information on the specific procedure for their interface.

No matter which domain registrar you choose, you must change the nameserver settings to point to your domain. Add two nameservers—NS1.DOMAIN.TLD and NS2.DOMAIN.TLD, replacing DOMAIN and TLD with your own.

enter image description here

As an example, in the image above, I registered the domain dwijadasdey.tk and added two nameservers NS1.DWIJADASDEY.TK and NS2.DWIJADASDEY.TK.

Now, head back to your VestaCP installation. Click the User link, hover your mouse over Admin/System Administrator and click edit. Scroll down to change the default nameservers to NS1.DOMAIN.TLD and NS2.DOMAIN.TLD, and then click Save to complete nameserver configuration. In my case, I changed the defaults to NS1.DWIJADASDEY.TK and NS2.DWIJADASDEY.TK.

Adding your domain

To add a new domain, click Web from the menu, followed by green plus symbol. Type in the domain name you want to use, plus any subdomains. In my case, I’m using vps.dwijadasdey.tk.

From the IP address drop-down, select the IP of your VPS. Under the advanced options, provide an alias of the domain (e.g. www.vps.dwijadasdey.tk), enable SSL support, and choose either webalizer or awstats for your web statistics. Under the SSL support option, enable Let’s Encrypt if you aren’t going to use a paid SSL certificated, which is an option available to you.

You can now add your domain by clicking the Add button at the end of the page.

Adding your domain in VestaCP

There will be a confirmation message that your domain was created successfully.

Head over to DNS page and click the edit button over the domain you have just created. Change the template for the BIND9 option to child-ns and SOA to your nameserver (NS1.DOMAIN.TLD) and save it.

Changing the nameserver defaults in VestaCP

Open up your browser of choice and visit the domain you just created. I’m visiting vps.dwijadasdey.tk. You’ll be greeted by the VestaCP welcome page. Congratulations! You’re all set up with VestaCP.

The VestaCP welcome page

You might be interested in installing Softaculous on top of VestaCP so that you can have access to one-click installs for more than 400 apps and services. Check out the Softaculous documentation for more information.

Now’s a good time to read the VestaCP documentation as well for more customization options. Enjoy the terminal-free experience!

A note about tutorials: We encourage our users to try out tutorials, but they aren't fully supported by our team—we can't always provide support when things go wrong. Be sure to check which OS and version it was tested with before you proceed.

If you want a fully managed experience, with dedicated support for any application you might want to run, contact us for more information.

Suggest an update Request an article