
Deploy Redash | (Just Updated) BI Dashboards And SQL Queries, Admin And API Key Generated
Redash SQL dashboards with worker, admin and API key generated
postgres
Just deployed
/var/lib/postgresql
redash-worker
Just deployed
redis
Just deployed
/data
redash
Just deployed
Deploy and Host Redash on Railway
Built for an LLM agent to deploy and use. There is no manual deploy step and nothing to fill in: the admin login, the cookie and encryption secrets and a 40-character admin API key are generated at deploy time, the contract below lists every URL and variable name, and one working script connects a database, runs a query on the worker and reads the rows. An agent reads its variables, runs the curl, and has dashboards backed by SQL.
Redash is an open-source SQL dashboard and query tool: connect a database, write a query, chart it and share it. This template runs the official image as a web service plus a background worker, with PostgreSQL and Redis, an admin user and an API key already created.
About Hosting Redash
This template runs four services: the official redash/redash image (pinned by digest) as the web server and again as the worker and scheduler, plus PostgreSQL (volume at /var/lib/postgresql) and Redis (volume at /data). At every boot the web service waits for Postgres, creates the tables once under a database lock, creates the admin user if it does not exist and sets the admin password and API key from the generated variables, so they are the same after every redeploy. Version checks are off, the datasource encryption key is shared with the worker, and gunicorn binds Railway's $PORT. Queries run on the worker, so a slow query never blocks the UI.
Agent contract
- Public URL:
REDASH_HOST(https://), on theredashservice - Private URL:
http://redash.railway.internal:8080 - Credentials:
REDASH_ADMIN_EMAILandREDASH_ADMIN_PASSWORD(browser sign-in at/login),REDASH_ADMIN_API_KEY(admin API key), all on theredashservice. The bundled database password isPOSTGRES_PASSWORDon thepostgresservice. - Auth: send the API key as
Authorization: Key; anonymous calls are rejected - Health:
GET /pingreturns 200PONGwith no auth
# run with REDASH_HOST, REDASH_ADMIN_API_KEY (redash service) and POSTGRES_PASSWORD (postgres service)
AUTH="Authorization: Key $REDASH_ADMIN_API_KEY"
# 1. who am I (admin)
curl -s -H "$AUTH" "$REDASH_HOST/api/session" | jq '.user | {email, permissions}'
# 2. connect the bundled Postgres as a data source (reuse it if it already exists)
DS=$(curl -s -H "$AUTH" "$REDASH_HOST/api/data_sources" | jq '[.[] | select(.name=="bundled-postgres") | .id][0] // empty')
[ -n "$DS" ] || DS=$(curl -s -H "$AUTH" -H 'Content-Type: application/json' "$REDASH_HOST/api/data_sources" \
-d "{\"name\":\"bundled-postgres\",\"type\":\"pg\",\"options\":{\"host\":\"postgres.railway.internal\",\"port\":5432,\"user\":\"postgres\",\"password\":\"$POSTGRES_PASSWORD\",\"dbname\":\"postgres\"}}" | jq .id)
# 3. run a query on the worker and poll the job
JOB=$(curl -s -H "$AUTH" -H 'Content-Type: application/json' "$REDASH_HOST/api/query_results" \
-d "{\"data_source_id\":$DS,\"query\":\"select count(*) as users from users\",\"max_age\":0}" | jq -r '.job.id')
until [ "$(curl -s -H "$AUTH" "$REDASH_HOST/api/jobs/$JOB" | jq -r '.job.status')" = 3 ]; do sleep 1; done
QR=$(curl -s -H "$AUTH" "$REDASH_HOST/api/jobs/$JOB" | jq -r '.job.query_result_id')
curl -s -H "$AUTH" "$REDASH_HOST/api/query_results/$QR" | jq '.query_result.data.rows'
Alerts by email need an SMTP server, which only you can supply: add REDASH_MAIL_SERVER, REDASH_MAIL_USERNAME, REDASH_MAIL_PASSWORD and REDASH_MAIL_DEFAULT_SENDER to the redash and redash-worker services. Slack, webhook and the other destinations work without it.
Why Deploy Redash on Railway?
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 Redash 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.
- Agent-ready — generated credentials, a contract block and one working script; no browser step.
- Complete stack — web, worker, scheduler, PostgreSQL and Redis wired together; no compose file to translate.
- Data survives redeploys — dashboards and queries live on the Postgres volume, and the admin and API key stay the same.
- Zero configuration — no variables to fill in; every host and secret is wired for you.
Common Use Cases
- Team dashboards — chart production data from Postgres, MySQL, BigQuery and dozens of other sources and share one URL.
- AI agent reporting — let an agent create queries and read results over the API instead of scraping a UI.
- Scheduled reports and alerts — refresh queries on a schedule and alert when a number crosses a threshold.
Dependencies for Redash Hosting
- PostgreSQL with a volume at
/var/lib/postgresql(included in this template). - Redis with a volume at
/data(included in this template).
Deployment Dependencies
- getredash/redash — upstream project
- redash on Docker Hub — the pinned image this template deploys
Template Content
postgres
postgres:17.10-trixieredash-worker
redash/redash:26.9.0redis
redis:8.8.1-trixieredash
redash/redash:26.9.0