Skip to content

A specialized Docker containerization platform for WordPress, engineered specifically for production environments.

License

Notifications You must be signed in to change notification settings

thachpn165/wp-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Note: This version is currently in beta. The stable version will be released later as WP Docker is undergoing a complete refactoring of its codebase to optimize performance and scalability.


WP Docker

Lightweight, Flexibility & Freedom

Version Docker Support macOS Linux Language Support License


Terminal Menu Interface

Introduction to WP Docker!

WP Docker makes WordPress development a breeze with its easy-to-use container platform that works right from your terminal.

Designed for both beginners and pros, it gives you everything you need to run WordPress smoothly:

  • Currently supports OpenResty (NGINX with Lua), MariaDB, and PHP-FPM
  • Smart resource management: Automatically configures PHP-FPM and MySQL based on your computer's capabilities
  • Quick setup: Gets WordPress running with just a few commands
  • Built-in caching tools: Automatically configures WordPress caching with ready-to-use setups for FastCGI Cache, Redis, WP Super Cache, WP Fastest Cache, and more
  • WP-CLI ready: Run wpdocker wp cli example.ltd <command> to execute any WP-CLI command directly inside your container
  • Enjoy flexible usage through a friendly terminal interface or the convenient wpdocker command lineβ€”whichever works best for you!
  • Safe and secure, as WP Docker uses only official Docker images that are regularly updated (except for OpenResty, which uses my custom-built image to support Brotli compression and the ngx_cache_purge module)

Soon you'll be able to switch between different web servers like OpenResty or Caddy without changing your workflow. This exciting feature is coming in a future update, with the system automatically handling all configuration changes for you.

WP Docker adopts infrastructure-as-code principles to give you complete freedom, so you're never locked into one provider. Your entire WordPress setupβ€”including Linux, PHP, and databaseβ€”runs in containers that you can move anywhere. In the near future, WP Docker will introduce a powerful migration feature that lets you transfer your complete setup to a different server quickly and automaticallyβ€”giving you true portability and freedom to host your WordPress sites wherever you want!

As an open-source project released under the MIT license, you're free to use, modify, and distribute WP Docker for any purpose, whether personal or commercial.

Built to be simple, friendly, and flexible, WP Docker works perfectly on both Mac and Linux computers. Why not give it a try?


Prerequisites

System Requirements

  • It is recommended to have Docker and the Docker Compose plugin installed before install WP Docker
  • Git (for installation and updates)
  • Bash 3.0+ (pre-installed on most Linux distributions and macOS), but Bash 4.0 or later is recommended.
  • At least 1GB of RAM per WordPress site (recommended)

macOS-Specific Requirements

Docker on macOS cannot access folders outside the shared file system list.

After installation, you must add /opt to Docker β†’ Settings β†’ Resources β†’ File Sharing:

Docker File Sharing Documentation


Installation

curl -fsSL https://raw.githubusercontent.com/thachpn165/wp-docker/refs/heads/main/src/install.sh -o install.sh && bash -i install.sh

Usage

Once installed, simply run:

wpdocker menu

This command opens the interactive terminal menu for managing your WordPress sites.

You can also use WP Docker through the wpdocker command. For more information, refer to the instructions with the wpdocker --help command.

Latest Release - v1.2.0-beta

Release date: 2025-04-25

πŸš€ Added

  • PHP Extension Management

    • Added php_install_extensions.sh to support installing PHP extensions (e.g., Ioncube Loader).
    • Enabled imagick by default in PHP config.
    • New menu and CLI interface to handle extension installation.
  • New Bashly CLI

    • Introduced Bashly-powered wpdocker CLI with structured commands and auto-completion.
    • Deprecated individual *.sh wrappers.
  • WordPress Backup Scheduler

    • Created backup cron system with cleaner interface and upload support via Rclone.
  • OpenResty Upgrade

    • Switched to thachpn165/wpdocker-openresty Docker image.
    • Added Brotli and ngx_cache_purge support.
  • SSL Auto-Renewal

    • Integrated certbot renewal using Docker container and cron runner.
    • Renewal logs saved per site.
  • Domain Validation + Safe Curl

    • Added _is_missing_param, safe_curl, and domain validation logic.
    • Improved parameter checking across scripts.
  • Cache Management Enhancements

    • Improved NGINX rules and compatibility with WP Fastest Cache + Redis.
    • Auto-detects optimal cache settings per site.

🐞 Fixed

  • Rclone setup prompt translation (vi).
  • Refined error messages and exit handling in scripts.
  • Consistent use of print_msg, debug_log, and get_input_or_test_value.

♻️ Changed

  • Refactored all CLI menus to support i18n.
  • Updated php.ini template logic for extension inclusion.
  • Centralized site configurations under .config.json.

For complete changelog history, please see CHANGELOG.md


Key Features

WordPress Site Management

  • Create and manage multiple WordPress installations simultaneously
  • Configure PHP versions and its configurations for individual sites
  • Restore WordPress source code and database from backup interactively

Security Features

  • Automatic SSL certificate deployment (Let's Encrypt, custom, or self-signed)
  • Isolated container environments for enhanced security
  • Intergrated firewall configurations through NGINX

Backup and Recovery

  • Execute comprehensive backup solutions with cloud integration (via Rclone)
  • Schedule automated periodic backups through cron functionality
  • Easy to restore website data from backup

Configuration

  • Directly modify configuration files including php.ini and php-fpm.conf
  • Performance optimization tools for NGINX and PHP-FPM
  • Full multilingual support (i18n) for CLI prompts and messages

System Administration

  • Perform complete site removal including containers, files, and SSL certificates
  • Update Docker images and system components
  • Access container shells for advanced troubleshooting
  • Enable global Debug Mode to show internal commands and logs
  • Enable Dev Mode to preview unreleased, under-development features

Advanced Configuration

For advanced users requiring custom configurations, the following files can be modified:

  • config/nginx/: NGINX configuration templates
  • config/php/: PHP version-specific configurations
  • config/mysql/: MySQL server settings

After modifying configuration files, restart the affected services through the system menu.

πŸš€ WP Docker Roadmap (2025)

βœ… Current Version: v1.2.0 (Beta)

The stable version will be released later as WP Docker is undergoing a complete refactoring of its codebase to optimize performance and scalability.

Core Features Completed:

  • Create WordPress websites with Docker
  • PHP version management (ARM compatibility warning included)
  • SSL certificate management (self-signed, Let's Encrypt, manual)
  • Backup system (local + Rclone support)
  • Scheduled automated backups
  • Website restoration (source + database)
  • Integrated firewall configurations through NGINX
  • Auto-update WP-CLI and system version checker
  • Clean command-line interface optimized for macOS and Linux
  • Automatic WordPress Migration (restore data from existing WordPress website in "one-shot")

πŸ—“οΈ Upcoming Milestones

From v1.2.0 to v1.9.0

  • Focus on stabilizing core feature functionalities
  • Add new features: Telegram notification, Fail2ban integration
  • Support configuration for WordPress Multisite

v2.0.0

  • Refactor to support multiple web servers
  • Integrate additional web servers: Caddy Server, OpenLiteSpeed

v3.0.0

  • Cluster support using Docker Swarm

Contributing

Contribution Guidelines

  1. Fork the repository to your personal GitHub account
  2. Create a feature branch from the main branch
  3. Implement your changes, commit them with descriptive messages, and submit a pull request
  4. For comprehensive contribution procedures, please consult our CONTRIBUTING.md documentation

Reporting Issues

  • For bugs or feature requests, please open an issue in the GitHub repository
  • Include detailed information about your environment and steps to reproduce any bugs

License

This project is licensed under the MIT License.


Credits


Acknowledgments

I would like to extend my sincere appreciation to @sonpython for his valuable contributions to this project. My heartfelt thanks also go to my colleagues at AZDIGI: @dotrungquan , @BamBo355 , @phongdh262, and @RakunFatalis for their unwavering support throughout the development process.

Furthermore, I am grateful for the innovative AI tools ChatGPT and Cursor, which significantly enhanced the efficiency and quality of this project.

About

A specialized Docker containerization platform for WordPress, engineered specifically for production environments.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Contributors 2

  •  
  •