Railway

Deploy PostgreSQL Extensions

PostgreSQL + pgvector, postgis, pg_trgm, pgmq, pg_cron, pgcrypto and more.

Deploy PostgreSQL Extensions

Just deployed

/var/lib/postgresql

Deploy and Host PostgreSQL Extensions on Railway

PostgreSQL Extensions is a production-ready PostgreSQL 18 Docker image with 11 popular extensions pre-installed including pgvector, PostGIS, pgmq, pg_cron, and more. Enable any combination at deploy time with a single environment variable. No compilation or manual setup.

About Hosting PostgreSQL Extensions

Hosting PostgreSQL with extensions typically requires compiling C libraries from source, managing shared library paths, configuring shared_preload_libraries, and ensuring extensions are created in the right databases. This template handles all of that automatically. Extensions are pre-compiled into the image, and a lightweight entrypoint script validates your selection, configures preloaded libraries, and runs CREATE EXTENSION IF NOT EXISTS on boot. SSL is enabled by default with auto-generated certificates. Just set the EXTENSIONS environment variable and deploy.

Environment Variables

  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • POSTGRES_DB
  • EXTENSIONS

Common Use Cases

  • AI/ML applications using pgvector for vector similarity search and embeddings storage (RAG, recommendations)
  • Location-aware apps using PostGIS for geospatial queries (nearby search, geofencing)
  • Background job scheduling with pg_cron (cleanup tasks, report generation, data aggregation)
  • Event-driven architectures using pgmq as a lightweight message queue directly in PostgreSQL
  • Full-text fuzzy search with pg_trgm for typo-tolerant autocomplete and search
  • Time-series data with pg_partman for automated table partitioning and retention policies

Dependencies for PostgreSQL Extensions Hosting

  • Docker (the image is hosted on GitHub Container Registry at ghcr.io/karan316/postgres-extensions)
  • A persistent volume mounted at /var/lib/postgresql

Deployment Dependencies

Why Deploy PostgreSQL Extensions on Railway?

  • Railway makes it easy to run PostgreSQL with one click deployment.
  • This template adds the extensions many teams would need including vector search, geospatial queries, job scheduling, message queues without maintaining a custom Dockerfile or compiling anything yourself.

Template Content

More templates in this category

View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
View Template
Postgres Backup to Cloudflare R2 (S3-Compatible)
Automated PostgreSQL backups to S3-compatible storage with encryption

Artour
View Template
ReadySet
A lightweight caching engine for Postgres

Milo