Deploy Latest Redash on AWS ECS with PostgreSQL and Redis
This guide walks through deploying the latest version of Redash using AWS ECS Fargate, RDS PostgreSQL, and Redis containers — creating a modern, scalable analytics environment separate from existing production systems.
Prerequisites
- AWS Account with appropriate permissions
- Access to ECS, RDS, VPC, and IAM services
- Basic understanding of containerized applications
What We'll Create
- RDS PostgreSQL database for Redash metadata
- ECS Fargate cluster for container orchestration
- Multi-container task with Redash + Redis
- Security groups for proper network access
- Latest Redash version via Docker
Phase 1: Create RDS Database
Step 1: Database Creation
- Go to RDS Console → Create database
- Select "Standard create"
- Choose PostgreSQL (not Aurora — too expensive for analysis environment)
- Select "Free tier" or "Dev/Test" template
Step 2: Database Configuration
| Setting | Value |
|---|---|
| DB instance identifier | redash-analysis-db |
| Master username | redash |
| Master password | Create strong password and save it |
| DB instance class | db.t3.medium or db.t3.small |
Step 3: Storage Settings
- Storage type: General Purpose SSD (gp3)
- Allocated storage: 100 GB (sufficient for analysis)
- Keep other defaults
Step 4: Connectivity
- VPC: Use default VPC
- Subnet group: default
- Public access: No (security best practice)
- VPC security group: Create new or use existing
- Availability Zone: No preference
Step 5: Additional Configuration
- Initial database name:
postgres(leave default) - Automated backups: Configure as needed
- Monitoring: Standard settings
important
Save the database endpoint URL once created — you'll need it for environment variables.
Phase 2: Create ECS Infrastructure
Step 1: Create ECS Cluster
- Go to ECS Console → Create Cluster
- Cluster name:
redash-analysis-cluster - Infrastructure: AWS Fargate (serverless)
- Leave other settings as default
- Click Create
Step 2: Create IAM Service Role (if needed)
If you encounter role errors:
- Go to IAM Console → Roles → Create role
- Select AWS service → Elastic Container Service
- Choose Elastic Container Service (not Task)
- Complete role creation
Phase 3: Create Task Definition
Step 1: Basic Task Configuration
- Go to ECS Console → Task Definitions → Create new task definition
- Task definition family:
redash-analysis-task - Launch type compatibility: Fargate
- Operating system: Linux/X86_64
- Task size:
| Resource | Value |
|---|---|
| CPU | 1 vCPU (1024) |
| Memory | 2 GB (2048) |
Step 2: Configure Redash Container
Container 1: Redash
- Container name:
redash - Image:
redash/redash:latest - Memory limits: Hard limit 1.5 GB / Soft limit 1 GB
- Port mappings: Container port
5000, Protocol TCP, App protocol HTTP - Essential container: Yes
Environment Variables:
REDASH_DATABASE_URL=postgresql://redash:YOUR_PASSWORD@YOUR_RDS_ENDPOINT:5432/postgres
REDASH_REDIS_URL=redis://localhost:6379/0
PYTHONUNBUFFERED=0
REDASH_SECRET_KEY=your-secret-key-here
caution
Replace YOUR_PASSWORD with the database password you created and YOUR_RDS_ENDPOINT with the RDS endpoint from Phase 1.
Step 3: Configure Redis Container
Container 2: Redis
- Container name:
redis - Image:
redis:7-alpine - Memory limits: Hard limit 0.5 GB / Soft limit 0.25 GB
- Port mappings: Container port
6379, Protocol TCP - Essential container: No
- Environment variables: None needed
Step 4: Task Roles
- Task execution role: Create new role (auto-generated)
- Task role: Leave empty
- Logging: Enable CloudWatch logs (recommended)
Phase 4: Create ECS Service
Step 1: Service Configuration
- Go to your ECS Cluster → Services → Create
- Launch type: Fargate
- Task definition: Select your created task definition
- Service name:
redash-analysis-service - Number of tasks: 1
Step 2: Deployment Configuration
- Deployment type: Rolling update
- Minimum healthy percent: 0
- Maximum percent: 200
Step 3: Networking Configuration
- VPC: Select same VPC as RDS database
- Subnets: Select public subnets (for internet access)
- Security group: Create new with these rules:
| Rule | Port | Source |
|---|---|---|
| Web access | 5000 | 0.0.0.0/0 |
| Database access | 5432 | VPC CIDR |
- Auto-assign public IP: ENABLED
Phase 5: Security Group Configuration
Database Security Group
- Inbound: Port 5432 from ECS security group or VPC CIDR range
- Outbound: Default (all traffic)
ECS Security Group
- Inbound: Port 5000 from
0.0.0.0/0(Redash web interface) - Outbound: All traffic (for database and internet access)
Phase 6: Initial Setup and Testing
Step 1: Find Public IP
- Go to ECS Cluster → Tasks
- Click on your running task
- Find the Public IP in networking details
Step 2: Test Connectivity
-
Test basic connectivity:
http://PUBLIC_IP:5000/pingShould return
PONGif running. -
Access Redash:
http://PUBLIC_IP:5000
note
Initial startup may take 10–20 minutes for database setup.
Step 3: First-Time Setup
Once Redash loads:
- Create admin user account
- Set up organization name
- Configure data sources
Troubleshooting
Database Connection Errors
- Verify RDS endpoint in environment variable
- Check security group allows port 5432
- Confirm database password is correct
Redis Connection Errors
- Ensure
REDASH_REDIS_URL=redis://localhost:6379/0 - Verify Redis container is running in task
- Check both containers are in same task definition
Long Loading Times
- First startup requires database initialization (10–20 minutes)
- Worker timeout errors are normal during setup
- Monitor logs for progress
Service Update Process
- Create new revision with changes
- Update ECS service to use new revision
- Wait for rolling deployment to complete
Cost Optimization
Development Environment
| Resource | Recommendation | Est. Cost |
|---|---|---|
| RDS | db.t3.small or db.t3.medium | — |
| Storage | 20–100 GB General Purpose SSD | — |
| ECS | 1 vCPU, 2 GB memory | — |
| Total | $50–150/month |
Production Environment
| Resource | Recommendation | Est. Cost |
|---|---|---|
| RDS | db.r6g.large or Aurora cluster | — |
| ECS | 2+ vCPU, 4+ GB memory | — |
| Load balancer | Application Load Balancer | — |
| Total | $200–500/month |
Security Best Practices
- Database — Never expose RDS to public internet
- Secrets — Use AWS Secrets Manager for production passwords
- Network — Use private subnets where possible
- Access — Implement proper IAM roles and policies
- Updates — Regularly update container images
- Monitoring — Enable CloudWatch logging and metrics
Maintenance and Updates
Updating Redash Version
- Create new task definition revision with updated image tag
- Update ECS service to use new revision
- ECS performs rolling update automatically
Scaling
- Increase task count in ECS service for horizontal scaling
- Increase CPU/memory in task definition for vertical scaling
- Consider Aurora for database scaling needs
Backup and Recovery
- RDS automated backups enabled by default
- Export important dashboards and queries regularly
- Document data source configurations