Install WordPress on Raspberry Pi 4 Running 64-Bit OS (beta) Using Docker-Compose

Objective

Run a WordPress website off my RPi 4.

Introduction

WordPress is a very flexible platform for running a blog or other website.  Having control of your own website offers more possibilities and control, maintains privacy, and can save some money.  The downside is that you are not going to be “up” 24/7 and won’t be able to handle high volume traffic. We will use Docker-Compose to build our stack.

Requisites

TBD

Recipe

Create file structure

~/docker/wordpress/

make three files in the wordpress directory

cd wordpress

 

nano mysql_env

nano blog_env

version: ‘3’
services:
wordpress:
container_name: wordpress
image: wordpress
volumes:
– ‘/home/pi/docker/wordpress/html:/var/www/html’
ports:
– ‘9010:80’
env_file:
– blog_env
restart: always
mysql:
container_name: mysql

image: mariadb
command: –transaction-isolation=READ-COMMITTED –binlog-format=ROW
volumes:
– ‘/home/pi/docker/wordpress/data:/var/lib/mysql’
env_file:
– mysql_env
restart: always
volumes:
mysql: null
wordpress: null

sudo docker-compose up -d

update reverse proxy

References

  • Justin Garison, WordPress in Docker on Raspberry Pi, Sept 2016
  • Hungsblog.de, Dockerized WordPress on a Raspberry Pi, 2019 (His blog give great background information and is, in fact, running on a raspberry pi)
  • Cheerful, Raspberry Pi WordPress Blog on Docker, January 2020

 

Leave a Reply

Your email address will not be published. Required fields are marked *

one × five =