Skip to content

Repository files navigation

Docker WordPress PHP

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.

Features

  • 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.

Project Structure

.
├── 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.

Getting Started

Prerequisites

Ensure you have the following installed:

  • Docker
  • Docker Compose

Setup

  1. Clone this repository:

    git clone https://github.com/BaseMax/docker-wordpress-php.git
    cd docker-wordpress-php
  2. Create a .env file 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
  3. Start the containers:

    docker-compose up -d
    or
    docker-compose down && docker-compose up --build
  4. Access the services:

Stopping the Containers

To stop and remove the containers:

docker-compose down

Customization

Nginx

Edit nginx/site.conf to customize the Nginx configuration.

PHP

Modify config/php.ini for PHP settings such as memory limits, execution time, and more.

MariaDB

Adjust config/mariadb.cnf for database-specific configurations.

File Manager

The file manager is a lightweight web-based file management tool included in this setup. You can access it at http://localhost:8082.

Troubleshooting

  • 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

Contributions are welcome! Please feel free to submit a pull request or open an issue.

License

This project is licensed under the MIT License.


Happy developing with Docker and WordPress!

Copyright 2025, Max Base

About

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.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages