Initialize the database
superset db upgrade superset fab create-admin # Create admin user superset init
### π§ Run Superset
```bash
superset run -p 8088 --with-threads --reload --debugger
Visit: http://localhost:8088
π§© 3. Connect Superset to Cube.js SQL API
In Superset UI:
Go to Settings β Database Connections
Click + Database
Select PostgreSQL
Fill in details:
- Display Name:
Cube.js(or any name) - SQLAlchemy URI:
postgresql+psycopg2://admin:admin@localhost:15432/postgres
- Display Name:
Click Connect
𧨠Common Errors & Fixes
β ModuleNotFoundError: No module named 'psycopg2'
Fix:
Activate your Superset venv and install the missing driver:
source venv/bin/activate
pip install psycopg2-binary
β Superset logo / favicon 404 errors
You may see logs like:
GET /static/assets/images/superset-logo-horiz.png HTTP/1.1" 404 -
π‘ These are not critical β just missing branding assets. UI still works.
β Unable to load SQLAlchemy dialect shillelagh.multicorn2
Superset log:
Unable to load SQLAlchemy dialect shillelagh.multicorn2: No module named 'psycopg2'
π’ This also results from the missing PostgreSQL driver (psycopg2). Installing it as shown above fixes both.
β NPM Error: package.json not found
If you ran npm install inside Superset folder:
npm ERR! enoent ENOENT: no such file or directory, open '.../package.json'
π οΈ You do not need to run npm install in Superset. Thatβs for frontend development. Ignore this.
β After Connection
- Go to Datasets in Superset
- Explore tables exposed by Cube.js schemas
- Build dashboards using those datasets
π§ͺ Test the Connection via CLI (optional)
PGPASSWORD=admin psql -h localhost -p 15432 -U admin postgres
This lets you directly inspect what Cube.js is exposing via PostgreSQL.
π§Ό Final Summary
| Component | Status |
|---|---|
| Cube.js SQL API | β Running on port 15432 |
| Superset | β Installed & running |
| psycopg2 | β Installed in venv |
| Connection | β PostgreSQL β Cube.js linked |
Written by A.M. Rinas