---
title: "Deploy Metabase Athena"
description: "Query your S3 data lake through Athena in Metabase"
category: "Analytics"
url: https://railway.com/deploy/deploy-metabase-with-amazon-athena
---

# Deploy Metabase Athena

Query your S3 data lake through Athena in Metabase

**[Deploy Metabase Athena on Railway](https://railway.com/template/deploy-metabase-with-amazon-athena)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-metabase-with-amazon-athena/manifest.json

- **Creator:** onepush
- **Category:** Analytics

## Template content

### metabase/metabase

- **Image:** metabase/metabase
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

## Documentation

# Deploy and Host self hosted Metabase Athena (Open-Source BI for Amazon Athena) on Railway

This template runs the Metabase OSS image beside Railway Postgres 18, giving you a self-hosted BI layer you point at Amazon Athena and your S3 data lake. It fits analysts who want dashboards over Parquet without QuickSight seats.

## About Hosting Metabase Athena open-source software on Railway (self hosted Metabase template)

The data stays in your AWS account. Your S3 data lake and Glue catalog are never copied; Metabase queries Athena and renders results. Railway handles the domain, TLS, health checks, volumes, and restarts, so you skip provisioning a VM, hardening SSH, and patching Postgres.

## Why Deploy Metabase Athena, the Amazon QuickSight alternative on Railway (Railway Free Trial)

QuickSight charges per user and per session, so a five-person data team pays whether or not anyone opens a dashboard. The Railway free trial covers the first stack.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Metabase Athena on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

### Railway vs Other Hosting Providers and VPS for Metabase Athena self hosting

Railway bundles Metabase and Postgres in one project; here's how the raw alternatives compare.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | Metabase and Postgres on a private network, deploys from the official image | A Droplet you patch yourself, plus Postgres wired up by hand |
| AWS | No instance role, so you create an IAM user with Athena and Glue permissions | Athena and Glue sit next to your S3 data, and EC2 roles skip key handling |
| Hetzner | Railway handles TLS, domain, and redeploys while you wire Athena | Cheapest CPU per euro, but you own Docker, backups, and the proxy |

## Common Use Cases for hosted Metabase Athena

- **Weekly reporting off the S3 lake.** Parquet lands in s3://acme-lake/orders/ by date; point Metabase at Athena and sales gets a Monday dashboard, not a hand-built CSV.
- **Ad hoc exploration with a leash.** Analysts query Glue tables on a workgroup with a bytes-scanned cap; Metabase caching keeps repeat dashboards from rescanning the same TB.
- **A lean QuickSight replacement.** Dashboards and filters over Athena without AWS per-reader pricing; the bill is Railway compute plus Postgres.
- **Read-only customer embeds.** Athena is read-only in Metabase, so signed dashboards can face customers without handing out IAM keys.
- **Lake data next to app data.** Keep the Athena connection beside your Postgres app DB and compare warehouse totals against live rows in one question.

## Dependencies for Metabase Athena Docker hosted on Railway

Two services carry this stack: the Metabase app and its own Postgres. Neither one is your data lake. Athena stays a read-only external warehouse you attach after first boot, which keeps the app database small and the blast radius honest.

### Deployment Dependencies for Managed Metabase Athena Service (BI for S3 Data Lakes)

The app service runs metabase/metabase on the latest tag, listening on port 3000 with health check GET /api/health. The template does not set MB_ENCRYPTION_SECRET_KEY. Add one before you save AWS keys, then leave it alone.

### Implementation Details for Metabase Athena (Using Metabase official docker image)

First boot migrates the app Postgres. Add Athena under Admin > Databases: Region, Workgroup, S3 staging directory, and access and secret keys from a least-privilege IAM user, since Railway has no AWS instance role. Athena is read-only; skip deep scans on huge tables.

## How does Metabase Athena compare against other BI tools for Amazon Athena platforms

Pick wrong and you'll spend weekends on IAM instead of dashboards. All four query Athena; the split is ownership. QuickSight lives inside AWS, Superset and Redash are self-hosted, and Metabase Athena is self-hosted Metabase with a read-only Athena connection.

### Metabase Athena vs Amazon QuickSight (Amazon QuickSight Alternative)

- **AWS-native:** QuickSight assumes IAM roles directly. Railway has no instance role, so Metabase needs a least-privilege IAM user and an S3 staging bucket.
- **Billing:** QuickSight charges per user and session; Metabase OSS is free, and you pay Railway plus Athena scans. QuickSight wins for hands-off AWS teams.

### Metabase Athena vs Apache Superset (Apache Superset Alternative)

- **Footprint:** Superset needs web, worker, broker, and a metadata DB; Metabase Athena is one container plus Postgres 18.
- **Strengths:** Superset wins on chart plugins and SQL Lab depth. Metabase is easier for mixed teams, and its Athena connector handles Glue sync and scans without extra config.

### Metabase Athena vs Tableau (Tableau Alternative)

- **Price:** Tableau is per-seat and steep; it wins on governed semantic layers and polish. Metabase OSS is free, or Cloud Starter at $100/month for 5 users.
- **Setup:** Tableau's Athena connector is wizard-driven. Metabase asks you to write the IAM policy, choose a workgroup, and supply an s3:// staging path.

### Metabase Athena vs Redash (Redash Alternative)

- **Overlap:** Both are OSS, Athena-capable, and read Glue metadata; both stay read-only against Athena.
- **Cadence:** Redash development is quieter, while Metabase ships often and has a stronger question builder. Redash wins on bare saved SQL and alerts. Either way, set MB_ENCRYPTION_SECRET_KEY before storing AWS keys.

## How to use Metabase Athena (the OSS BI for S3 Data Lakes)?

1. Set MB_ENCRYPTION_SECRET_KEY on the Metabase service before you save any warehouse credentials, then let it restart. Changing it later breaks stored secrets.
2. In AWS, create an IAM user for Railway. Grant Athena query actions, Glue catalog reads, read on your data buckets, and write on a staging bucket.
3. Open Admin, then Databases, then Add a database, then Amazon Athena.
4. Enter Region (us-east-1), Workgroup (primary), and the s3:// staging directory. Paste the access and secret keys; blank keys fall back to an instance role Railway does not have.
5. Save. The first sync reads Glue metadata, so turn off deep scans on huge tables.
6. Run a question with a date filter, enable caching, and cap bytes scanned on the workgroup.

## How to self host Metabase Athena on other VPS Services (Metabase Athena self hosting guide)

Docker plus Postgres 18, the official image, and the Athena wiring you own.

### Clone the Repository

Pull the official metabase/metabase image. No build step.

### Install Dependencies

Run the same Postgres 18 image with a named volume and a password.

### Configure Environment Variables

Skip the H2 default. Point Metabase at Postgres and add MB_ENCRYPTION_SECRET_KEY before saving the Athena key.

```bash
MB_DB_TYPE=postgres MB_DB_HOST=mbdb MB_DB_PORT=5432
MB_DB_USER=postgres MB_DB_PASS=secret MB_DB_DBNAME=metabase
```

Then Admin > Databases > Amazon Athena: Region, Workgroup, S3 Staging Directory, and an IAM user's keys. A VPS has no AWS instance role.

### Start the Metabase Athena Application

```bash
docker run -d --name metabase -p 3000:3000 --env-file metabase.env metabase/metabase:latest
```

Front it with Caddy for TLS on your-domain and finish the setup wizard. Railway handles the domain, TLS, Postgres wiring and restarts.

## Official Pricing of Metabase Athena (Metabase Athena pricing)

The Metabase side is free and open source under AGPL. You pay Railway usage for Metabase and Postgres (the Hobby plan is $5/month including $5 of usage, and a JVM app often needs more), plus Athena's per-TB scan charges. On the OSS path there are no seat licenses and no user minimums.

## Metabase Athena cloud vs self hosted comparison (Pricing, features, costs, and more)

Cloud buys you someone else's pager. Self hosting buys you a bill you can read line by line, and a stack you have to patch.

### Monthly cost of self hosting Metabase Athena on Railway

Railway bills Metabase and Postgres by usage, mostly RAM for the JVM. Metabase Cloud Starter is $100/mo with 5 users, plus $6 per extra user; Pro is $575/mo with 10 users, plus $12 each; Enterprise starts at $20,000/year. OSS is free under AGPL.

### System Requirements for Hosting Metabase Athena on a VPS

Give it 2 vCPU, 4 GB RAM, and 40 GB SSD as a floor, with a 2 GB JVM heap and Postgres 18 beside it. Allow outbound HTTPS to Athena, Glue, and S3, and budget disk for staging results. Add MB_ENCRYPTION_SECRET_KEY early and never change it.

## Frequently Asked Questions (FAQs)

### Do I need AWS keys if Metabase runs on Railway?

Yes. The default credential chain only works on EC2 with a role, and Railway isn't AWS. Make a least-privilege IAM user and paste the keys into the Athena form.

### Where do Athena query results go?

Into the S3 staging directory you set, required unless the workgroup fixes an output location. Grant PutObject, GetObject, and ListBucket there.

### Why did my saved AWS secret break after a redeploy?

MB_ENCRYPTION_SECRET_KEY was unset when you saved it, or it changed. Add one before storing credentials and never change it; rotate the IAM keys instead.

### Can I write to Athena from Metabase?

No. Athena is read-only: metadata syncs from Glue, questions run as SELECTs, no uploads or actions.

### Does a bigger Metabase instance cut my Athena bill?

Rarely. Athena bills per TB scanned, so partition by date, store Parquet, and set a workgroup scan limit. Skip deep fingerprinting on huge tables.

### Is QuickSight the better pick?

If you're all-in on AWS and want managed dashboards, yes. Metabase wins when you want one tool across Athena, Postgres, and MySQL without per-user seats.


## Similar templates

- [Typesense Multilingual](https://railway.com/deploy/deploy-typesense-multilingual-search) — Locale-aware multilingual search with Typesense
- [Formbricks | Open-Source Typeform & Qualtrics Alternative](https://railway.com/deploy/formbricks-surveys) — Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube
- [Typesense PHP](https://railway.com/deploy/typesense-php) — official PHP client against Railway

Open this page in a browser: https://railway.com/deploy/deploy-metabase-with-amazon-athena
