--- title: 'AWS ECS (Fargate)' description: 'AWS ECS (Fargate) Installation' tags: ['Open Source'] keywords : ['NocoDB installation', 'NocoDB AWS Fargate installation', 'NocoDB prerequisites'] --- # Deploying NocoDB on AWS ECS (Fargate) This guide will walk you through deploying NocoDB on Amazon ECS using Fargate. ## Prerequisites - AWS CLI configured with appropriate permissions - Basic understanding of AWS ECS and Fargate ## Deployment Steps 1. Create ECS Cluster ```bash aws ecs create-cluster --cluster-name ``` 2. Create a Log Group: ```bash aws logs create-log-group --log-group-name /ecs// ``` 3. Create an ECS Task Definition: Every time you create it, it will add a new version. If it is not existing, the version will be 1. ```bash aws ecs register-task-definition --cli-input-json file://task-definition.json ``` :::tip This json file defines the container specification. You can define secrets such as NC_DB and environment variables here. ::: Example `task-definition.json`: ```json { "family": "nocodb-sample-task-def", "networkMode": "awsvpc", "containerDefinitions": [ { "name": "", "image": "nocodb/nocodb:latest", "essential": true, "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "/ecs//", "awslogs-region": "", "awslogs-stream-prefix": "ecs" } }, "secrets": [ { "name": "", "valueFrom": "" } ], "environment": [ { "name": "", "value": "" } ], "portMappings": [ { "containerPort": 8080, "hostPort": 8080, "protocol": "tcp" } ] } ], "requiresCompatibilities": [ "FARGATE" ], "cpu": "256", "memory": "512", "executionRoleArn": "", "taskRoleArn": "" } ``` 4. Create an ECS Service: ```bash aws ecs create-service \ --cluster \ --service-name \ --task-definition : \ --desired-count \ --launch-type "FARGATE" \ --platform-version \ --health-check-grace-period-seconds \ --network-configuration "awsvpcConfiguration={subnets=[""], securityGroups=[""], assignPublicIp=ENABLED}" \ --load-balancer targetGroupArn=,containerName=,containerPort= ``` :::tip If your service fails to start, you may check the logs in ECS console or in Cloudwatch. Generally it fails due to the connection between ECS container and NC_DB. Make sure the security groups have the correct inbound and outbound rules. ::: ### Important Notes - Ensure that your security groups have the correct inbound and outbound rules. - The NC_DB environment variable should be properly set to connect to your database. - Monitor the ECS console and CloudWatch logs for any deployment issues. - You can customize the task definition and service configuration based on your requirements.