@reid

Hosting a nonprofit website for free with WordPress, Azure, Trellis, and Terraform

I open sourced the WordPress stack and Azure web server infrastructure used for awakeningchurch.com.

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.

WordPress stack

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:

We are using Composer to install and update WordPress plugins like these:

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 infrastructure repo contains a Terraform configuration to setup a blue-green deployment of a staging and production servers.

You can get a lot of performance out of a small server with Trellis when using FastCGI caching.

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.

Other infrastructure

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.

What’s next

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.