In this tutorial, I’ll show you how to configure a free, auto-renewing SSL certificate for a WordPress site that is hosted on Google Cloud Compute Engine using the Google Click-to-Deploy version of WordPress.
If you’re using the Bitnami version of WordPress on GCP, then you can view that SSL certificate configuration tutorial from below link.
Suggested Reading – How To Install Free SSL Certificate For Bitnami WordPress On Google Cloud
Before we start let me tell you some interesting fact about SSL and why it’s so important for your site.
What is SSL?
SSL (Secure Sockets Layer) is an encryption-based Internet security protocol. It’s a block of code on a web server that facilitates encryption between a web server and a web host. It prevents your communication from being intercepted or manipulated by eavesdropping third parties.
Nowadays, SSL is essential for any kind website, even if it doesn’t handle sensitive information like your debit or credit cards details. It also helps to improve your SERP position on the search engine. That’s why having an SSL certificate can be beneficial for your website SEO.
I hope now you got an idea about SSL and its importance. Ok, Now Let’s Get started
Steps to Install and Configure Free SSL Certificate for WordPress on Google Cloud (Click-to-Deploy)
I assumed that you already had done WordPress Installation on Google Cloud platform ( Click-to-deploy ) and also completed Domain Set up and configuration for your site. Ok, Now follow my steps below to Install and Setup a free SSL Certificate for your WordPress Site.
Connect To WordPress Via SSH
Step 1: Log in to your Google Cloud Console dashboard and then go to VM Instances.
Step 2: At the VM Instances page, you will see the SSH option. Now simply click on the SSH button to connect with your WordPress installation.
Check Your Operating System
Step 3: Now you’re connected with your VM instances. You need to place there following command in your terminal section to check your operating system. After running the command, note down your OS name, which is Debian 9.7 (stretch) in this example.
Generate SSL Certificate [ instructions ]
Step 4: Now return to your web browser and then visit – https://certbot.eff.org/ to find your SSL command. You can see an option showing there ” My HTTP website is running Software on System.” You need to select Apache from the Software dropdown and after that, select the correct operating system based on the output from Step 2 – which was Debian 9.7 (stretch) in my case.
Certbot Installation Command
Step 5: After selecting your server and operating system from the dropdowns, scroll down the page and copy the following command from the site to install Certbot.
sudo apt-get install certbot python-certbot-apache -t stretch-backports
Step6: Next, go back to your SSH terminal section and there paste the command that you copied, and then press Enter to execute the command.
SSL Certificate Issuing Command
Step 7: After Certbot installation, the next step is to generate the SSL certificates for your site. So, return to the website – certbot.eff.org and copy the next command.
sudo certbot --apache
Step 8: Now back to again at your SSH terminal and paste the command that you copied in order to generate the SSL certificates then press Enter.
Step 9: Now, after entering the certificate issuing command, you will be prompted with six different questions. Read all the questions carefully and then input your answers, after that press Enter button to complete SSL Configuration.
Check the questions from below image gallery section, and fill them, as I did.
Restart Apache Server
Step 10: After making changes to the file, you need to restart your server for changes to take effect. To do this, copy and paste the following command into your SSH terminal and then press the Enter button to finish the process.
sudo service apache2 restart
You just successfully finished your SSL certificate setup and configuration for your WordPress site on Google Cloud (Click-to-Deploy). If you run into any issues with your SSL Certificates and want to verify that they’re appropriately configured or not then, this SSL Checker tool can help you.
I hope this tutorial helps you to solve your problem. If you face any trouble, then please let me know by commenting below.