Installation of Apache superset on Windows

Mushrifah Hasan
3 min readMay 1, 2023

--

Apache Superset

Introduction:

Apache Superset is a modern data exploration and visualization platform that makes it easier to visualize data and make different types of charts. It is one of the few free open-source tools available for data visualization.

In this blog, I’m using Windows 11 for the installation of Apache superset without docker using WSL ubuntu. The steps for installation and setup configuration for the Apache superset are as:

Setup WSL on Windows 11

Open cmd or windows PowerShell and install WSL ubuntu as:

wsl --install Ubuntu

This will install the latest Ubuntu version and after this, it will ask you to set up a sudo username and password once done you will able to use the Ubuntu system on Windows 11.

install WSL on Windows 11

Installation of Apache Superset on WSL Ubuntu

Once the setup for the Ubuntu system is done we will first have to install Python and its dependencies required for the Apache superset pip package

sudo apt-get install build-essential libssl-dev libffi-dev python3.9-dev python3-pip python3.9-distutils libsasl2-dev libldap2-dev default-libmysqlclient-dev

Here, we use the python3.9 version and apache_superset latest version (i.e. 2.1.0). Create a virtual environment and install it as:

python3.9 -m pip install virtualenv
python3.9 -m virtualenv superset
source /superset/bin/activate

Once the virtual environment named “superset” is activated, install Apache superset with pip as:

pip install apache-superset

Go to /superset/lib/python3.9/site-packages/superset folder and create a secret key with cmd: openssl rand -base64 42 and copy the output in the config.py file in the folder in the SECRET_KEY variable and finally run as:

superset db upgrade

Note: if this shows some sql parse error then downgrade the sqlparse pip version as: pip install sqlparse==0.4.3

Next, add the local admin account with specifying the username, password, etc details as:

superset fab create-admin

Finally, initialize the superset instance as:

superset init

To view the Apache superset application, run the Flask app as:

superset run

This will start the superset flask instance running on port 5000 by default.

Apache Superset login page

Now we will set up Gunicorn for Apache superset which will start the server running at port 8088 as:

pip install gevent
gunicorn -w 4 -k gevent --timeout 180 -b 0.0.0.0:8088 "superset.app:create_app()"

Download any additional packages required for database connections with Postgres, SQL server as:

pip install psycopg2-binary
pip install pymssql

Finally, we have completed the installation of the Apache superset with any additional packages as required.

We can create a service file named superset.service in the folder /etc/systemd/system for Apache superset to run as:

[Unit]
# Describe the metadata of the service
Description="Apache Superset"
After=network.target



# Service specifies the user and group under which our process will run.
# Replace with your username
[Service]
User=mushrifah

# Path to the virtual environment where you have installed the superset
Environment=PYTHONPATH=/home/mushrifah/apache_environments/superset


# Modify this execution accordingly as per your needs.
# Gunicorn command along with the path specified where it is located.

ExecStart=/home/mushrifah/apache_environments/superset/bin/gunicorn -w 4 -k gevent --timeout 180 -b 0.0.0.0:8088 "superset.app:create_app()"
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

This will create a superset service that will run Apache superset on port 8088. We can start, stop, restart, and check the status of superset service as:

sudo systemctl start superset
sudo systemctl stop superset
sudo systemctl restart superset
sudo systemctl status superset

Hope you have learned about installing Apache superset and its configuration on Windows 11 with WSL Ubuntu.

Thank you for taking the time in reading this article.

--

--