A robust Docker-based development environment for WordPress, complete with Nginx, PHP-FPM, MariaDB, phpMyAdmin, and a file manager. This setup ensures a seamless and efficient WordPress development experience with all required tools and configurations pre-installed.
- Nginx: Lightweight and fast web server for serving WordPress sites.
- PHP 8.1: Optimized PHP-FPM with essential modules for WordPress.
- MariaDB: Reliable and high-performance database server.
- phpMyAdmin: Web-based database management tool.
- File Manager: Manage files through a lightweight browser-based interface.
- Custom Configurations: Easily customizable with user-defined settings for PHP, Nginx, and MariaDB.
.
├── assets # Resources like themes, plugins, etc.
├── config # Configuration files for PHP, Nginx, and MariaDB.
├── database # Database volumes for MariaDB and phpMyAdmin.
│ ├── filemanager # File manager database.
│ ├── mariadb # MariaDB data directory.
│ └── phpmyadmin # phpMyAdmin configuration.
├── logs # Log files for debugging.
├── nginx # Nginx configuration files.
└── root # WordPress files.
Ensure you have the following installed:
- Docker
- Docker Compose
-
Clone this repository:
git clone https://github.com/BaseMax/docker-wordpress-php.git cd docker-wordpress-php
-
Create a
.env
file with the following variables:NAME=maysub_mydomain_com DOMAIN_NAME=maysub.mydomain.com MARIADB_DATABASE=wordpress MARIADB_USER=wp_user MARIADB_PASSWORD=wp_password MARIADB_ROOT_PASSWORD=root_password FILEMANAGER_USERNAME=myroot FILEMANAGER_PASSWORD=jhdfjgjdfghuhuihuih34ui5hui$?>..,, PORT_HTTP=80 PORT_HTTPS=443 PORT_PHPMYADMIN=8081 PORT_FILEMANAGER=8082
-
Start the containers:
docker-compose up -d or docker-compose down && docker-compose up --build
-
Access the services:
- WordPress: http://localhost
- phpMyAdmin: http://localhost:8081
- File Manager: http://localhost:8082
To stop and remove the containers:
docker-compose down
Edit nginx/site.conf
to customize the Nginx configuration.
Modify config/php.ini
for PHP settings such as memory limits, execution time, and more.
Adjust config/mariadb.cnf
for database-specific configurations.
The file manager is a lightweight web-based file management tool included in this setup. You can access it at http://localhost:8082.
-
Database Connection Issues: Ensure the database credentials in
.env
match your WordPress configuration. -
Permission Issues: Ensure correct ownership and permissions for the
root
directory.sudo chown -R $(id -u):$(id -g) root
-
Log Files: Check the
logs
directory for detailed error messages.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is licensed under the MIT License.
Happy developing with Docker and WordPress!
Copyright 2025, Max Base