DEV Community

Cover image for Apache Superset: Installing locally is easy using the makefile
Lyndsi Kay Williams
Lyndsi Kay Williams

Posted on • Edited on

Apache Superset: Installing locally is easy using the makefile

Are you interested in trying out Superset, but you're intimidated by the local setup process? Worry not! Superset needs some initial setup to install locally, but I've got a streamlined way to get started - using the makefile! This file contains a set of scripts to simplify the setup process.

This setup is for Mac OS X, for other OS setups see: https://superset.apache.org/docs/installation/installing-superset-from-scratch/

To start, fork and download Superset from Github: https://github.com/apache/superset

You can run Superset directly without forking it, but you won't be able to create pull requests unless you're using your own forked version.

Prerequisites

Superset has some prerequisites in order to run properly. Let's start with dependencies:

Make sure to update your machine to the latest version of Mac OS X. After updating, install the latest version of XCode command line tools:

xcode-select --install
Enter fullscreen mode Exit fullscreen mode

Going forward, we'll be using Homebrew to install dependencies: https://brew.sh/

Node: Currently, Superset works best with Node.js version 16 and npm version 7. If you've got a preferred version of node, I suggest using Node Version Manager (NVM).

nvm install 16
Enter fullscreen mode Exit fullscreen mode

Python: Currently, Superset works best with Python version 3.9. We'll be using a Python virtual environment, so for now just install the Python version:

brew install python@3.9
Enter fullscreen mode Exit fullscreen mode

Make sure to update pip and setuptools as well:

pip install --upgrade setuptools pip
Enter fullscreen mode Exit fullscreen mode

Almost done, now we need the rest of the dependencies:

brew install readline pkg-config libffi openssl mysql postgresql@14
Enter fullscreen mode Exit fullscreen mode

Set LDFLAGS and CFLAGS to allow certain Python packages to build properly. You can export the variables with these commands:

export LDFLAGS="-L$(brew --prefix openssl)/lib"
export CFLAGS="-I$(brew --prefix openssl)/include"
Enter fullscreen mode Exit fullscreen mode

You will need to set a secret key in your superset_config.py file for security reasons. Open superset in your favorite code editor and create a file called superset_config.py in the root folder. In this file, set your secret key like this:

SECRET_KEY='insertSecurePasswordHere'
Enter fullscreen mode Exit fullscreen mode

Python Virtual Environment

Now we can set up our Python virtual environment. Start by installing virtualenv:

pip install virtualenv
Enter fullscreen mode Exit fullscreen mode

cd into wherever you've locally cloned your forked instance of Superset. Create a virtual environment with Python 3.9:

// Create a venv directory
python3.9 -m venv venv

// Open the virtual environment
. venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

You will need two terminal windows to run Superset, I like to use iTerm2's horizontal window stacking to keep my terminal windows together: https://iterm2.com/

Now it's time for the Makefile magic ✨

Make sure you're at the root file of Superset and in a virtual environment. Run this command to install Superset:

make install
Enter fullscreen mode Exit fullscreen mode

That's it, you're installing Superset! This script will run for a bit, bring a snack.

Once the installation is complete, it's time to get things running. Boot up the back end with:

make flask-app
Enter fullscreen mode Exit fullscreen mode

In a separate terminal window, once again make sure you're at the root file of Superset and in a virtual environment. Boot up the front end with:

make node-app
Enter fullscreen mode Exit fullscreen mode

Once webpack finishes loading the app, go to localhost:9000 in your browser. You'll see a login screen, log in with these credentials:

Username: admin
Password: general
Enter fullscreen mode Exit fullscreen mode

You're in! Welcome to Superset, enjoy your experience and feel free to contribute. It's open source!

Top comments (1)

Collapse
 
cwprogram profile image
Chris White

I really liked the install steps and how thorough they are. One thing I noticed when looking over the Makefile referenced is they actually have a step to create a virtual environment and activate it much like the instructions you gave:

make venv

It checks the python versions you have from highest version to lowest and then creates a virtualenv for it (though you still have to install virtualenv for it to work). Though if you're using pyenv you'll still want to do it the way the instructions you linked to recommended. Thanks for the great article!