Quick Start Guide – Automated WordPress Deployment
This guide shows you how to use the fully automated WordPress deployment system that requires NO manual setup.
Deployment Targets
You can deploy to:
- Local LAMP server – For development and testing (see LOCAL-DEPLOYMENT.md)
- Remote LAMP server – For staging and production (this guide)
Both use the same automation scripts!
What Gets Automated
✓ WordPress installation (no browser wizard!)
✓ Database creation
✓ Theme activation
✓ Initial content generation
✓ Deployment tracking
✓ Content syncing between local and remote
✓ Automatic updates to status-site when changes happen
Prerequisites
One-Time Setup
- Install WP-CLI (WordPress Command Line Interface):
# Install locally
./scripts/utils/install-wpcli.sh local
Install on remote server
./scripts/utils/install-wpcli.sh remote 192.168.1.91 YOUR_USERNAME
Replace YOUR_USERNAME with your SSH username (e.g., milos).
- Configure SSH key authentication (recommended):
ssh-keygen -t rsa -b 4096
ssh-copy-id [email protected]
- Update site configuration for remote URL:
# Edit config/sites/status-site.json
Change dev.siteUrl to: "http://192.168.1.91/status-site-dev"
Or use this command:
sed -i 's|"siteUrl": "http://localhost:8000"|"siteUrl": "http://192.168.1.91/status-site-dev"|' config/sites/status-site.json
Deploy Status-Site (Fully Automated!)
Single Command Deployment
./scripts/deploy/deploy-automated.sh status-site dev remote 192.168.1.91 YOUR_USERNAME
This ONE command does everything:
- ✓ Creates database
- ✓ Downloads and installs WordPress
- ✓ Configures wp-config.php
- ✓ Runs WordPress installation (no browser!)
- ✓ Activates your theme
- ✓ Generates initial content from project data
- ✓ Sets up pages and posts automatically
No manual clicking required!
Configure Apache
After deployment, SSH to your remote server and configure Apache:
ssh [email protected]
sudo nano /etc/apache2/sites-available/000-default.conf
Add this inside the block:
Alias /status-site-dev /var/www/html/status-site-dev
<Directory /var/www/html/status-site-dev>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Reload Apache:
sudo systemctl reload apache2
Access Your Site
Visit: http://192.168.1.91/status-site-dev
Login credentials are saved in:
logs/credentials-status-site-dev.txt
Automated Content Generation
The status-site automatically creates content from your project data:
- Sites Page: Lists all sites from
config/sites/*.json - Features Page: Tracks features being developed
- Deployments Page: Logs all deployments
- Blog Posts: Automatically created for each deployment
Content stays in sync with your project!
Sync Content Between Local and Remote
Pull from Remote (Remote → Local)
# Sync database
./scripts/sync/sync-database.sh status-site dev pull 192.168.1.91 YOUR_USERNAME
Sync uploads (images, files)
./scripts/sync/sync-uploads.sh status-site dev pull 192.168.1.91 YOUR_USERNAME
Push to Remote (Local → Remote)
# Sync database
./scripts/sync/sync-database.sh status-site dev push 192.168.1.91 YOUR_USERNAME
Sync uploads
./scripts/sync/sync-uploads.sh status-site dev push 192.168.1.91 YOUR_USERNAME
The sync scripts automatically:
- ✓ Backup databases before syncing
- ✓ Update URLs (localhost ↔ remote IP)
- ✓ Preserve file permissions
- ✓ Log all operations
Complete Workflow Example
1. Create a New Site
# Create site configuration
node scripts/content/add-site.js
Enter details:
- Site ID:
my-blog - Site Name:
My Personal Blog - Description:
A blog about technology - Theme: (press Enter for default)
- Dev URL:
http://192.168.1.91/my-blog-dev
2. Deploy Automatically
./scripts/deploy/deploy-automated.sh my-blog dev remote 192.168.1.91 YOUR_USERNAME
Done! WordPress is installed, theme activated, content generated.
3. Work Locally
# Pull content from remote to work locally
./scripts/sync/sync-database.sh my-blog dev pull 192.168.1.91 YOUR_USERNAME
Make changes in WordPress admin locally...
Push changes back to remote
./scripts/sync/sync-database.sh my-blog dev push 192.168.1.91 YOUR_USERNAME
4. Add Features Programmatically
# Add a feature (this will update status-site automatically)
node scripts/content/add-feature.js my-blog "User authentication system"
Update status-site to show the new feature
./scripts/content/update-wp-content.sh status-site dev 192.168.1.91 YOUR_USERNAME
How Status-Site Tracks Changes
The status-site automatically monitors and displays:
- New Deployments: When you run
deploy-automated.sh, it logs the deployment and creates a post on status-site
- New Features: When you add features with
add-feature.js, status-site is updated
- Site List: Automatically reads from
config/sites/*.jsonand displays all active sites
- Real-time Updates: Run
update-wp-content.shanytime to refresh status-site content from project data
Manual Edits via WordPress Admin
You can still use WordPress admin normally:
- Visit:
http://192.168.1.91/status-site-dev/wp-admin - Login with credentials from
logs/credentials-status-site-dev.txt - Add/edit posts, pages, upload media
- Sync changes to local:
./scripts/sync/sync-database.sh status-site dev pull
Advanced: Multiple Environments
Deploy the same site to dev, staging, and production:
# Development
./scripts/deploy/deploy-automated.sh my-site dev remote 192.168.1.91 YOUR_USERNAME
Staging
./scripts/deploy/deploy-automated.sh my-site staging remote 192.168.1.91 YOUR_USERNAME
Production
./scripts/deploy/deploy-automated.sh my-site production remote 192.168.1.91 YOUR_USERNAME
Sync content: dev → staging → production
./scripts/sync/sync-database.sh my-site dev pull # Get from dev
./scripts/sync/sync-database.sh my-site staging push # Push to staging
Command Reference
Deployment
# Automated deployment
./scripts/deploy/deploy-automated.sh <site-id> <env> remote <host> <user>
Manual steps (if needed)
./scripts/deploy/create-database-remote.sh <site-id> <env> <host> <user>
./scripts/deploy/auto-deploy-remote.sh <site-id> <env> <host> <user>
Sync
# Database sync
./scripts/sync/sync-database.sh <site-id> <env> pull|push <host> <user>
Uploads sync
./scripts/sync/sync-uploads.sh <site-id> <env> pull|push <host> <user>
Content Management
# Create site
node scripts/content/add-site.js
Add feature
node scripts/content/add-feature.js <site-id> "Feature name"
Update status-site content from project data
./scripts/content/update-wp-content.sh status-site dev <host> <user>
Generate fresh content
./scripts/content/generate-wp-content.sh <site-id> <env> <host> <user> <wp-path>
Troubleshooting
WP-CLI not found
# Install WP-CLI
./scripts/utils/install-wpcli.sh remote 192.168.1.91 YOUR_USERNAME
Permission denied errors
# On remote server
ssh [email protected]
sudo chown -R www-data:www-data /var/www/html/status-site-dev
Database sync fails
Check credentials in config/sites/:
cat config/sites/status-site.json | grep -A 5 '"dev"'
Content not updating
Manually trigger update:
./scripts/content/update-wp-content.sh status-site dev 192.168.1.91 YOUR_USERNAME
Architecture
This system uses:
- WP-CLI: For headless WordPress installation and management
- rsync: For efficient file syncing
- mysqldump: For database backups and syncing
- SSH: For secure remote operations
- JSON configs: For site and project configuration
- Bash + Node.js: For automation scripts
Benefits
✓ No manual setup: Everything is automated
✓ Reproducible: Deploy identical sites easily
✓ Trackable: All changes logged and visible
✓ Syncable: Work locally or remotely seamlessly
✓ Programmatic: Control WordPress via scripts
✓ Status tracking: Automatic monitoring of all sites
Next Steps
- Deploy status-site with automated deployment
- Add more sites and features
- Set up automated backups with cron
- Create custom content generation scripts
- Integrate with CI/CD for continuous deployment
Welcome to fully automated WordPress site management! 🚀
Leave a Reply