Azure can host WordPress at no cost because Microsoft offers $3,500 a year in Azure credits for nonprofits. You only need about $360 of these credits to serve a simple website with a staging and production servers.
The WordPress repo is a combination of Trellis and Bedrock which provide server provisioning and dependency management powered by Ansible and Composer. You can manage it all with the simple Trellis CLI.
Inside you will find:
- Jenner, a theme for WordPress customized to provide teaching, event, and leader profile custom post types
- Clean up plugin for the admin dashboard and for hiding password protected posts
- A bit of custom nginx configuration
- Server for legacy content on media.awakeningchurch.com
- Database push and pull adapted from trellis-simple-sync
- Trellis Cloudflare Origin CA
We are using Composer to install and update WordPress plugins like these:
- Authorizer for G Workspace SSO
- Azure Storage for media upload storage
- The SEO Framework which is a nice SEO plugin and very fast
- ESV CrossRef for automatic ESV references
- WP Dashboard Notes to leave notes on the dashboard for other admins
- Matomo for private first-party analytics
- Matomo Google Analytics Importer to import our previous analytics
Some custom plugins we developed for custom post types like teaching and events are not yet open source. We are moving from Azure DevOps to GitHub for hosting repositories and these plugins will make the move soon.
Infrastructure with Terraform
The setup is simple: a single Standard B1s server and a Premium SSD P4 32 GB for each environment. This costs about $30/month for two servers with one per environment. We only use about $360 of our $3,500 credits so the hosting is free.
We also use Azure storage for storing WordPress uploads and the Azure CDN for delivering uploaded assets. Uploads and CDN URLs are handled by the Azure Storage Plugin. Costs are minimal and there are plenty of left over credits to spend.
This storage infrastructure is not included in our web Terraform infrastructure because it was created long ago.
As I need to recreate servers to upgrade them, I plan to extend the Terraform repo to include a wrapper stack to switch Cloudflare DNS to new servers. I do DNS changes manually for now.
Self-hosting is great
I hope this example of hosting a WordPress website will help you in creating websites of your own.
Nonprofits with nerds on staff (or volunteering) can make use of the $3,500 in Azure credit to make their website hosting free.
I believe owning your web presence is important. Most folks can grab a domain and pay a provider to host WordPress. Since you control your site’s data, you can easily grow your site later and have hundreds of hosting options, plugins, and themes to build your site.
And if you are comfortable on the command line, you can use the Trellis CLI to create a new WordPress installation and start a $5 DigitalOcean droplet which is more than powerful enough to host most websites. You can locally develop your changes and deploy them to your production site with little effort.
Getting started looks something like this:
brew install roots/tap/trellis-cli vagrant virtualbox trellis new example.com trellis up
This very site uses Trellis. I host several more websites using similar tools which makes self-hosting WordPress much easier.
WordPress block editing has made WordPress into a very flexible tool for content. I recommend you try WordPress out if you haven’t used it in a while — it’s good.