I’m an open-source enthusiast and a consumer frustrated by low-quality subscription software bloating the market. So, I’ve wondered for a while how easy it would be to set up a blog using all open-source software with as little cost as possible. By hosting WordPress with Docker, Caddy, and Linux, I’ve found my answer.
Check out Wright Writes, a new blog. It won’t be as flashy as this one. It’s just a demo site; I don’t even intend to use it except maybe to try out different technologies for testing. But it’s the same exact version of WordPress I’m publishing this blog on! Click around to find the other posts. I’ve copied half of my original portfolio piece as a demo post to illustrate that I could replicate this website exactly!
Here’s a summary of the steps required to launch a blog the same way:
- Log into a Linux machine (preferably a virtual machine in the cloud)
- Install Docker and Caddy using the instructions I just linked
- Make a directory with a docker-compose.yml file using the example here as a template (a.k.a. change the usernames and passwords)
- Run “docker-compose up -d” in your directory with the .yml file
- Edit the default Caddyfile (usually with “nano /etc/caddy/Caddyfile”) and uncomment the line that sets up the reverse proxy
- Delete the :80 from the start of the default Caddyfile and replace it with your website’s domain name. (You will need to point the domain to your Linux machine’s IP address)
- Restart Caddy with “systemctl restart caddy”
- Type your domain into your web browser. This will take you to a WordPress login same as any other WordPress hosting site would. You can log in and start blogging!
And that was it! Just install two programs and modify two files.
Alternate Steps
If you want to test this tech stack but don’t own a domain name, just skip step 6 above. For step 8, type “localhost” into your web browser bar on a local VM. Or, type the IP of your cloud computer if you’re on a cloud VM. For security reasons, I do not advise pointing a DNS server to a personal computer’s IP.
Future Directions
With nearly full control over the Linux virtual machine hosting Wright Writes, I can set up other services I find useful there such as backing up the Docker volume that stores the website data. Frankly, other WordPress hosting sites charge too much for a small sized backup.