Skip to main content

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

  1. Go to RDS ConsoleCreate database
  2. Select "Standard create"
  3. Choose PostgreSQL (not Aurora — too expensive for analysis environment)
  4. Select "Free tier" or "Dev/Test" template

Step 2: Database Configuration

SettingValue
DB instance identifierredash-analysis-db
Master usernameredash
Master passwordCreate strong password and save it
DB instance classdb.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

  1. Go to ECS ConsoleCreate Cluster
  2. Cluster name: redash-analysis-cluster
  3. Infrastructure: AWS Fargate (serverless)
  4. Leave other settings as default
  5. Click Create

Step 2: Create IAM Service Role (if needed)

If you encounter role errors:

  1. Go to IAM ConsoleRolesCreate role
  2. Select AWS serviceElastic Container Service
  3. Choose Elastic Container Service (not Task)
  4. Complete role creation

Phase 3: Create Task Definition

Step 1: Basic Task Configuration

  1. Go to ECS ConsoleTask DefinitionsCreate new task definition
  2. Task definition family: redash-analysis-task
  3. Launch type compatibility: Fargate
  4. Operating system: Linux/X86_64
  5. Task size:
ResourceValue
CPU1 vCPU (1024)
Memory2 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

  1. Go to your ECS ClusterServicesCreate
  2. Launch type: Fargate
  3. Task definition: Select your created task definition
  4. Service name: redash-analysis-service
  5. 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:
RulePortSource
Web access50000.0.0.0/0
Database access5432VPC 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

  1. Go to ECS ClusterTasks
  2. Click on your running task
  3. Find the Public IP in networking details

Step 2: Test Connectivity

  1. Test basic connectivity:

    http://PUBLIC_IP:5000/ping

    Should return PONG if running.

  2. 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:

  1. Create admin user account
  2. Set up organization name
  3. 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

  1. Create new revision with changes
  2. Update ECS service to use new revision
  3. Wait for rolling deployment to complete

Cost Optimization

Development Environment

ResourceRecommendationEst. Cost
RDSdb.t3.small or db.t3.medium
Storage20–100 GB General Purpose SSD
ECS1 vCPU, 2 GB memory
Total$50–150/month

Production Environment

ResourceRecommendationEst. Cost
RDSdb.r6g.large or Aurora cluster
ECS2+ vCPU, 4+ GB memory
Load balancerApplication Load Balancer
Total$200–500/month

Security Best Practices

  1. Database — Never expose RDS to public internet
  2. Secrets — Use AWS Secrets Manager for production passwords
  3. Network — Use private subnets where possible
  4. Access — Implement proper IAM roles and policies
  5. Updates — Regularly update container images
  6. Monitoring — Enable CloudWatch logging and metrics

Maintenance and Updates

Updating Redash Version

  1. Create new task definition revision with updated image tag
  2. Update ECS service to use new revision
  3. 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