How to Set Up Apache Superset using Docker Compose with PostgreSQL and MySQL

Introduction

Apache Superset is a modern data exploration and visualization platform. In this guide, we will walk through how to set it up using Docker Compose and connect it with PostgreSQL and MySQL on an AWS EC2 instance.

Prerequisites

AWS EC2 Ubuntu Instance (Minimum 2 vCPU and 4 GB RAM Recommended)

Docker and Docker Compose installed

Clone the Superset Repository

Run the following command:

git clone https://github.com/apache/superset.git

Navigate to the Superset Directory

cd superset

Start Superset Containers

Run the below command to start Superset using Docker Compose:

docker compose up -d

Below is the result after running docker compose up:

Verify Docker Containers

Run this command to check running containers:

docker ps

Expected output:

Docker Images

Run this command to view Docker images:

docker images

Expected output:

Access Superset UI

Go to your EC2 public IP with port 8088 (http://<public-ip>:8088).

Run MySQL using Docker

To spin up a MySQL container instantly without Docker Compose, run the following one-liner in your terminal:

docker run -d --name superset_mysql -e MYSQL_ROOT_PASSWORD=rootpass -e MYSQL_DATABASE=analytics -e MYSQL_USER=supersetuser -e MYSQL_PASSWORD=supersetpass -p 3306:3306 mysql:5.7

This will create a MySQL container named superset_mysql running on port 3306.

Connect MySQL to Superset

Go to Superset โ†’ Datasets โ†’ +Database โ†’ Enter SQLAlchemy URI:

mysql://supersetuser:supersetpass@superset_mysql:3306/analytics

Refer to the screenshot below:

Connected Databases UI

Once connected, both MySQL and PostgreSQL will appear like below:

Superset Directory Structure

Run the command lsto explore files:

Conclusion

You have successfully set up Apache Superset using Docker Compose on an EC2 instance and connected both MySQL and PostgreSQL. This setup is ideal for dashboards, analytics, and modern BI workflows. For any help, feel free to connect!

Connect and Follow Me on Socials Network

LINKEDIN | GITHUB | TWITTER

1
Subscribe to my newsletter

Read articles from priyadarshi ranjan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

priyadarshi ranjan
priyadarshi ranjan

Greetings! ๐Ÿ‘‹ I'm Priyadarshi Ranjan, a dedicated DevOps Engineer embarking on an enriching journey. Join me as I delve into the dynamic realms of cloud computing and DevOps through insightful blogs and updates. ๐Ÿ› ๏ธ My focus? Harnessing AWS services, optimizing CI/CD pipelines, and mastering infrastructure as code. Whether you're peers, interns, or curious learners, let's thrive together in the vibrant DevOps ecosystem. ๐ŸŒ Connect with me for engaging discussions, shared insights, and mutual growth opportunities. Let's embrace the learning curve and excel in the dynamic realm of AWS and DevOps technology!