Managing multiple WordPress sites for clients is the bread and butter of many web agencies. Traditionally, this meant using hosting panels like Plesk with its WP Toolkit, but there’s a modern approach that gives you more control and costs nothing in licensing fees: Docker-based hosting with FlatRun.
This guide walks through setting up and managing 20+ client WordPress sites using Docker, from initial setup to ongoing maintenance.
The Traditional Approach vs. Docker
Traditional Hosting Panels
With Plesk or cPanel, you typically get:
- Shared PHP environment
- All sites on the same server resources
- WP Toolkit or similar for one-click installs
- Per-site or per-account licensing costs
This works, but you’re limited by the panel’s capabilities and paying ongoing fees.
Docker-Based Hosting
With Docker and FlatRun:
- Each site runs in isolated containers
- Dedicated resources per client
- Portable configurations (standard docker-compose)
- Zero licensing costs
Let’s set this up.
Prerequisites
You’ll need:
- A Linux server (Ubuntu 22.04 recommended)
- At least 4GB RAM for 10+ sites (8GB+ preferred)
- SSH access with sudo privileges
- Domain names pointed to your server
Step 1: Install FlatRun
See the download page and documentation for installation instructions and requirements.
Step 2: Understanding the Stack
Each WordPress site in FlatRun runs as a stack of containers:
- WordPress container: PHP and WordPress files
- Database container: MySQL or MariaDB
- Optional: Redis: For object caching
- Optional: Nginx: As a reverse proxy
FlatRun’s WordPress template sets this up automatically, but understanding the components helps when troubleshooting.
Step 3: Deploy Your First WordPress Site
- Open your FlatRun dashboard
- Click Create Deployment
- Select the WordPress template
- Configure:
- Domain: client1.example.com
- Database credentials: (auto-generated or custom)
- WordPress admin: Set initial credentials
- Click Deploy
Within 30-60 seconds, you’ll have a running WordPress installation.
What Just Happened?
FlatRun created:
- A docker-compose.yml file defining your stack
- WordPress and MySQL containers
- Persistent volumes for files and database
- Nginx reverse proxy configuration for your domain
The compose file is a standard Docker file you can inspect, modify, or export.
Step 4: Scale to Multiple Sites
Repeat the deployment process for each client site. FlatRun manages the complexity:
- Each site gets isolated containers
- Domains are automatically routed
- SSL certificates are provisioned via Let’s Encrypt
- Resources are tracked per deployment
Resource Allocation
By default, containers share server resources. For critical clients or to prevent one site from affecting others, you can set resource limits in the deployment settings:
services:
wordpress:
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
This prevents any single site from monopolizing your server.
Step 5: Managing Client Databases
FlatRun includes a database manager. For each site, you can:
- Create additional databases
- Manage user permissions
- Run SQL queries
- Import/export data
Access it through the deployment details page → Database tab.
Importing Existing Databases
Migrating from another host? Export your SQL dump and import it:
- Open the deployment’s database manager
- Use the import feature, or
- Use the terminal:
mysql -u root -p database_name < dump.sql
Step 6: File Management
Every deployment includes a file manager. You can:
- Browse the WordPress directory structure
- Edit wp-config.php or other files directly
- Upload plugins/themes via the browser
- Download files for backup
For bulk operations, SFTP into the container volume or use the built-in terminal.
Step 7: Setting Up Staging Environments
Client wants to test changes before going live? Create a staging site:
- Create a new deployment with a staging domain (staging.client.com)
- Copy the production database to staging
- Copy the WordPress files
- Update wp-config.php with staging URLs
Or use FlatRun’s clone feature (if available in your version) to duplicate a deployment instantly.
Syncing Production to Staging
When you need fresh production data on staging:
# Export production database
mysqldump -u user -p production_db > backup.sql
# Import to staging
mysql -u user -p staging_db < backup.sql
# Update URLs in WordPress
wp search-replace 'https://client.com' 'https://staging.client.com' --all-tables
Step 8: SSL Certificate Management
FlatRun automatically provisions Let’s Encrypt certificates. To enable SSL:
- Ensure DNS points to your server
- Enable SSL in deployment settings
- FlatRun handles the rest
Monitor certificate expiration from the dashboard. FlatRun tracks all certificates and alerts you before expiration.
Step 9: Monitoring and Logs
Resource Monitoring
The FlatRun dashboard shows:
- CPU usage per deployment
- Memory consumption
- Disk space
- Network traffic
Use this to identify resource-hungry sites or plan capacity.
Log Access
Real-time log streaming helps debug issues:
- WordPress/PHP errors
- Database errors
- Nginx access logs
Filter, search, and download logs from the deployment details page.
Step 10: Backup Strategy
Docker makes backups straightforward:
Database Backups
# From FlatRun terminal or cron job
mysqldump -u root -p$DB_PASSWORD $DB_NAME > /backups/$(date +%Y%m%d).sql
File Backups
Container volumes are stored on your server’s filesystem. Back them up with your standard server backup solution (rsync, restic, etc.).
Full Stack Export
Export the entire deployment’s docker-compose.yml and volumes for complete portability.
Common Workflows
Adding a New Client Site
- Get domain and hosting requirements
- Deploy WordPress template
- Configure domain in FlatRun
- Update DNS with client
- Enable SSL once DNS propagates
- Hand off to client or begin development
Time: ~5 minutes
WordPress Updates
For individual sites:
- Create backup
- Update via WordPress admin or WP-CLI
- Test functionality
For bulk updates, consider scripting WP-CLI across containers.
Plugin/Theme Installation
Options:
- WordPress admin dashboard (traditional)
- FlatRun file manager (upload zip)
- WP-CLI in container terminal
- SFTP to container volume
Performance Optimization
Each container can be customized. Common optimizations:
PHP Configuration:
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 300
Add Redis Caching: Add Redis container to stack and configure WordPress with a Redis plugin.
Nginx FastCGI Cache: Configure Nginx container for static file caching.
Cost Comparison
Let’s compare managing 20 WordPress sites:
Plesk with WP Toolkit
- Plesk Web Pro: $44.95/month
- WP Toolkit SE: Often included, or $5/month extra
- Annual cost: ~$540-600
FlatRun
- FlatRun: $0
- Server (your cost either way)
- Annual cost: $0
Over three years, that’s $1,600+ saved—enough for a better server or reinvested in your business.
Troubleshooting Common Issues
Site Not Loading
- Check container status in FlatRun dashboard
- Verify Nginx proxy configuration
- Check DNS resolution
- Review container logs for errors
Database Connection Errors
- Verify database container is running
- Check wp-config.php credentials
- Ensure database host is container name (e.g., “db” not “localhost”)
- Check database container logs
Slow Performance
- Check resource usage in dashboard
- Review PHP error logs for warnings
- Consider adding Redis caching
- Evaluate if server needs more resources
SSL Certificate Issues
- Verify DNS points to server
- Check if Let’s Encrypt rate limits apply
- Review certificate logs
- Try re-issuing certificate
Moving Forward
Once you’re comfortable with the basics:
- Automate deployments using FlatRun’s API
- Create custom templates for your standard WordPress stack
- Integrate with your tools via REST API
- Build staging pipelines for client approval workflows
Getting Started
Ready to try this approach?
- Download FlatRun - One command installation
- Deploy a test site - Get comfortable with the interface
- Migrate a low-traffic client - Start small
- Scale up - Move more sites as confidence builds
The Docker-based approach gives you more control, better isolation, and zero licensing costs. It’s how modern infrastructure works—and now it’s accessible for WordPress hosting too.
Questions about managing WordPress with Docker? Check our documentation or open an issue on GitHub.