Automated local WordPress environment spawner. Create, configure, and run multiple isolated instances simultaneously with dedicated databases and custom host ports.
A lightweight, automated Bash script to instantly spawn multiple, fully-isolated WordPress environments running concurrently using Docker Compose.
Each generated site runs on its own isolated network pair (WordPress container + dedicated MariaDB instance), utilizing customized container names and dedicated host ports to prevent any infrastructure conflicts.
- True Concurrency: Deploy and run multiple local sites simultaneously without naming or port collisions.
- On-Demand Directory Spawning: Choose exactly where your project folders are generated (supports absolute paths and
~expansion). - Automatic Target Bootstrapping: If the target parent directory doesn't exist, the script creates it dynamically.
- Environment Isolation: Credentials are locked down safely inside local
.envfiles—no hardcoded plain text in your orchestration templates. - Optimized Configurations: Generates a custom
uploads.iniout-of-the-box (512M memory, execution limits) tailored for heavy page builders like Elementor. - Clean Terminal Feedback: Built-in dynamic logging delays to ensure readability during execution.
Ensure you have the following installed on your machine (optimized for Arch Linux / Fish Shell setups):
fish
docker --version
docker compose version
📦 Installation & Setup
1- Clone or copy the setup-generate.sh script to your local system utilities directory.
2- Make the script executable: chmod +x setup-generate.sh
3- Run the generator: ./setup-generate.sh
📖 How It Works
When executed, the script will guide you through a stream of minimal inputs:
Target Directory: Define the parent path (e.g., ~/Projects/WordPress).
Site Name: Used to clean-sanitize folder names, container names (sitename_wordpress / sitename_db), and database schemas.
Local Port: Assign a unique port (e.g., 8081, 8082) to route traffic to that specific instance.
Database Credentials: Isolated user/password combinations written straight to .env.
🎮 Useful Lifecycle Commands
Once your environment structure is generated, navigate into the created project folder to manage your stack:
docker compose up -d
docker ps
docker compose stop
docker compose start
docker compose down
docker compose down -v
Pro Tip for Concurrency: Since the main objective of this generator is to run multiple, fully-isolated WordPress sites at the same time, respecting port allocation is a rule that must be followed strictly.
To prevent network collisions on your host system, always assign a unique, unused local port to each new site instance during the setup prompts.
For example:
site1➡️http://localhost:8081site2➡️http://localhost:8082site3➡️http://localhost:8083