Deploy WordPress on GCP Cloud Run
Production-ready WordPress deployment in 30 minutes.
Prerequisites
Deployment Steps
1. Clone Repository
git clone https://github.com/tohidsmart/serverless-wordpress-gcp.git
cd serverless-wordpress-gcp
2. Authenticate
gcloud auth application-default login
3. Deploy Everything
./scripts/end-to-end-deploy.sh YOUR_PROJECT_ID
Deployment time: ~30 minutes
4. Access WordPress
# Get URL
terraform output wordpress_url
# Get admin password
terraform output wordpress_admin_password
Visit: https://your-service-xxxxx.run.app/wp-admin
What Gets Deployed
Cloud Run
Serverless WordPress container with auto-scaling
Cloud SQL
Private MySQL database with automated backups
Cloud Storage
Object storage for media files and uploads
VPC Network
Private networking with Cloud NAT
Secret Manager
Encrypted storage for passwords and credentials
Artifact Registry
Container image storage and versioning
Troubleshooting
Issue: Permission denied
Fix: Run gcloud auth application-default login
Issue: Terraform state error
Fix: Delete the state bucket and re-run deployment
Issue: Cloud SQL connection fails
Fix: Wait 2-3 minutes for database initialization to complete
Issue: Docker build fails
Fix: Ensure Docker is running: docker ps
Next Steps
Video Walkthrough
Watch the complete deployment process (1:20 video, actual deployment ~20 minutes):
See the automated infrastructure deployment, WordPress container build,
and live site in under 20 minutes.
Need Help?