The Ultimate Self-Hosted WordPress Solution
WordPress Stack Manager turns any fresh Ubuntu server into a professional, automated hosting platform in minutes. It completely automates the complexities of Docker, Nginx Proxy Manager (SSL/Routing), and Portainer, giving you a turnkey solution.
🚀 Key Features:
- One-Click Server Provisioning: Turns a blank server into a hosting powerhouse.
- Custom Dashboard: Spin up new isolated WordPress sites in seconds.
- Automated Security: Each site gets its own isolated containers (App, DB, PMA) and dedicated SFTP.
- Zero Configuration: SSL certificates and Reverse Proxy handled via Nginx Proxy Manager.
- High Performance: Pre-configured with Redis Object Cache, PHP OPcache, and tuned MariaDB.
- Portable & Scalable: Modern "Infrastructure as Code" structure using named volumes.
Setup so easy, it feels like magic. Just run one script:
.
├── setup.sh # The main automation script
├── manager/ # The custom Node.js WP Manager
├── sites/ # Directory where WP sites live
│ └── template/ # The master template for new sites
├── portainer/ # Portainer configuration
└── npm/ # Nginx Proxy Manager configuration
- OS: Ubuntu 20.04 or 22.04 LTS (Fresh Install Recommended)
- User: Non-root user with
sudoprivileges (Recommended) - Resources: Minimum 1 vCPU / 2GB RAM
- Ports:
80&443: Web Traffic (NPM)81: Nginx Proxy Manager Admin9000: Portainer3000: Stack Manager UI22xx: SFTP Ports (Auto-assigned starting from 2201)
You can use this repository directly or fork it to your own account if you want to customize the stack.
Run these commands on your VPS to pull the latest version of this manager:
# 1. Clone the repository
git clone https://github.com/cryptooth/WordPress-Stack-Manager.git ~/docker
# 2. Enter the directory
cd ~/docker
# 3. Make script executable
chmod +x setup.sh
# 4. Run the installer
./setup.shIf you want to customize the stack (e.g. default plugins, themes in the template):
- Fork this repository on GitHub.
- Clone your own URL:
git clone https://github.com/YOUR_USERNAME/WordPress-Stack-Manager.git ~/docker - Run setup as above.
IMPORTANT: The default configuration uses insecure passwords. You must change them before using in production.
-
Portainer Password:
- The initial password might be in the container logs.
- Run:
docker logs portainerto find it (if not prompted on first login).
-
Nginx Proxy Manager:
- Follow the on-screen instructions to create your admin account and password.
-
WordPress Stack Manager Password:
- Edit
manager/docker-compose.yml - Change
ADMIN_PASSWORDvalue. - Run
cd ~/docker/manager && docker compose up -dto apply.
- Edit
- Portainer: Exposed on Port
9000. Used for container management. - Nginx Proxy Manager: Exposed on Port
81. Used to route domains to containers. - WP Manager: Exposed on Port
3000(localhost only by default unless tunneled, check docker-compose).- Note: The current
manager/docker-compose.ymlbinds to127.0.0.1:3000. If you want to access it remotely during initial setup, you might need to change it to3000:3000temporarily or use an SSH Tunnel: ssh -L 3000:localhost:3000 user@your-server-ip
- Note: The current
Here is the step-by-step process to launch a new site from scratch.
Before anything else, go to your Domain Registrar (Godaddy, Namecheap, Cloudflare, etc.) and:
- Add an A Record for your domain (e.g.,
example.com). - Point it to your Server's IP Address.
- (Optional) Add a CNAME for
www.
- Open
http://YOUR_SERVER_IP:3000. - Important: This port is open to the world by default.
- Option A (Quick): Use an SSH Tunnel for security (
ssh -L 3000:localhost:3000 user@ip) and access vialocalhost:3000. - Option B (Perm): Add a Host in Nginx Proxy Manager for
manager.yourdomain.compointing towp_managerport3000and add Basic Auth.
- Option A (Quick): Use an SSH Tunnel for security (
- Log in to WordPress Stack Manager.
- Click New Site.
- Enter the domain (e.g.,
example.com) and secure credentials. - Click Deploy.
- Wait for the specific container details to appear (e.g.,
examplecom-wordpress-1). Copy this Hostname.
- Open Nginx Proxy Manager (
http://YOUR_SERVER_IP:81). - Click Proxy Hosts -> Add Proxy Host.
- Details Tab:
- Domain Names:
example.com - Scheme:
http - Forward Hostname / IP:
examplecom-wordpress-1(The one you copied) - Forward Port:
80 - Block Common Exploits: Enable
- Domain Names:
- SSL Tab:
- SSL Certificate: Request a new SSL Certificate
- Force SSL: Enable
- Email: Your email
- Agree to Terms: Enable
- Click Save.
🎉 Success! Your site is now live at https://example.com.
Here are some useful commands for managing your server.
List All Containers (Running & Stopped)
docker ps -aView Container Logs
# Example: Check NPM logs
docker logs nginx-proxy-manager
# Follow logs in real-time
docker logs -f wp_managerRestart a Specific Service
cd ~/docker/manager
docker compose restartStop & Remove a Stack (Destructive!)
If you want to manually delete a site (e.g., mysite.com) completely:
# 1. Stop and remove containers
cd ~/docker/sites/mysite.com
docker compose down
# 2. (Optional) Remove data volumes (Database & WP Files will be lost!)
docker compose down -v