Apache Superset + PostgreSQL: Build Executive Dashboards Your Team Will Actually Use
Your company has data. Probably a lot of it. And somewhere, someone is asking for "a dashboard" to make sense of it all. The problem? Tableau costs $70/user/month, and you have a perfectly good PostgreSQL database sitting there, full of insights nobody can access without writing SQL.
Apache Superset fixes this. It's the open-source BI tool that connects directly to your database and lets anyone, even the non-technical folks, build charts and dashboards. No per-seat licensing. No vendor lock-in. Just your data, visualized.
Let me show you how to set this up and actually make it useful.
What You're Building
By the end of this guide, you'll have:
- Superset connected to your PostgreSQL database
- A working dashboard with multiple chart types
- Knowledge of which visualizations work best for what data
- A dashboard you can embed in your own application
The whole thing takes about 30 minutes if you deploy on Elestio, less if you skip the coffee break.
Getting Superset Running
The fastest path is deploying Superset on Elestio. Pick your provider, select 2 CPU / 4GB RAM minimum, and click deploy. Starting at $14/month, you get automatic updates, backups, and SSL handled for you.
Once deployed, access your Superset instance through the provided URL. The default credentials are in your Elestio dashboard.
Connecting PostgreSQL
First things first: tell Superset where your data lives.
- Navigate to Settings > Database Connections
- Click + Database and select PostgreSQL
- Enter your connection string:
postgresql://username:password@your-host:5432/your_database
Test the connection. If it fails, check that your PostgreSQL instance allows connections from Superset's IP. On Elestio, you can find this in the service details.
For production databases, create a read-only user:
CREATE USER superset_reader WITH PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE your_database TO superset_reader;
GRANT USAGE ON SCHEMA public TO superset_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO superset_reader;
This keeps your dashboards from accidentally modifying production data.
Creating Your First Dataset
Datasets are how Superset understands your tables. Go to Data > Datasets and click + Dataset.
Select your database, schema, and table. Superset scans the columns and infers types. You can also create virtual datasets using SQL:
SELECT
date_trunc('day', created_at) as day,
COUNT(*) as signups,
COUNT(CASE WHEN plan = 'pro' THEN 1 END) as pro_signups
FROM users
WHERE created_at > NOW() - INTERVAL '90 days'
GROUP BY 1
Virtual datasets are powerful for pre-aggregating data and hiding complex joins from dashboard consumers.
Picking the Right Chart Types
Here's where most dashboards go wrong: they use pie charts for everything. Don't do that.
Time Series Line Chart: Perfect for trends over time. Daily signups, weekly revenue, monthly active users. If you're showing how something changes, use a line chart.
Bar Chart: Great for comparing categories. Revenue by product, users by region, tickets by status. Keep it to 10 items or fewer.
Big Number: Your KPIs. Total revenue, active users, conversion rate. Put these at the top of your dashboard so executives see them first.
Table: When people need the actual numbers. Export-friendly and sortable. Use for detailed breakdowns.
Pivot Table: Cross-tabulation of two dimensions. Revenue by product AND by region. Useful for analysts who need to slice data multiple ways.
Building the Dashboard
Create a new dashboard from Dashboards > + Dashboard.
Start with the layout executives actually want:
- Top row: 3-4 Big Number charts showing key metrics
- Second row: Time series showing the trend of your main KPI
- Bottom section: Breakdowns and tables for context
Drag charts from the right panel. Use the grid system to align everything. Superset auto-saves, but hit Save when you're happy with the layout.
Add filters at the top. Date range filters are essential. Let users narrow down to "last 7 days" or "this quarter" without building separate dashboards.
Making Dashboards Interactive
Cross-filtering is what separates good dashboards from great ones. Click a bar in your revenue-by-region chart, and every other chart filters to that region.
Enable this in chart settings under Cross-filtering. Works between charts on the same dashboard that share common dimensions.
For date filters, add a Filter Box or use the native filter panel. Configure it to affect all charts with a time column.
Embedding in Your Application
Superset supports embedding dashboards in iframes. Go to your dashboard settings, enable Embedded mode, and configure allowed domains.
<iframe
src="https://your-superset.elest.io/superset/dashboard/1/?standalone=true"
width="100%"
height="800"
frameborder="0"
></iframe>
For authenticated embedding, you'll need to set up guest tokens. This lets your application generate time-limited access tokens for users without Superset accounts.
Troubleshooting Common Issues
Dashboard loads slowly: Check your dataset queries. Add indexes to columns used in filters. Consider creating materialized views for complex aggregations.
Charts show "No data": Verify your filters aren't too restrictive. Check the time range. Ensure the dataset query returns results.
Connection timeouts: Increase the timeout in database settings. For large queries, set SQLLAB_TIMEOUT higher in your Superset configuration.
Permission errors: Users need both database access and dataset access. Check role assignments under Settings > List Roles.
What's Next
You've got a working dashboard. Now make it better:
- Schedule email reports to stakeholders
- Set up alerts when metrics cross thresholds
- Create row-level security to show different data to different teams
- Connect additional data sources and join across databases
Superset handles all of this out of the box. With Elestio's managed hosting, you get automatic updates so new features land without any maintenance work on your end.
Stop paying per-seat for dashboards your team barely uses. Your data is already in PostgreSQL. Now everyone can see it.
Thanks for reading, and see you in the next one!