DEV Community

Cover image for Running Grafana on AWS ECS (Fargate)
Ikoh Sylva
Ikoh Sylva

Posted on

Running Grafana on AWS ECS (Fargate)

At some point in your cloud journey, you move beyond just deploying servers…

…and start thinking about observability.

Because building systems is one thing.

Understanding how they behave in real time is another.

That’s where tools like Grafana come in.

In this guide, I’ll walk you through how I deployed Grafana on AWS using ECS with Fargate a fully managed container service without managing any servers.

Image of the grafana ECS service on AWS

What We’ll Be Building

In this project, we will:

  • Deploy Grafana using containers

  • Use Amazon ECS with Fargate (serverless compute for containers)

  • Expose the application on port 3000

  • Configure networking and security

  • Access Grafana via our browser

By the end, we’ll have a live Grafana dashboard running in the cloud.

Why This Matters

This project introduces you to:

  • Containerized applications

  • Serverless container orchestration

  • Networking in ECS

  • Security group configuration

  • Observability tools (Grafana)

These are real-world DevOps and Cloud Engineering skills.

Architecture Overview

Internet
   |
Public Subnet
   |
ECS Service (Fargate)
   |
Grafana Container (Port 3000)
Enter fullscreen mode Exit fullscreen mode

No EC2 instances needed Fargate handles everything.

Step 1: Create an ECS Cluster

  1. Go to ECS in the AWS Console
  2. Click Create Cluster
  3. Choose Fargate (Networking only)
  4. Give it a name (e.g., grafana-cluster)

Step 2: Create a Task Definition

  1. Go to Task Definitions → Create
  2. Select Fargate

Configure:

  • Task name: grafana-task

  • CPU: 0.5 vCPU

  • Memory: 1GB

Add Container

  • Container name: grafana

  • Image: grafana/grafana

  • Port mapping:

  • Container port: 3000

This tells ECS to expose Grafana’s default port.

Step 3: Create a Service

  1. Go to your cluster
  2. Click Create Service

Configure:

  • Launch type: Fargate

  • Task definition: grafana-task

  • Number of tasks: 1

Networking Setup

This step is critical.

  • Choose a VPC

  • Select a public subnet

  • Enable Auto-assign public IP

Step 4: Configure Security Group

Create or modify a security group:

Inbound Rule

  • Type: Custom TCP

  • Port: 3000

  • Source: 0.0.0.0/0 (or restrict to your IP for better security)

This allows access to Grafana via browser.

Image of grafana login page

Step 5: Deploy and Run

  • Launch the service

  • Wait for the task to reach RUNNING state

Step 6: Access Grafana

Once running:

  1. Go to ECS → Tasks
  2. Copy the Public IP

Open in browser:

http://<public-ip>:3000

You should see the Grafana login page!

Default Login

  • Username: admin

  • Password: admin

(You’ll be prompted to change it immediately.)

Assignment Deliverable (Proof)

To confirm your setup, capture screenshots showing:

  • ECS cluster

  • Running task

  • Task public IP

  • Grafana UI in browser

This proves:

✔ Successful deployment
✔ Proper networking
✔ Working containerized application

Common Mistakes to Avoid

  1. Forgetting to open port 3000
    You won’t be able to access Grafana.

  2. Not assigning a public IP
    Your service won’t be reachable.

  3. Using wrong port mapping
    Grafana won’t load properly.

What This Project Teaches You

This isn’t just about Grafana.

It teaches you:

  • How containers are deployed in the cloud

  • How ECS and Fargate work

  • How to expose applications securely

  • How modern infrastructure avoids managing servers

This is exactly how modern DevOps teams deploy applications.

Real-World Use Cases

Grafana is widely used for:

  • Monitoring cloud infrastructure

  • Visualizing metrics (CPU, memory, logs)

  • Integrating with tools like Prometheus and CloudWatch

Deploying Grafana on ECS Fargate is a powerful step forward in your cloud journey.

It moves you from:

“I can launch servers” to “I can now deploy and run real applications in the cloud”

And that’s where things start to get exciting.

Image of grafana home page

I’m also excited to share that I’ve been able to secure a special discount, in partnership with Sanjeev Kumar’s team, for the DevOps & Cloud Job Placement / Mentorship Program.

For those who may not be familiar, Sanjeev Kumar brings over 20 years of hands-on experience across multiple domains and every phase of product delivery. He is known for his strong architectural mindset, with a deep focus on Automation, DevOps, Cloud, and Security.

Sanjeev has extensive expertise in technology assessment, working closely with senior leadership, architects, and diverse software delivery teams to build scalable and secure systems. Beyond industry practice, he is also an active educator, running a YouTube channel dedicated to helping professionals successfully transition into DevOps and Cloud careers.

This is a great opportunity for anyone looking to level up their DevOps/Cloud skills with real-world mentorship and career guidance.

Do refer below for the link with a dedicated discount automatically applied at checkout;

DevOps & Cloud Job Placement / Mentorship Program.

If you also found this interesting and would love to take the next steps in the application process with AltSchool Africa do use my referral link below;

Apply here or use this Code: W2jBG8 during the registration process and by so doing, you will be supporting me and also getting a discount!

Special Offer: By signing up through the link and using the code shared, you’ll receive a 10% discount!

Don’t miss out on this opportunity to transform your future and also save while doing it! Let’s grow together in the tech space. Also feel free to reach out if you need assistance or clarity regarding the program.

I’m Ikoh Sylva, a passionate cloud computing enthusiast with hands-on experience in AWS. I’m documenting my cloud journey here from a beginner’s perspective, aiming to inspire others along the way.

If you find my contents helpful, please like and follow my posts, and consider sharing this article with anyone starting their own cloud journey.

Let’s connect on social media. I’d love to engage and exchange ideas with you!

LinkedIn Facebook X

Top comments (0)