Skip to Content
Self-HostingAWS Deployment

AWS Deployment

The recommended AWS deployment uses EC2 with Docker Compose and images stored in ECR (Elastic Container Registry).

Build and push to ECR

The build-and-push.sh script builds the Docker image and pushes it to your ECR repository. It requires an AWS profile name and optionally a region:

./build-and-push.sh --profile your-aws-profile [--region ap-southeast-1]

The region defaults to the value configured for the profile. The ECR repository name is set by the REPOSITORY_NAME variable inside the script.

Configure the EC2 instance

On your EC2 instance, install Docker and Docker Compose:

sudo apt-get update && sudo apt-get install -y docker.io docker-compose-plugin sudo systemctl enable --now docker

Pull and run

# Authenticate Docker with ECR aws ecr get-login-password --region ap-southeast-1 | \ docker login --username AWS --password-stdin <account>.dkr.ecr.ap-southeast-1.amazonaws.com # Pull the latest image docker pull <your-ecr-image> # Start services docker-compose up -d

Configure a reverse proxy (optional)

Use nginx or an AWS Application Load Balancer to terminate TLS and forward traffic to port 3000.

Including the Docs Site

A docs nginx service is already defined in docker-compose.yml but is gated behind the standalone-docs profile. To start it alongside the app:

docker-compose --profile standalone-docs up -d

Before deploying, build the docs site locally so docs-site/out/ exists:

cd docs-site pnpm install pnpm build # produces docs-site/out/

Then copy docs-site/out/ to the EC2 instance alongside docker-compose.yml.

Security Group

Ensure your EC2 security group allows inbound traffic on:

  • Port 3000 (or 80/443 via a load balancer)
  • Port 3001 for the docs site (or proxy it behind the same domain at /guide)
  • Port 22 for SSH (restricted to your IP)
Last updated on