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

apache-superset
ubuntu

Install Required Packages

First, ensure your system is up to date and install the necessary packages. These commands assume you have sudo privileges.

Package Command
build-essential sudo apt-get update && sudo apt-get install build-essential
venv sudo apt install python3.10-venv
python3.10-dev sudo apt-get install python3.10-dev

Step by Step Installing Process

  1. Create a folder named app, and navigate to the folder:
    mkdir app && cd app
  2. Generate virtual environment using 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.
  3. Activate the virtual environment env:
    source env/bin/activate
  4. Update your pip (package installer for Python):
    pip install --upgrade pip
  5. Install Apache Superset using pip:
    pip install apache-superset
  6. 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.
  7. Navigate to the configuration directory (path may vary if not using WSL):
    cd /home/yourusername/app/env/lib/python3.10/site-packages/superset/
    Open config.py and replace or add the following line after the SECRET_KEY (around line number 180):
    SECRET_KEY = '<your_generated_key_here>'
    Replace <your_generated_key_here> with the key generated in step 6.
  8. Add environment variable (consider adding this to your .bashrc or .profile to make it permanent):
    export FLASK_APP=superset
  9. Create and upgrade the Apache Superset database:
    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.

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:

  • Locate the Activation Script, which should be inside
    [virtual Environment]/bin/activate
  • Edit the Activation Script:
    nano env/bin/activate
  • Add the Export Command:
    export FLASK_APP=superset

This 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

It should output superset.

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!