Skip to content

AWS

XeroML runs on AWS via ECS (Elastic Container Service), EKS (Elastic Kubernetes Service), or a single EC2 instance with Docker Compose.

For production deployments, the recommended AWS architecture is:

ComponentAWS Service
Web applicationECS Fargate
WorkerECS Fargate
PostgreSQLAmazon RDS (PostgreSQL)
ClickHouseSelf-managed on EC2 or ClickHouse Cloud
RedisAmazon ElastiCache (Redis)
Blob storageAmazon S3
Load balancerApplication Load Balancer
TLSAWS Certificate Manager

ECS Fargate Deployment

1. Set Up Database

Create an RDS PostgreSQL instance:

Terminal window
aws rds create-db-instance \
--db-instance-identifier xeroml-db \
--db-instance-class db.t3.medium \
--engine postgres \
--engine-version 15 \
--master-username xeroml \
--master-user-password <secure-password> \
--allocated-storage 20 \
--vpc-security-group-ids <sg-id>

2. Set Up Redis

Terminal window
aws elasticache create-cache-cluster \
--cache-cluster-id xeroml-redis \
--cache-node-type cache.t3.micro \
--engine redis \
--num-cache-nodes 1

3. Create S3 Bucket

Terminal window
aws s3 mb s3://xeroml-data-<account-id>

4. Create ECS Task Definitions

Create task definitions for the web and worker containers using the official XeroML Docker images. Set environment variables from AWS Secrets Manager or Parameter Store:

{
"family": "xeroml-web",
"containerDefinitions": [{
"name": "web",
"image": "ghcr.io/xeroml/xeroml:latest",
"portMappings": [{"containerPort": 3000}],
"secrets": [
{"name": "DATABASE_URL", "valueFrom": "arn:aws:secretsmanager:...:xeroml/DATABASE_URL"},
{"name": "NEXTAUTH_SECRET", "valueFrom": "arn:aws:secretsmanager:...:xeroml/NEXTAUTH_SECRET"}
]
}]
}

5. Create ECS Services

Terminal window
aws ecs create-service \
--cluster xeroml \
--service-name xeroml-web \
--task-definition xeroml-web \
--desired-count 2 \
--launch-type FARGATE \
--network-configuration "awsvpcConfiguration={subnets=[subnet-xxx],securityGroups=[sg-xxx]}" \
--load-balancers "targetGroupArn=arn:aws:elasticloadbalancing:..."

EKS Deployment

For EKS, use the Helm chart with AWS-specific configuration:

values-aws.yaml
ingress:
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:...
serviceAccount:
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::...:role/xeroml-role

EC2 (Single Server)

For smaller deployments, use Docker Compose on a single EC2 instance:

Terminal window
# Launch an EC2 instance (t3.large recommended)
# Install Docker and Docker Compose
# Follow the Docker Compose guide

Docker Compose Guide