This project provides a complete WordPress environment using Docker containers, including a backup routine and SSL/TLS certificate support. It's designed to be simple to set up and manage.
- 🌐 WordPress container (using Bitnami image)
- 🗄️ Database container (using MariaDB)
- 💾 Backup container (for managing WordPress and database backups)
- 🔒 SSL/TLS support containers:
- nginx-web
- nginx-gen
- nginx-letsencrypt
SSL/TLS support is based on docker-letsencrypt.
- 🐧 Linux Ubuntu (tested on 18.04.2 LTS)
- 🐳 Docker (tested with version 18.09.6)
- 🐙 Docker Compose (tested with version 1.21.2)
Note: Also works on macOS, and potentially on Windows (untested).
-
Clone the repository:
git clone https://github.com/cleitonsouza01/docker-wordpress
-
Set up the environment:
cd docker-wordpress cp .env-sample .env vim .env # Customize as needed
-
Set up and start containers:
./manager.sh setupcontainers ./manager.sh setupdir ./manager.sh startverbose
-
After initial setup, use daemon mode:
./manager.sh start
-
Access your WordPress site:
http://your-server-ip:port-specified-in-.env
-
Configure docker-letsencrypt:
cd docker-letsencrypt cp .env.sample .env cd ..
-
Update your DNS records with your server IP.
-
Restart the infrastructure:
./manager.sh stop ./manager.sh startnginx ./manager.sh start
- ⏰ Daily backups run at 3:00 AM.
- 🔄 Manual backup:
docker exec yourproject_bkp backup
- 🔙 Restore from backup:
docker exec yourproject_bkp restore YYYYMMDD
If encountering DB container errors on macOS, try:
rm -rf data
mkdir -p data/wordpress_data/
mkdir -p data/mariadb_data/
manager.sh
: Main management scriptdocker-compose.yaml
: Docker Compose configuration.env
: Environment variablesdata/
: WordPress and MariaDB databackups/
: Backup files
- Let's Encrypt for free SSL/TLS certificates
- WordPress: 6.6.1-debian-12-r5
- MariaDB: 11.4.2-debian-12-r2
Contributions are welcome! Please feel free to submit a Pull Request.
Cleiton Souza - cleitonsouza01@gmail.com