Analytics cookies only (Google Analytics, PostHog). No ad networks, no cross-site tracking. See our privacy policy.
Updated Nov 2026
verified on Ubuntu 26.04 · Nov 2026Self-host Redash 26.9.0 with Docker Compose, PostgreSQL and Redis on a 4 GB VPS — generated secrets, a loopback port behind Caddy HTTPS, the first-admin setup page, backups.
Redash is a SQL-first data exploration and dashboard tool. You connect it to databases, warehouses and APIs, write queries in a browser editor with a schema browser, turn the results into visualizations, assemble those into dashboards, schedule queries to refresh and set alerts on query results. It is a Python (Flask) server with a React frontend, it is BSD-2-Clause licensed, and it keeps its own metadata in PostgreSQL and its job queues in Redis. It is rated 3 / 5 to deploy.
The rating is about the shape of the stack, not any one step. Upstream's
reference setup (the getredash/setup repository, the same one behind its
cloud images) runs a web server, a scheduler and several workers from one
image, plus Redis and PostgreSQL, and the database tables are created by a
separate one-off command before the first start. The first browser visit then
shows a setup page that creates the administrator, so whoever reaches it
first owns the instance; this guide gets HTTPS in place before you open it.
If you want a broader BI tool with a semantic layer, compare
Metabase and Superset; the
Redash vs Metabase comparison covers the
trade-off.
Upstream's setup page (kb/open-source/setup) says: "For basic deployments
we recommend a minimum of 4GB of RAM and reasonable amount of CPU
allocation", and that more RAM and CPU will be needed as usage grows. It gives
no disk figure. The memory goes to a gunicorn server with four web workers
(REDASH_WEB_WORKERS: 4 in upstream's compose file), a scheduler, three
worker containers, Redis and PostgreSQL.
In our install check (GCP e2-standard-2, Ubuntu 26.04, November 2026),
measured about six minutes after docker compose up, five minutes after the
administrator was created, with no queries or data sources and nobody using
it, the whole stack held about 2.9 GB of RAM (the web server about 930 MB, the
three workers 495 to 725 MB each, the scheduler about 245 MB, and PostgreSQL
and Redis under 40 MB between them), with Caddy adding about 14 MB, and
about 3.3 GB of Docker disk, almost all of it the four images. A 2 GB plan
does not leave room for that plus your queries' result sets.
Install Docker and the Compose plugin by following Docker and Compose on Ubuntu, and confirm the versions:
docker --version
docker compose version
Open SSH plus the two ports Caddy will use. Redash itself gets no public port:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw --force enable
Docker publishes container ports by editing the firewall directly, which
bypasses ufw rules. That is why the compose file below binds Redash's port
to 127.0.0.1. Upstream's own reference compose publishes 5000:5000 and
puts an nginx container on port 80; this guide drops that nginx and lets
Caddy do the job.
Paid link — we earn a commission if you shop through it.
Create an A record for your hostname (say redash.example.com) pointing
at the server. With no domain yet, an sslip.io name resolves to your
server's IP with no DNS setup, which is what this guide uses so every command
runs as written:
DOMAIN="redash.$(curl -4s https://ifconfig.me).sslip.io"
echo "$DOMAIN"
Keep this shell session open (or re-run the line) for the rest of the guide, and replace the value with your real hostname when you have one. The next step writes it into the configuration.
Upstream's setup.sh generates the environment file with pwgen; this does
the same with openssl, and adds two lines for running behind a TLS proxy.
The block only writes .env if it does not exist, so re-running it cannot
rotate the secrets under a live database:
mkdir -p ~/redash && cd ~/redash
if [ ! -f .env ]; then
PG_PASSWORD=$(openssl rand -hex 16)
cat > .env <<EOF
PYTHONUNBUFFERED=0
REDASH_LOG_LEVEL=INFO
REDASH_REDIS_URL=redis://redis:6379/0
REDASH_COOKIE_SECRET=$(openssl rand -hex 16)
REDASH_SECRET_KEY=$(openssl rand -hex 16)
POSTGRES_PASSWORD=$PG_PASSWORD
REDASH_DATABASE_URL=postgresql://postgres:$PG_PASSWORD@postgres/postgres
REDASH_ENFORCE_CSRF=true
REDASH_GUNICORN_TIMEOUT=60
REDASH_HOST=https://$DOMAIN
REDASH_ENFORCE_HTTPS=true
EOF
fi
chmod 600 .env
The first nine settings are upstream's generated file. The two secrets matter
more than they look. Redash's settings module refuses to start without
REDASH_COOKIE_SECRET (it signs the session cookie, and the
invitation and password-reset tokens), and REDASH_SECRET_KEY is what
encrypts the settings on the Data Sources and Alert Destinations screens,
which is where your database passwords live. Lose or change the latter
without re-encrypting and those saved settings can no longer be decrypted, so
.env is part of your backups.
The last two are ours. REDASH_HOST is the public address Redash puts in the
links of alert and invitation mails; its default is empty. REDASH_ENFORCE_HTTPS
turns on the redirect from HTTP to HTTPS, which also turns on secure cookies
and the HSTS header by default (each has its own override). Behind Caddy that
is right, because Redash reads the forwarded protocol: its app wraps the
WSGI app in werkzeug's ProxyFix, which by default trusts one
X-Forwarded-Proto hop, the one Caddy sets. (REDASH_PROXIES_COUNT, default
1, is passed to ProxyFix as the number of X-Forwarded-For hops, so it
governs client IP addresses only.)
Now the compose file. It is upstream's with these deliberate changes: a
pinned redash/redash:26.9.0 in place of the __TAG__ placeholder; the
nginx container removed; the server port bound to loopback instead of
published on every interface; env_file: .env in place of
/opt/redash/env; restart: unless-stopped on the Redash services in place
of restart: always; depends_on: server added to the worker service, as
the other workers already have; a pg_isready healthcheck added to
PostgreSQL (which is what --wait uses below); and PostgreSQL data on a named
volume instead of /opt/redash/postgres-data. Upstream's
redis:7-alpine and pgautoupgrade/pgautoupgrade:17-alpine tags are kept;
upstream's comment on the latter says it fixes PostgreSQL at 17 on purpose
"to avoid automatic upgrade to v18 (or later)".
cd ~/redash
cat > docker-compose.yml <<'EOF'
x-redash-service: &redash-service
image: redash/redash:26.9.0
depends_on:
- postgres
- redis
env_file: .env
restart: unless-stopped
services:
server:
<<: *redash-service
command: server
ports:
- "127.0.0.1:5000:5000"
environment:
REDASH_WEB_WORKERS: 4
scheduler:
<<: *redash-service
command: scheduler
depends_on:
- server
scheduled_worker:
<<: *redash-service
command: worker
depends_on:
- server
environment:
QUEUES: "scheduled_queries,schemas"
WORKERS_COUNT: 1
adhoc_worker:
<<: *redash-service
command: worker
depends_on:
- server
environment:
QUEUES: "queries"
WORKERS_COUNT: 2
worker:
<<: *redash-service
command: worker
depends_on:
- server
environment:
QUEUES: "periodic,emails,default"
WORKERS_COUNT: 1
redis:
image: redis:7-alpine
restart: unless-stopped
postgres:
image: pgautoupgrade/pgautoupgrade:17-alpine
env_file: .env
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 3s
timeout: 3s
retries: 20
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
EOF
The server's gunicorn binds to [::]:5000 inside the container by default
(REDASH_GUNICORN_BIND changes it), so the host-side 127.0.0.1: prefix is
what keeps it off the internet. The three worker services split the queues
the same way upstream does: scheduled queries and schema refreshes, ad-hoc
queries (two workers), and periodic, email and default jobs.
Start PostgreSQL and Redis first, then create the tables. Upstream's setup
script runs create_db exactly once, before starting everything; it is a
fresh-install step, not something to repeat on a live database:
cd ~/redash
docker compose up -d --wait postgres redis
docker compose run --rm server create_db
docker compose up -d
out=000
for i in $(seq 1 60); do
out=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:5000/ping)
[ "$out" = "200" ] && break
sleep 5
done
docker compose ps
echo "/ping over loopback: $out"
[ "$out" = "200" ] || false
/ping is the one route Redash exempts from the HTTPS redirect, which is why
a plain-HTTP health check on loopback works even with
REDASH_ENFORCE_HTTPS=true. Upstream's README warns that the first page
load can take a while because Python code is compiled in the background.
Run Caddy as a container on the host network. It obtains and renews a Let's Encrypt certificate on its own (see Automatic HTTPS with Caddy) and proxies to the loopback port:
mkdir -p ~/caddy
cat > ~/caddy/Caddyfile <<EOF
$DOMAIN {
reverse_proxy 127.0.0.1:5000
}
EOF
docker rm -f caddy >/dev/null 2>&1 || true
docker run -d --name caddy --restart unless-stopped --network host \
-v ~/caddy/Caddyfile:/etc/caddy/Caddyfile:ro -v caddy_data:/data caddy:2
Caddy's reverse_proxy needs no header configuration: it passes Host
through and sets X-Forwarded-For, X-Forwarded-Proto and
X-Forwarded-Host, which is what Redash's ProxyFix reads.
Check that HTTPS answers with a trusted certificate, retrying while the
certificate is issued. A fresh instance redirects / to /setup, so the
request follows redirects and requires the final page to be 200:
out=000
for i in $(seq 1 24); do
out=$(curl -sL -o /dev/null -w '%{http_code} %{ssl_verify_result} %{url_effective}' "https://$DOMAIN/") && [ "${out%% *}" = "200" ] && break
sleep 5
done
echo "Redash over HTTPS: $out"
[ "${out%% *}" = "200" ] || false
A second field of 0 means the certificate verified, and the final URL
ending in /setup shows the instance is waiting for its first administrator.
Open https://redash.example.com (your hostname) now, before you share
the address. The /setup page asks for a name, an email address, a password
(at least six characters) and an organization name, and creates the first
user in the built-in admin group. It only answers while no organization
exists; once one does, /setup redirects to the login page. Whoever submits
it first owns the instance, which is why HTTPS came first.
We submitted this form on the test server with a throwaway name and an
example.com address: it answered 302 to /, the session API then
reported the new user with the admin permission, and an anonymous request to
/setup was sent on to the login page. Two things to know about that form. It has two tick boxes, security
notifications and newsletter, both ticked by default. In the 26.9.0 code the
handler calls subscribe on form.newsletter.data or form.security_notifications,
and the second operand is the field object, which is always truthy, so the
request goes out whichever way you tick them: a background job posts your
name, email and organization name to https://version.redash.io/subscribe.
If that is not acceptable on your network, block that host in your egress
rules before you submit the form. Separately, Redash schedules a daily
version check (REDASH_VERSION_CHECK, default true, set it to false to
turn the job off), and an admin is later asked for consent before any usage
report is sent.
After setup you land in the app as the admin. Add your first data source
under Settings, then Data Sources. Redash blocks private addresses for its
JSON query runner by default (REDASH_ENFORCE_PRIVATE_IP_BLOCK, default
true). Custom JavaScript visualizations are off by default in 26.9.0
(REDASH_FEATURE_ALLOW_CUSTOM_JS_VISUALIZATIONS); enable that only for chart
authors you trust, because upstream's release notes say such code runs with
the viewer's session privileges.
The data that matters is in one database, plus two files:
pg_dump is the
portable copy..env: it holds REDASH_SECRET_KEY, without which those encrypted
settings in the dump cannot be decrypted, and REDASH_COOKIE_SECRET.docker-compose.yml, which pins the version.cd ~/redash
mkdir -p ~/redash-backup
docker compose exec -T postgres pg_dump -U postgres postgres | gzip > ~/redash-backup/redash-$(date +%F).sql.gz
cp .env docker-compose.yml ~/redash-backup/
chmod 600 ~/redash-backup/.env
gzip -t ~/redash-backup/redash-$(date +%F).sql.gz
ls -lAh ~/redash-backup
Copy these off the server to object storage or another machine on a
schedule, and treat the copy of .env like the secret it is.
An untested backup is a guess. This restores the newest dump into a scratch
database in the running stack, counts the restored tables and drops it again.
It does not touch the live postgres database:
cd ~/redash
f=$(ls -t ~/redash-backup/redash-*.sql.gz | head -1)
docker compose exec -T postgres dropdb -U postgres --if-exists restoretest
docker compose exec -T postgres createdb -U postgres restoretest
gunzip -c "$f" | docker compose exec -T postgres psql -U postgres -d restoretest -v ON_ERROR_STOP=1 -q -o /dev/null
docker compose exec -T postgres psql -U postgres -d restoretest -tAc "select count(*) from information_schema.tables where table_schema = 'public'"
docker compose exec -T postgres dropdb -U postgres restoretest
For a real restore, bring up an empty stack with the same .env and compose
file, start only postgres, skip create_db (the dump already contains the
tables), load the dump into the postgres database with the same
gunzip -c ... | docker compose exec -T postgres psql -U postgres -d postgres
pipe, then start the rest. We ran the scratch restore against a dump taken
after the administrator existed, and the user and organization rows came
back. We did not rehearse the full empty-stack restore.
Upstream's upgrade page asks you to back up the PostgreSQL database and
.env first, then update the image reference, stop the Redash services,
apply any migration with docker compose run --rm server manage db upgrade,
and start the services again. It also says: "For best results you should
upgrade Redash by one semantic version at a time", and to read the releases
page for notices between each step. The 26.9.0 release notes add that the web
application, scheduler and all workers must be upgraded together, that
26.9.0 itself adds no migrations relative to v26.3.0, and that it disables
custom JavaScript charts by default and tightens query permissions.
cd ~/redash
sed -i 's|redash/redash:26.9.0|redash/redash:NEW_VERSION|' docker-compose.yml
docker compose pull
docker compose stop server scheduler scheduled_worker adhoc_worker worker
docker compose run --rm server manage db upgrade
docker compose up -d
Move the pin yourself rather than tracking a floating tag. All five Redash
services share the one image line through the x-redash-service anchor, so
one edit moves them together. PostgreSQL is a separate decision: the
pgautoupgrade image is pinned at 17, and the comment in upstream's compose
file points to the pgautoupgrade project's own one-shot upgrade guide for
moving to 18 (that guide is pgautoupgrade's, not Redash's).
The server container restarts at once. Run docker compose logs server.
A message saying you must set REDASH_COOKIE_SECRET means .env is empty or
lacks that line. A .env that is missing altogether stops Compose before it
starts anything, with env file ... .env not found, and leaves running
containers as they were.
The first page load is slow. Upstream's README says the first load can take a while while Python code compiles in the background; later visits are fast.
Redirect loop or http:// links. Redash decides the scheme from the
X-Forwarded-Proto header of one proxy hop, and REDASH_ENFORCE_HTTPS=true
redirects anything that arrives as HTTP. If the header does not reach Redash
(a second proxy that drops it, or a request that bypasses Caddy), you get a
loop. REDASH_PROXIES_COUNT will not fix it: it counts X-Forwarded-For hops
and affects client IP addresses only. Make every proxy in front of Redash
pass X-Forwarded-Proto through.
Queries sit in "waiting". The workers are not running or not on the right
queues. docker compose ps should list adhoc_worker, scheduled_worker and
worker as running, and docker compose logs adhoc_worker shows the queue
names it listens on.
Mail links point at the wrong host. REDASH_HOST still names the old
sslip.io address. Edit it in .env and docker compose up -d to recreate
the containers.
Port 5000 is reachable from the internet. The port line lost its
127.0.0.1: prefix. Fix the compose file, docker compose up -d, then check
that ss -tln | grep 5000 shows 127.0.0.1.
Certificate never issues. That is a Caddy and DNS problem rather than a
Redash one: confirm the A record resolves (dig +short redash.example.com)
and that ports 80 and 443 are reachable. Look at docker logs caddy.
You are done when https://redash.example.com loads with a valid
certificate, you have created the administrator on /setup, port 5000 is
bound only to 127.0.0.1, all seven Redash-stack containers are running
and not restarting, and the database dump and .env are landing off the
server.
From here, add a data source with a read-only database user, invite your team by email once you have configured a mail server, and set a schedule on the queries that feed your dashboards. If a SQL-and-dashboards tool turns out to be more than you need, Metabase offers a point-and-click query builder, and Grafana is the usual choice for time-series and monitoring dashboards.
We estimate about 40 minutes of hands-on time for "How to Deploy Redash on a VPS"; this is an editorial estimate, not a measurement.
The "How to Deploy Redash on a VPS" guide was verified end-to-end on Ubuntu 26.04 (Nov 2026).