---
title: "Deploy ParadeDB"
description: "ParadeDB: Postgres with BM25 full-text search, vector retrieval & analytics"
category: "Storage"
url: https://railway.com/deploy/paradedb-railway
---

# Deploy ParadeDB

ParadeDB: Postgres with BM25 full-text search, vector retrieval & analytics

**[Deploy ParadeDB on Railway](https://railway.com/template/paradedb-railway)**

- **Creator:** A3A
- **Category:** Storage

## Template content

### paradedb https://devicons.railway.com/i/paradedb.svg

- **Source:** https://github.com/gridalpha/paradedb-railway
- **Health check:** /healthz

## Buckets

- **paradedb-backups**

## Documentation

![ParadeDB logo](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRT3m1-ofjY9O_0erY71BjhspX_CuazZShRDEmdvzR2U65ypU_H3PSSWUM&s=10)

# Deploy and Host ParadeDB on Railway

ParadeDB is a PostgreSQL distribution that puts a real search engine inside the database. It ships `pg_search`, an index built on the Rust Tantivy library, giving Postgres BM25 relevance scoring, phrase and fuzzy matching, snippet highlighting and faceted aggregations — what teams normally add an Elasticsearch cluster for. The index is maintained by Postgres transactions: no ETL job, no lag between a write and its appearance in results, no second system to secure and upgrade. It also bundles `pgvector`, `pg_ivm`, PostGIS and `pg_cron`, so hybrid keyword-and-vector retrieval is one SQL query.

Deploy ParadeDB on Railway and you get PostgreSQL 18 with those extensions preloaded, a persistent volume, TLS on the wire, and a public TCP endpoint for `psql`, an ORM or a migration job. Backups come wired: every WAL segment is archived to a Railway object storage bucket as it closes and a base backup is taken daily, through the Barman Cloud tooling ParadeDB ships in its image. Self-host ParadeDB without that plumbing and you configure `archive_command`, memory and certificates by hand.

![The ParadeDB service online with its Postgres data volume](https://res.cloudinary.com/rroe4rtk/image/upload/v1788268394/paradedb-architecture.png)

## Getting Started with ParadeDB on Railway

ParadeDB has no web interface — it is a database, reached over the PostgreSQL wire protocol. When the deploy finishes, open the service's **Variables** tab and copy `DATABASE_PUBLIC_URL`, which connects through the public TCP proxy as a least-privilege role; services in the same project use the private `DATABASE_URL`. Run `psql "$DATABASE_PUBLIC_URL"` then `SELECT extname, extversion FROM pg_extension;` — `pg_search`, `vector`, `pg_ivm`, `postgis` and `pg_stat_statements` are already there. Railway's **Data** tab also browses tables with no local client.

Then index a table and query it with the match operators — `|||` is "any of these terms", `&&&` is "all of them", and `pdb.score(id)` exposes the BM25 score.

```
CREATE TABLE articles (id bigserial PRIMARY KEY, title text, body text, rating int);

CREATE INDEX articles_search ON articles
USING paradedb (id, title, body, rating) WITH (key_field='id');

SELECT title, pdb.score(id) AS score
FROM articles
WHERE body ||| 'postgres replication' AND rating > 2
ORDER BY score DESC LIMIT 10;
```

Two roles exist. `postgres` is the superuser, for extensions, `pg_cron` jobs and administration. `app` owns the `public` schema and is what `DATABASE_URL` points at: it can create tables, migrate and install trusted extensions, but cannot create roles or databases or read password hashes.

## About Hosting ParadeDB

Postgres has had full-text search for years, but `tsvector` ranking is not BM25: no term-frequency saturation, no document-length normalization, poor behaviour on large corpora. That gap is why so many applications run Postgres *and* Elasticsearch.

- **BM25 relevance** with tokenizers, stemming, token filters and snippet highlighting
- **Hybrid search** — BM25 rankings fused with `pgvector` similarity in one query
- **Filtered search** — a match predicate beside ordinary `WHERE`, `JOIN` and `GROUP BY`
- **Aggregations and facets** over columnar storage, for counts by category or date bucket
- **PostGIS and `pg_cron`** included, so geospatial filters and scheduled reindexing need nothing extra

The deployment is one service: the container holds the cluster on a volume at `/var/lib/postgresql`, exposes 5432 through a TCP proxy, and serves an internal health endpoint that runs a real query rather than checking the process exists. A bucket holds the WAL archive and base backups.

## Why Deploy ParadeDB on Railway

Railway removes the operational work of a self-managed search database.

- One-click deploy with the cluster on a persistent volume
- Continuous WAL archiving and daily base backups to a bucket
- Memory and parallelism sized from the container's real limits
- TLS and a public TCP endpoint provisioned for you
- Private networking for services in the same project
- Vertical scaling without a migration

## Common Use Cases

- **Replacing an Elasticsearch sidecar** in an app already running Postgres, removing the sync job
- **Retrieval for AI applications** — BM25 and vector similarity fused in one query
- **In-app search** for docs sites, catalogues and knowledge bases needing ranking and facets
- **Log and event exploration**, with columnar aggregates counting over the table being searched

## Dependencies for ParadeDB

- **ParadeDB** — `paradedb/paradedb:latest-pg18`, built from [github.com/gridalpha/paradedb-railway](https://github.com/gridalpha/paradedb-railway): PostgreSQL 18 with `pg_search`, `pgvector`, `pg_ivm`, PostGIS, `pg_cron` and `pg_stat_statements` preloaded.
- **Object storage bucket** — the WAL archive and base backups written by Barman Cloud.

### Environment Variables Reference

| Variable | Purpose |
|---|---|
| `POSTGRES_USER` / `POSTGRES_PASSWORD` | Superuser, created on the volume's first boot |
| `POSTGRES_DB` | Database created on first boot |
| `APP_DB_USER` / `APP_DB_PASSWORD` | Least-privilege role behind `DATABASE_URL` |
| `DATABASE_URL` | Private connection string for services in this project |
| `DATABASE_PUBLIC_URL` | Public connection string through the TCP proxy |
| `BACKUP_INTERVAL_HOURS` / `BACKUP_RETENTION_DAYS` | Backup cadence and recovery window, `24` and `7` |
| `PARADEDB_SSL` | Set to `off` to run without TLS |

### Deployment Dependencies

- Image: [hub.docker.com/r/paradedb/paradedb](https://hub.docker.com/r/paradedb/paradedb) · Project: [github.com/paradedb/paradedb](https://github.com/paradedb/paradedb) · Docs: [paradedb.com/docs](https://www.paradedb.com/docs)

## Hardware Requirements for Self-Hosting ParadeDB

| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 4+ vCPU — index builds and search parallelize |
| RAM | 1 GB | 8 GB+; about a quarter goes to `shared_buffers` |
| Storage | 5 GB volume | Data plus the BM25 index, roughly 20–40% of the indexed text |
| Runtime | PostgreSQL 18 | PostgreSQL 18, `pg_search` preloaded |

Memory and parallelism are derived from the container's real limits on every start, so resizing retunes the database.

## Self-Hosting ParadeDB Outside Railway

The published image is a drop-in Postgres. Under Docker, with a named volume:

```
docker run -d --name paradedb \
  -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=changeme -e POSTGRES_DB=paradedb \
  -p 5432:5432 -v paradedb_data:/var/lib/postgresql \
  paradedb/paradedb:latest-pg18
```

Existing data moves across with the standard Postgres tools:

```
pg_dump -Fc --no-acl --no-owner -h old-host -U olduser olddb > old_db.dump
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d paradedb -Fc old_db.dump
```

Give the container more than Docker's default 64 MB of shared memory (`--shm-size=1g`) or set `dynamic_shared_memory_type=mmap`, or parallel queries fail once they outgrow `/dev/shm`.

## Is ParadeDB Free?

ParadeDB Community is open source under AGPL-3.0 and is what this template runs — every feature above is free. ParadeDB Enterprise is a paid product adding high availability and read replicas, deployed through Kubernetes or bring-your-own-cloud. On Railway you pay only for the compute, volume and storage used.

## ParadeDB vs Elasticsearch

| | ParadeDB | Elasticsearch |
|---|---|---|
| Data location | Your Postgres tables | A separate cluster to keep in sync |
| Consistency | Transactional; a committed row is searchable | Refresh-interval delayed |
| Query language | SQL, with joins and aggregates | Query DSL, limited joins |
| Operations | One database to back up and upgrade | A second stateful system to tune |

Elasticsearch still wins on corpora spread over many nodes. Below that, keeping search in the database removes a moving part from the stack.

## FAQ

**What is ParadeDB?**
A PostgreSQL distribution with `pg_search`, a Rust-based index adding BM25 full-text search, facets and hybrid vector search to Postgres.

**What does this Railway template deploy?**
One ParadeDB service running PostgreSQL 18 on a persistent volume, exposed over a TCP proxy with TLS, plus a bucket holding WAL archives and daily base backups.

**Why does the template include an object storage bucket?**
Point-in-time recovery needs a base backup and the WAL written since. The bucket holds both, so the database restores to any moment in the retention window.

**How do I connect my application to self-hosted ParadeDB?**
Use `${{ParadeDB.DATABASE_URL}}` from another service in the same project: it resolves to the private address and authenticates as the `app` role, which owns `public` and can run migrations.

**Do I have to rewrite my queries to use ParadeDB?**
No — it is ordinary Postgres, so existing queries, migrations and ORMs keep working. Search is opt-in: index the columns you want searchable and add the match operators. Official adapters exist for Django, SQLAlchemy, Drizzle, Rails and EF Core.

**Can I run ParadeDB with read replicas or automatic failover?**
Not in the open-source build: replication and high availability are ParadeDB Enterprise features. This is a single node whose durability story is the volume plus the bucket.


## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/paradedb-railway
