Railway

Deploy Postgres 18 + PostGIS + pgvector (SSL, PITR-ready)

Deploy and Host Postgres 18 + PostGIS + pgvector (SSL, PITR-ready)

Deploy Postgres 18 + PostGIS + pgvector (SSL, PITR-ready)

Just deployed

/var/lib/postgresql/data

Deploy and Host Postgres 18 + PostGIS + pgvector on Railway

Postgres 18 with PostGIS 3.6 (geospatial) and pgvector (AI embeddings) pre-installed, built directly on Railway's official Postgres image. You inherit everything the official template ships — SSL out of the box, pgBackRest for point-in-time recovery, pg_stat_statements — and add geo and vector search with zero build steps.

About Hosting Postgres 18 + PostGIS + pgvector

Deploy this template and you get a single-node Postgres 18 service with a persistent volume, a generated password, private and public connection URLs, and a TCP proxy for external access. SSL certificates are generated and auto-renewed by the image. The image is rebuilt weekly in CI on top of Railway's postgres-ssl:18 base — picking up Postgres minors, extension updates, and Railway's pgBackRest fixes — and every build passes a boot-and-query smoke test before it's published. Activate the extensions per database with CREATE EXTENSION postgis; and CREATE EXTENSION vector;.

Common Use Cases

  • AI applications storing OpenAI/Cohere embeddings with vector similarity search (RAG, semantic search, recommendations)
  • Geospatial apps: store locations, run distance queries, geofencing, GeoJSON APIs
  • One database that does both — e.g. "find similar listings near me" without bolting a vector DB onto a geo DB

Dependencies for Postgres 18 + PostGIS + pgvector Hosting

  • A persistent Railway volume mounted at /var/lib/postgresql/data (included in the template)
  • Nothing else — extensions are baked into the image

Deployment Dependencies

Implementation Details

Enable the extensions in your database, then use them together freely:

CREATE EXTENSION postgis;
CREATE EXTENSION vector;

-- vector similarity
SELECT id FROM items ORDER BY embedding <-> '[0.1, 0.2, ...]'::vector LIMIT 10;

-- geospatial
SELECT ST_DWithin(location, ST_MakePoint(-71.06, 42.36)::geography, 5000) FROM places;

Point-in-time recovery: pgBackRest is inherited from Railway's base image and activates via the WAL_ARCHIVE_* variables (Backups tab). Image tags: rolling :18 (recommended) or immutable :18-YYYYMMDD for pinned rollbacks.

Why Deploy Postgres 18 + PostGIS + pgvector 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 Postgres 18 + PostGIS + pgvector 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

More templates in this category

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

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

Artour
7
View Template
ReadySet
A lightweight caching engine for Postgres

Milo
34