Software runs my life

Tag: compute engine

padlock

Adding a free SSL certificate to Google Compute Engine

Google provides a one click install option for WordPress on their Google Compute Engine instances. This is a very economical and customisable way to spin up a WordPress blog if you’re comfortable with a Debian shell. Unfortunately it only spins up a HTTP rather than secure HTTPS instance, so here’s how to add a free SSL certificate.

Firstly, log into your Cloud console and open an SSH shell for your instance

Google Cloud VM Instance SSH login

Then in the shell, run the following commands as mentioned here:

sudo apt-get install certbot python-certbot-apache

Accept the downloading and installation of some Python packages, then to request and install a new Let’s Encrypt certificate into Apache the :

sudo certbot --apache

It will ask a number of questions such as the server hostname and whether you want to redirect HTTP to HTTPS (you should), then link to the SSL Labs server test to verify your installation.

Finally you can optionally run a dry run renewal, just to make sure it all works:

sudo certbot renew --dry-run

And that’s it!

Wordpress + Google Compute Engine

Migrating WordPress from Dreamhost to Google Cloud

Wordpress + Google Compute Engine

I’ve hosted my WordPress blog on Dreamhost for some years now, as part of a broader hosting package. The decreasing costs of the Cloud have meant that many of the services I used to host have now moved off Dreamhost, and in addition the performance of Dreamhost is quite poor from countries like Australia. Google Cloud now offers a quick deploy WordPress feature and a free tier of Google Compute Engine (IAAS), so I decided to go through the steps of migrating:

  1. Install the Updraft plugin and run the Backup to your Google Drive or other account. Note that the paid version makes this process easier, but is not required.
  2. Signup for a Google Cloud Platform account (if you don’t already have one)
  3. Deploy a new WordPress Single Instance using Cloud Launcher
  4. Ensure you record all the username/password details displayed, including your WordPress admin details
  5. Set your VM to f1-micro (1 vCPU, 0.6 GB memory) to ensure you’re on the free tier (unless you get more traffic than I do)
  6. Log in to your new WordPress instance and use Updraft import to migrate your blog content into the new instance
  7. Create a new External IP address in the Cloud console, making sure you attach it to your recently created VM using the dropdown
  8. Change site url in phpmyadmin
  9. Update your A record in your DNS settings (Dreamhost example) with your domain registrar to point to the new external IP you created in step 7
  10. Test your new site!

Powered by WordPress & Theme by Anders Norén