
Deploy TimescaleDB | (Just Updated) Postgres 17 Time-Series DB, Extension Enabled, Data Survives Redeploys
Postgres 17 + TimescaleDB, hypertables ready, data survives redeploys
timescaledb
Just deployed
/var/lib/postgresql
Deploy and Host TimescaleDB on Railway
TimescaleDB is PostgreSQL extended for time-series data: hypertables that partition automatically by time, continuous aggregates, compression and retention policies, all queried with plain SQL. This template runs the official timescale/timescaledb image (PostgreSQL 17 with the extension preinstalled) as a single service from a digest-pinned image, with the database port on a Railway TCP proxy and a Railway volume holding the data.
About Hosting TimescaleDB
- The extension is ready on first boot. The image enables
timescaledbin the default database, socreate_hypertable(...)works immediately. - A password is set from the first boot.
POSTGRES_PASSWORDis generated per deploy and a database namedrailwayis created. Clients with the wrong password are refused. - Your data survives redeploys. The volume is mounted at
/var/lib/postgresqland PGDATA stays at its default subdirectory, so thelost+foundfolder Railway puts at the volume root never lands inside the data directory. The start command runs as root so the root-owned volume is writable, and prints the user id and mount owner in the deploy log so you can confirm it. - Memory and CPU follow your plan.
shared_buffers,effective_cache_size,work_memand the worker counts are computed from the container's cgroup limits, not from the host's RAM, and the same figures feedtimescaledb-tune. - Two ways in. Services in the same project use the private URL; clients elsewhere use the TCP proxy URL.
Common Use Cases
- IoT and sensor data, metrics and observability storage
- Financial tick data and event logs
- Application analytics with continuous aggregates
- A PostgreSQL database with time-series features for any app that already speaks Postgres
Dependencies for TimescaleDB Hosting
- One Railway volume for the data directory (created by the template)
Deployment Dependencies
- TimescaleDB documentation: https://docs.timescale.com/
- Official image: https://hub.docker.com/r/timescale/timescaledb
Implementation Details
| Variable | Purpose |
|---|---|
POSTGRES_PASSWORD | Password of the postgres user, generated per deploy. |
DATABASE_PRIVATE_URL | Connection string on the private network, for services in the same project. |
DATABASE_URL | Connection string on the TCP proxy, for clients outside Railway. |
Connect from your machine:
psql "$DATABASE_URL" -c "CREATE TABLE m(t timestamptz NOT NULL, v float8); SELECT create_hypertable('m','t');"
The image sends basic anonymous telemetry by default; set timescaledb.telemetry_level=off in postgresql.conf to disable it.
Why Deploy TimescaleDB 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 TimescaleDB 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.
Template Content
timescaledb
timescale/timescaledb