Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Google Cloud

How to Install VestaCP on Google Cloud | Ubuntu 18.04

by Cloudbooklet
4 years ago
in Google Cloud, Compute Engine
How To Install Vestacp On Google Cloud
ShareTweetSendShare
Readers like you help support Cloudbooklet. When you make a purchase using links on our site, we may earn an affiliate commission.

VestaCP is an open source hosting control panel. VestaCP provides a set of features to manage Domains, DNS, Mail, Databases, Cron Jobs, Backups and many more. In this tutorial, you are going to learn how to install Vesta Control Panel on Google Cloud with Ubuntu 18.04. This setup is tested on Google Cloud Platform, so […]

ADVERTISEMENT

VestaCP is an open source hosting control panel. VestaCP provides a set of features to manage Domains, DNS, Mail, Databases, Cron Jobs, Backups and many more.

In this tutorial, you are going to learn how to install Vesta Control Panel on Google Cloud with Ubuntu 18.04.

This setup is tested on Google Cloud Platform, so this guide can be used on any other cloud hosting services or VPS or Dedicated server running Ubuntu.

ADVERTISEMENT

Create the VM Instance

Go to Compute Engine >> VM Instances and click Create Instance

You might also like

How To Setup Ssh Keys On Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

4 months ago
Draggan Ai Editing Tool Install And Use Draggan Photo Editor

DragGAN AI Editing Tool Install and Use DragGAN Photo Editor

4 months ago

In Name provide a name for your Instance

In Region choose the region closest to your visitors

ADVERTISEMENT

In Machine Type choose 3.75 GB memory 1vCPU

In Boot disk click Change and choose Ubuntu 18.04 LTS. In Size enter your required size, the minimum should be 20 GB and click Select

ADVERTISEMENT

In Firewall check both Allow HTTP traffic and Allow HTTPS traffic

Click Create

ADVERTISEMENT

It will take a while before the VM instance will be available for you.

Reserve your IP address

If your IP address has a valid license you can proceed to reserve your IP address by going to VPC Networks >> External IP Addresses reserve your IP address to Static.

ADVERTISEMENT

Setup Cloud DNS

Please follow this guide to setup Cloud DNS and point your domain to Google Cloud.

Once you have created DNS Zone, you need to create one additional A record for VestaCP subdomain in your Cloud DNS.

Click Add record set

In Name enter panel

Select Resource Record Type to "A"

IPv4 Address with the IP address of your instance that you have reserved earlier.

Leave everything to default.

Click Create.

Setup Firewall rules

VestaCP uses a custom port to manage the server, so you need to create a firewall to provide access to this port.

Go to VPC Network >> Firewall rules and click Create Firewall rules.

In Name enter vestacp

In Targets select All instances in the network

In Source filter select IP ranges

In Source IP ranges enter 0.0.0.0/0

In Protocols and ports check TCP and enter 8083

Click Create.

Connect your VM Instance

Go to Compute Engine >> VM Instances and click the SSH button right next to your instance to open the terminal window in the browser.

Set up Hostname in Google Cloud

Google Compute Engine won’t preserve the hostname (panel.yourdomainname.com) you set and changes it to default hostname automatically. To preserve the hostname follow the below simple steps.

cd /etc/dhcp/dhclient-exit-hooks.d/
sudo nano set-hostname.sh

Paste the following contents and hit Ctrl+X followed by Y to save the filter. Remember to replace yourdomainname.com with your domain name

#!/bin/sh
hostname panel.yourdomainname.com
/scripts/fixetchosts

Set correct permissions to the file you created

chmod 744 set-hostname.sh

Now you are ready to install VestaCP on Google Cloud.

Generate Install Command

Before installation go to VestaCP website and generate the installation command.

Scroll down to Advanced Install Settings and select the following.

  • In Web select nginx + apache
  • In FTP select vsftpd
  • In DNS select named
  • In Firewall select iptables + fail2ban
  • If you need Softaculous select yes
  • In DB select MySQL
  • In Hostname enter panel.yourdomainname.com
  • In Email enter your email address
  • In Password enter your admin login password

Click Generate Install Command.

Install VestaCP on Google Cloud

Update your server and download the installation script.

sudo su
sudo apt update
sudo apt upgrade
cd /tmp
curl -O http://vestacp.com/pub/vst-install.sh

Now paste the generated command with the -f at the last to force install VestaCP.

If you don’t use the -f appended you will receive an error similar to this.

Please remove admin user account before proceeding.

Execute the command with the -f option. So, The command looks similar to the one below.

bash vst-install.sh --nginx yes --apache yes --phpfpm no --named yes --remi yes --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 panel.yourdomainname.com --email [email protected] --password your_password -f
Install Vesta Control Panel

Once the installation is completed you will be greeted with the login credentials

Congratulations, you have just successfully installed Vesta Control Panel

https://panel.yourdomainname.com:8083
username: admin
password: your_password

Verify the Installation

Now, go to your web browser and visit your Vesta Control Panel by typing the URL (https://panel.yourdomainname.com:8083).

Here you will get a warning of insecure website, just proceeed to the website. We will install SSL certificate later to fix this issue.

Verify Vesta Control Panel Installation

Now login to your dashboard with the username and your password.

Install FREE SSL Certificate

Go to WEB section and hit EDIT which will show when you hover the mouse on hostname/subdomain.

Under Aliases remove everything from the box.

Navigate below You’ll see “SSL Support” checkbox mentioned at the bottom, check the box and select/check “Let’s Encrypt Support“

Click Save.

Set Up Cronjob

Create a cronjob to check the certificate daily and installs them if changed.

nano /etc/cron.daily/vestassl

Paste the following lines.

#!/bin/bash

cert_src="/home/admin/conf/web/ssl.panel.yourdomainname.com.pem"
key_src="/home/admin/conf/web/ssl.panel.yourdomainname.com.key"
cert_dst="/usr/local/vesta/ssl/certificate.crt"
key_dst="/usr/local/vesta/ssl/certificate.key"

if ! cmp -s $cert_dst $cert_src
then
        # Copy Certificate
        cp $cert_src $cert_dst

        #Copy Keyfile
        cp $key_src $key_dst

        #Change Permission
        chown root:mail $cert_dst
        chown root:mail $key_dst

        #Restart Services
        service vesta restart &> /dev/null
        service exim4 restart &> /dev/null
        service dovecot restart &> /dev/null
fi

Hit Ctrl+X followed by Y and Enter to Save and Exit.

Set up correct permissions.

chmod +x /etc/cron.daily/vestassl

Restart VestaCP Services

Once done, you can start the cronjob and restart the services to apply the changes of SSL Installation.

sh /etc/cron.daily/vestassl

You can also restart the services using the below comands.

service vesta restart
service exim4 restart
service dovecot restart

Now close the existing VestaCP tab in your browser and login again you will have your SSL certificate installed successfully.

Conclusion

Now you have learned how to install Vesta Control panel on Ubuntu 18.04 in Google Cloud.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: Compute EnginecPanelGoogle Cloud PlatformUbuntu 18.04
ShareTweetSendShare
Cloudbooklet

Cloudbooklet

Comments 10

  1. Avatar Of Jose Ronald Condori Paredes jose ronald condori paredes says:
    3 years ago

    hola al momento de querer instalar el ssl me sale el error: → Error: Let’s Encrypt validation status 400

    Reply
  2. Avatar Of David David says:
    4 years ago

    installation ok but I can’t send email, I send but not reach the destination, need to unify ssl with a wildcard?

    Reply
    • Avatar Of Cloudbooklet Cloudbooklet says:
      4 years ago

      Google cloud blocks the standard email port 25, so mails cannot be sent. You need to configure third party email services like Sendgrid, Mailgun, etc

      Reply
      • Avatar Of David David says:
        4 years ago

        I got it, thank you!
        but why not install directly to the base domain? example.com

        Reply
  3. Avatar Of Sc Sc says:
    4 years ago

    When I run ‘sh /etc/cron.daily/vestassl’ to restart vesta I get the following error

    /etc/cron.daily/vestassl: 1: /etc/cron.daily/vestassl: !/bin/bash: not found
    root@cp:/home/acn_shawnc_gmail_com# !/bin/bash
    bash: !/bin/bash: event not found

    Reply
    • Avatar Of David Wampamba David Wampamba says:
      3 years ago

      You need to add # so that it can be #!/bin/bash

      Reply
      • Avatar Of Cloudbooklet Cloudbooklet says:
        3 years ago

        Thanks for pointing out, updated

        Reply
  4. Avatar Of Mohommed Shariqq mohommed shariqq says:
    4 years ago

    ok i got, but what if i need to add more websites, should i need to create more zones in cloud dns?

    Reply
    • Avatar Of Cloudbooklet CloudBooklet says:
      4 years ago

      You just add domains in Vestacp and at your domain registrar create hostnames pointing to the External IP address and use them as custom nameservers.

      Reply
      • Avatar Of Mohommed Shariqq mohommed shariqq says:
        4 years ago

        Ok, Thank you very much for replying, I thought you will ignore this, I’m a newbie in cloud.

        Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

Set Up Deep Learning With Nvidia, Cuda, Cudnn On Ubuntu

How to Set Up Deep Learning with Nvidia, CUDA, cuDNN on Ubuntu 22.04

7 months ago
How To Install Or Upgrade Php 8.2 On Ubuntu 22.04

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

9 months ago
How To Change Timezone On Ubuntu 22.04

How to Change Timezone on Ubuntu 22.04

1 year ago
How To Install Ansible On Ubuntu 22.04

How to Install Ansible on Ubuntu 22.04

1 year ago

Follow Us

Trending Articles

Chatgpt To Translate

How to Use ChatGPT to Translate Your Website or Blog

September 20, 2023

10 Best AI Song Generator in 2023 (Free and Paid)

5 Best Fantasy Minecraft Servers in 2023

Top 10 Advantages of a Cloud VPS Server

AI Statistics and Trends: What You Need to Know in 2023

How to See all my Birthday Posts on Facebook

Popular Articles

Ai Presentation Maker

Top 10 AI Presentation Maker: Easy Way to Create Stunning Presentations

September 15, 2023

7 Best AI Video Editor Tools for Creating Amazing Videos

TinyLlama: A 1.1B Parameter Language Model Pre-trained on 3 Trillion Tokens

10 Best AI Summarizer Tools in 2023: A Review and Comparison

10 Best Free AI Porn Generators in 2023

Top 10 Remove Object from Photo Tools and Apps Online Free

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.