1. Connect to your Instance by SSH
Log in to Google Cloud Dashboard, go to Compute Engine -> VM Instances.
Once inside your Compute Engine, click on the SSH button.
2. Check Operating System
Check your OS by pasting the below command in the terminal and make note of the operating system as we need it in the next step. For example Debian 9.9 (stretch).
3. Install Certbot
Go to your web browser and log on to certbot.eff.org. Scroll down and select Apache from the software drop-down, then choose the right operating system.
After choosing your system requirements from the dropdowns, Scroll down the page and copy the command to install Certbot.
Go back to your SSH terminal and Paste your copied command, then press Enter to perform the command.
sudo apt-get install certbot python-certbot-apache -t stretch-backports
5. Generate SSL Certificates
Now that you have Certbot installed, generating the SSL certificates is the next step. Go back to certbot.eff.org and copy the second command.
Return to your SSH terminal and Paste the command to issue an SSL certificate, then press Enter.
sudo certbot --apache
You’ll be prompted with a series of questions and answer the questions according to the figures in the below picture.
Be sure to replace firstname.lastname@example.org with your own email address and naffysmir.com with your own domain name,
6. Restart Apache Server
7. Update WordPress URLs
Log in to your WordPress account, go to Settings > General and replace the http:// with the https://. Then scroll to the page’s bottom and press the Save Changes button.
Congratulation! You have successfully installed an SSL certificate on your WordPress website. If you have any questions feel free to leave a comment below.