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-phpCreate a
.envfile with the following variables:NAME=maysub_mydomain_comDOMAIN_NAME=maysub.mydomain.comMARIADB_DATABASE=wordpressMARIADB_USER=wp_userMARIADB_PASSWORD=wp_passwordMARIADB_ROOT_PASSWORD=root_passwordFILEMANAGER_USERNAME=myrootFILEMANAGER_PASSWORD=jhdfjgjdfghuhuihuih34ui5hui$?>..,,PORT_HTTP=80PORT_HTTPS=443PORT_PHPMYADMIN=8081PORT_FILEMANAGER=8082
Start the containers:
docker-compose up -d or docker-compose down && docker-compose up --buildAccess the services:
- WordPress: http://localhost
- phpMyAdmin: http://localhost:8081
- File Manager: http://localhost:8082
To stop and remove the containers:
docker-compose downEdit 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
.envmatch your WordPress configuration.Permission Issues: Ensure correct ownership and permissions for the
rootdirectory.sudo chown -R $(id -u):$(id -g) root
Log Files: Check the
logsdirectory 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