DEV Community

Cover image for Tutorial: Deploy your Web Application with AWS ECS Express Mode (Step by Step)
Afu Tse (Chainiz)
Afu Tse (Chainiz)

Posted on

Tutorial: Deploy your Web Application with AWS ECS Express Mode (Step by Step)

πŸš€ Deploying a Web App Using Amazon ECS Express Modee

This walkthrough shows how to push a Node/Express image to ECR and spin it up with ECS Express Mode. You only need Docker and the AWS CLI; Express Mode builds the network, load balancer, and HTTPS endpoint for you. Every step below is explicit so you can copy/paste without guesswork.


Why Express Mode?

ECS Express Mode is the 2025 way to deploy containers on AWS without having to manage VPCs, subnets, ALBs, certificates, or security groups. AWS provides you with all the minimum viable infrastructure: HTTPS, ALB, networking, scaling, and a public endpoint.

Ideal for: demos, MVPs, personal projects, small APIs, or low-friction microservices.


What We'll Deploy

  • Source: app/server.js (simple Express server with / and /health)
  • Container build: Dockerfile in the repo root
  • Runtime port: 3000

Prerequisites

  • Docker installed locally
  • AWS CLI v2 configured (aws configure) with permissions for ECR + ECS
  • An AWS account (any region that supports ECS Express Mode)
  • (Optional) jq installed for nicer CLI JSON output: brew install jq

Step by Step

Step 1: Clone the Project

git clone https://github.com/r3xakead0/aws-ecs-expressmode.git
Enter fullscreen mode Exit fullscreen mode

πŸ”— Source code (open-source): r3xakead0/aws-ecs-expressmode

Step 2: Set Helper Variables

export AWS_REGION=us-east-1              # change if needed
export ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
export IMAGE_NAME=aws-ecs-expressmode
export ECR_URI=$ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$IMAGE_NAME
Enter fullscreen mode Exit fullscreen mode

Step 3: Create the ECR Repository

aws ecr create-repository --repository-name $IMAGE_NAME --region $AWS_REGION
Enter fullscreen mode Exit fullscreen mode

(If it already exists, the command will say soβ€”no problem.)

Step 4: Authenticate Docker to ECR

aws ecr get-login-password --region $AWS_REGION \
  | docker login --username AWS --password-stdin $ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
Enter fullscreen mode Exit fullscreen mode

Step 5: Build and Tag the Image

docker build --platform=linux/amd64 -t $IMAGE_NAME .
docker tag $IMAGE_NAME:latest $ECR_URI:latest
Enter fullscreen mode Exit fullscreen mode

--platform=linux/amd64 matches the default Fargate architecture used by Express Mode.

Step 6: Push to ECR

docker push $ECR_URI:latest
Enter fullscreen mode Exit fullscreen mode

Step 7: Deploy with ECS Express Mode (Console, most guided)

1) In the ECS console, click Create and pick Express mode.

step01

2) Select container image β†’ choose Private repository β†’ pick $ECR_URI:latest.

step02

3) Container settings:

  • Container port: 3000
  • Health check path: /health
  • CPU/Memory: leave defaults unless you need more

step03

4) Click Create. ECS provisions:

  • VPC, subnets, security groups
  • Application Load Balancer with HTTPS
  • ECS service + task definition wired to your image

step04

7) Wait for status to become Active.

step05

8) Copy the Application URL; use it in the verify step.

step06

9) Test the Deployment

step07


Cleanup

Step 1: Destroy ECS resources (Console, most guided)

1) In the ECS console, click Cluster and pick default.

delete00

2) In the Action option, pick delete cluster

delete01

2) This will show when it's finished.

delete02

3) Review the cluster no longer exists

delete03

Step 2: Delete the ECR Repository

aws ecr delete-repository --repository-name $IMAGE_NAME --force --region $AWS_REGION
Enter fullscreen mode Exit fullscreen mode

What You Learned

  • How to build and publish an image on Amazon ECR.
  • How to deploy a container using ECS ​​Express Mode without manually creating VPCs, subnets, or ALBs.
  • How to get a working HTTPS endpoint in minutes.
  • The complete flow: Docker β†’ ECR β†’ ECS Express Mode β†’ Public URL.

Conclusion

ECS Express Mode makes deploying containers fast, guided, and hassle-free.

In just a few steps, you get a secure, scalable, and production-ready service without setting up complex infrastructure.
Perfect for demos, personal projects, or microservices that need to be up and running quickly.

Top comments (0)