Install Apache Superset on Ubuntu without docker

Install Apache Superset on Ubuntu without docker

Step-by-Step Guide to Installing Apache Superset on Ubuntu without docker

Prerequisites

How to Install Ubuntu on Windows Using WSL Follow this blogpost to install Ubuntu on Windows using WSL (Windows Subsystem for Linux)

At a glance

We will use these command over the whole blogpost, if you arere new in this blogpost you should skip this section, and if you are already familiar with the setup process, then you can use this section.

PackageCommand
Install required packagesudo apt-get install micro build-essential libssl-dev libffi-dev python3-dev python3-pip libsasl2-dev libldap2-dev default-libmysqlclient-dev
venvsudo apt install python3.10-venv
python3.10-devsudo apt-get install python3.10-dev
pippip install --upgrade pip setuptools wheel pillow marshmallow==3.20.1

Step by Step Installing Process

  1. Update and upgrade your system:

    sudo apt update
    sudo apt upgrade
    
  2. Install Required Packages

    For Ubuntu 22.04 and later versions

    sudo apt-get install build-essential libssl-dev libffi-dev libsasl2-dev libldap2-dev default-libmysqlclient-dev
    

    For Ubuntu 20.04

    sudo apt-get install build-essential libssl-dev libffi-dev libsasl2-dev libldap2-dev default-libmysqlclient-dev
    
  3. Check the supported python version for apache superset

    Both of the options confirm that we need to install python3.10

Installing Python 3.10

  1. Let's check the existing version of python in the system

    python3 --version
    

    check-existing-python-version

    The screenshot suggest the system has python 3.12.3 installed, which is not supported for installation of apache superset as of 2025-04-26

  2. Installing python 3.10

    Run the following command one by one to install python 3.10, the dev version and virtual environment

    sudo apt update
    sudo apt install software-properties-common
    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt update
    sudo apt install python3.10 python3.10-dev python3.10-venv
    
  3. Create a folder named app, and navigate to the folder:

    mkdir app && cd app
    
  4. Generate virtual environment using correct python venv env inside the folder:

    python3.10 -m venv env
    

    Make sure to use python3.10 to ensure compatibility with the installed Python version.

  5. Activate the virtual environment env:

    source env/bin/activate
    

    or

    . env/bin/activate
    
  6. Update your pip setuptools wheel and pillow (package installer for Python):

    pip install --upgrade pip setuptools wheel pillow
    
  7. Install Apache Superset using pip:

    pip install apache-superset
    
  8. Generate a strong key required for running Apache Superset (keep this key secure):

    openssl rand -base64 42
    

    Store this key securely and do not expose it publicly.

    Then, define mandatory configurations, SECRET_KEY and FLASK_APP (consider adding this to your .bashrc or .profile to make it permanent):

    export SUPERSET_SECRET_KEY=YOUR-SECRET-KEY
    export FLASK_APP=superset
    

    If you shutdown your system, you need to follow this step again. TO PERSIST THE CONFIGURATION, SCROLL AT THE BOTTOM OF THE BLOGPOST

  9. Create and upgrade the Apache Superset database:

    superset db upgrade
    

    min length error

    If you get error stating unexpected keyword 'min_length, then run the following command

    pip show marshmallow
    

    marshmallow-version-4

    So the marshmallow is installed, but the current version is not supported, let's downgrade it to 3.20.1

    pip install marshmallow==3.20.1
    

    Finally run the superset db upgrade command again

    superset db upgrade
    
  10. Create an admin user for Superset:

    superset fab create-admin
    
  11. Load the default example databases of Apache Superset:

    superset load-examples
    
  12. Initialize Apache Superset:

    superset init
    
  13. Run the Apache Superset application:

    superset run
    

    Ensure that your firewall and port settings allow you to access the Superset web interface.

    superset-is-working-perfectly

Troubleshooting

If you encounter any issues during the installation, consider checking for:

  • Missing dependencies or packages.
  • Permission issues related to file access or command execution.
  • Firewall or port conflicts that might prevent accessing the Superset interface.

This guide aims to help you smoothly set up Apache Superset on an Ubuntu system using Python 3.10. Happy data exploring!

Persist Virtual Environment variable

To avoid having to export the FLASK_APP environment variable every time you activate your virtual environment and run Apache-Superset, you can make this setting persistent by adding it to your virtual environment's activation script. Here’s how you can do that:

  • Install the micro text editor for editing the activation script inside the virtual environment

    sudo apt update
    sudo apt install micro
    

    install-the-text-editor-micro

  • Locate the Activation Script, which should be inside

    [virtual Environment]/bin/activate
    
  • Edit the Activation Script:

    sudo nano env/bin/activate
    

    or

    micro env/bin/activate
    
  • Generate the SECRET-KEY again

    openssl rand -base64 42
    

    Add the Export Command at the bottom of the script

    export FLASK_APP=superset
    export SUPERSET_SECRET_KEY=YOUR-SECRET-KEY
    

    These line will automatically set the FLASK_APP environment variable every time you activate your virtual environment.

  • Test the Configuration:

    deactivate
    source env/bin/activate
    echo $FLASK_APP
    echo $SUPERSET_SECRET_KEY
    

It should output superset.

Related posts