One-page reference for deploying FlexGate to production.
# AWS (free tier available - 12 months)
./scripts/deployment/deploy-aws.sh production
# Google Cloud ($300 credit available - 90 days)
./scripts/deployment/deploy-gcp.sh production my-project-id
# DigitalOcean (lowest cost - $48/month)
./scripts/deployment/deploy-digitalocean.sh productionDeployment time: 15-20 minutes per provider
- AWS CLI installed (
aws --version) - AWS credentials configured (
aws configure) - SSH key pair created
- IAM permissions (EC2, RDS, ElastiCache, VPC)
- gcloud CLI installed (
gcloud --version) - Authenticated (
gcloud auth login) - Project created (
gcloud projects list) - Billing enabled
- doctl installed (
doctl version) - API token configured (
doctl auth init) - SSH key uploaded to DigitalOcean
| Provider | Startup | Production | Free Tier |
|---|---|---|---|
| AWS | $35/mo | $120/mo | ✅ 12 months |
| GCP | $45/mo | $172/mo | ✅ $300 credit |
| DigitalOcean | $48/mo | $90/mo | ❌ None |
After deployment, you'll have:
flexgate-{provider}-{env}.conf- All credentials, IPs, resource IDsflexgate-{provider}-{env}.json- Ready-to-use FlexGate configuration
AWS:
ssh -i ~/.ssh/flexgate-production.pem ec2-user@YOUR_PUBLIC_IPGCP:
gcloud compute ssh flexgate-vm-production --zone=us-central1-aDigitalOcean:
ssh root@YOUR_DROPLET_IP# AWS
scp -i ~/.ssh/key.pem flexgate-aws-production.json ec2-user@IP:/tmp/
# GCP
gcloud compute scp flexgate-gcp-production.json flexgate-vm:/tmp/ --zone=us-central1-a
# DigitalOcean
scp flexgate-do-production.json root@IP:/tmp/# Import config
flexgate config import /tmp/flexgate-{provider}-production.json
# Test connections
flexgate db test
flexgate redis test
# Check health
flexgate healthcd /opt/flexgate
npm run db:migratesystemctl start flexgate
systemctl enable flexgate
systemctl status flexgate# Health check
curl http://localhost:8080/health
# Metrics
curl http://localhost:9090/metrics
# Logs
journalctl -u flexgate -fProblem: Connection refused or timeout
Solutions:
- Check security group allows SSH (port 22) from your IP
- Verify you're using correct key file
- Check instance is running
Problem: ECONNREFUSED or authentication error
Solutions:
- Run
flexgate config showto verify credentials - Check database security group allows connections
- Verify database is running (check cloud console)
Problem: Service fails to start
Solutions:
- Check logs:
journalctl -u flexgate -n 50 - Verify config:
flexgate config show - Test manually:
cd /opt/flexgate && npm start
| Guide | Location | Purpose |
|---|---|---|
| Deployment Guide | scripts/deployment/README.md |
Complete deployment instructions |
| Cloud Comparison | scripts/deployment/CLOUD_COMPARISON.md |
Choose the right provider |
| Master Index | DEPLOYMENT_CONFIGURATION_INDEX.md |
All documentation links |
| CLI Guide | CLI_JSON_CONFIGURATION_GUIDE.md |
Configure via CLI |
| EC2 Manual | EC2_DEPLOYMENT_GUIDE.md |
Manual deployment steps |
- ✅ Need maximum scalability
- ✅ Want free tier (12 months)
- ✅ Building enterprise product
- ✅ Need most services/integrations
- ✅ Data/ML is important
- ✅ Want best Kubernetes
- ✅ Need global load balancing
- ✅ Building data pipelines
- ✅ MVP/startup phase
- ✅ Cost is top priority
- ✅ Want simplicity
- ✅ Small team
- VPC (10.0.0.0/16)
- EC2 instance (t3.medium)
- RDS PostgreSQL (db.t3.micro, Multi-AZ)
- ElastiCache Redis (cache.t3.micro)
- 3 Security groups
- Internet Gateway
- VPC network
- Compute Engine VM (e2-medium)
- Cloud SQL PostgreSQL (db-f1-micro)
- Cloud Memorystore Redis (1GB)
- Firewall rules
- Cloud SQL Proxy
- VPC network
- Droplet (s-2vcpu-2gb)
- Managed PostgreSQL (db-s-1vcpu-1gb)
- Managed Redis (db-s-1vcpu-1gb)
- Cloud Firewall
After deployment:
- Change default passwords
- Restrict security groups to your IP
- Enable MFA on cloud account
- Set up backup alerts
- Configure monitoring
- Review IAM permissions
- Enable audit logging
- Set up SSL certificate
- Check troubleshooting:
scripts/troubleshooting/README.md - Run health check:
flexgate health - Check logs:
journalctl -u flexgate -f - Review docs:
DEPLOYMENT_CONFIGURATION_INDEX.md - Open GitHub issue
Override defaults before deployment:
# AWS
export AWS_REGION=us-west-2
export INSTANCE_TYPE=t3.large
export DB_INSTANCE_CLASS=db.t3.small
# GCP
export GCP_REGION=europe-west1
export MACHINE_TYPE=e2-standard-2
export DB_TIER=db-g1-small
# DigitalOcean
export DO_REGION=lon1
export DROPLET_SIZE=s-4vcpu-8gb
export DB_SIZE=db-s-2vcpu-4gbAWS:
aws ec2 modify-instance-attribute \
--instance-id i-xxx --instance-type t3.largeGCP:
gcloud compute instances set-machine-type \
flexgate-vm --machine-type e2-standard-2DigitalOcean:
doctl compute droplet-action resize DROPLET_ID \
--size s-4vcpu-8gbDeploy multiple instances and add load balancer:
AWS: Use Auto Scaling Groups + ALB
GCP: Use Managed Instance Groups + Cloud Load Balancing
DigitalOcean: Create multiple droplets + Load Balancer
AWS RDS: Automatic daily backups (7-day retention)
GCP Cloud SQL: Automatic daily backups (configurable)
DigitalOcean: Automatic daily backups (7 days)
# PostgreSQL dump
pg_dump -h DB_HOST -U DB_USER -d DB_NAME > backup.sql
# Upload to S3/GCS/Spaces
aws s3 cp backup.sql s3://my-backups/- EC2 metrics (CPU, memory, network)
- RDS metrics (connections, queries)
- ElastiCache metrics
- VM metrics
- Cloud SQL metrics
- Memorystore metrics
- Droplet metrics
- Database metrics
- Basic alerting
Before going live:
- Deployed to production environment
- Configuration verified
- Database migrations run
- SSL certificate configured
- Domain name pointed to instance
- Monitoring enabled
- Backups verified
- Security hardened
- Load testing completed
- Documentation updated
🚀 You're ready to deploy! Choose a provider above and run the script. 🚀
Questions? See DEPLOYMENT_CONFIGURATION_INDEX.md for complete documentation.
Last Updated: February 9, 2024
Version: 1.0.0