Using Apache Superset, a Powerful and Free Data Analysis Tool
Tags: datascience, beginners, devops, docker
Published: 2024-07-07 03:00:00

Introduction
------------

Among data analysis tools, **Apache Superset**, provided as open-source software, is considered one of the best choices for deploying reports at a large scale efficiently and completely free of charge. In this article, I will guide you through installing, configuring Superset, and connecting data sources.

This application was initiated by **Maxime Beauchemin** (the creator of Apache Airflow) as a hackathon project when he was working at **Airbnb**, and it joined the **Apache Incubator** program in 2017.

Essentially, Superset's features are quite similar to other data analysis software, including:

*   Creating and managing dashboards
*   Supporting multiple database types: SQLite, PostgreSQL, MySQL, etc.
*   Supporting direct querying

![Apache Superset](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mz9hd9nz246gb9lliuqw.png)

Installation and Configuration
------------------------------

Here, I will guide you through installing Superset using the following Docker command:

```sh
docker run -d -p {outside port}:{inside port} --name {container name} apache/superset
```

**Example:**

```sh
docker run -d -p 8080:8088 --name superset apache/superset
```

After the Superset Docker container is running, we access that container to run the command for initializing an account as follows:

```sh
docker exec -it superset superset fab create-admin --username {username} --firstname {firstname} --lastname {lastname} --email {email} --password {password}
```

**Example:**

```sh
docker exec -it superset superset fab create-admin --username admin --firstname Superset --lastname Admin --email admin@superset.com --password admin
```  

Next, you run the following command to load some pre-existing examples:

```sh
docker exec -it superset superset load_examples
``` 

To start Superset:

```sh
docker exec -it superset superset init
```

After that, you can access **_http://localhost:8080_** to start using Superset. The result will have some example data that we loaded previously.

![Main page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5896ixetwvydwxxxylx.png)

Connecting Data Sources
-----------------------

To analyze data, you first need to create a connection to the database source (such as Postgres, MySQL, etc.). The connection process is simple and similar to how typical data connection tools work. Here, I will guide you on how to connect to PostgreSQL. If you are not familiar with Postgres, you can refer to [this article to install and use PostgreSQL basics](https://howtodevez.blogspot.com/2024/03/installing-postgresql-with-docker.html).

First, access the page to create a new database connection.

![Connect a database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/487rvq7ki24sbtto4jce.png)

Next, enter the **_SQLALCHEMY URI_** with the following structure:

```sh
postgresql://{username}:{password}@{host}:{port}/{database}  
```

After successfully connecting, you can use the features that Apache Superset supports, such as creating Dashboards, creating charts (with support for many chart types and diverse customization capabilities), querying data, saving queries, and viewing query history.

![Creating Charts based on Datasets](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/253xvpvfbtogfq2j77hq.png)

![SQL Query](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/klua9dldygztuf8athhx.png)

Conclusion
----------

Apache Superset provides relatively comprehensive tools to support data analysis and visualization. It can embed query results into other applications, connect to various data sources, and, importantly, it is open-source and completely free.

Although it may not be comparable to powerful paid tools like **_Tableau_** or **_Power BI_** in some aspects, overall, Superset is a very worthwhile tool because it meets most data analysis and reporting needs.

_**What do you think? Leave a comment below!**_

**_If you found this content helpful, please visit [the original article on my blog](https://howtodevez.blogspot.com/2024/04/using-apache-superset-a-powerful-and-free-data-analysis-tool.html) to support the author and explore more interesting content._**

<a href="https://howtodevez.blogspot.com/2024/03/sitemap.html" target="_blank" rel="noreferrer"><img src="https://img.shields.io/badge/Blogger-FF5722?style=for-the-badge&logo=blogger&logoColor=white" width="36" height="36" alt="Blogspot" /></a><a href="https://dev.to/chauhoangminhnguyen" target="_blank" rel="noreferrer"><img src="https://img.shields.io/badge/dev.to-0A0A0A?style=for-the-badge&logo=dev.to&logoColor=white" width="36" height="36" alt="Dev.to" /></a><a href="https://www.facebook.com/profile.php?id=61557154776384" target="_blank" rel="noreferrer"><img src="https://img.shields.io/badge/Facebook-1877F2?style=for-the-badge&logo=facebook&logoColor=white" width="36" height="36" alt="Facebook" /></a><a href="https://x.com/DavidNguyenSE" target="_blank" rel="noreferrer"><img src="https://img.shields.io/badge/X-000000?style=for-the-badge&logo=x&logoColor=white" width="36" height="36" alt="X" /></a>