Deploy pgvector 18 trixie

Open-source vector similarity search for Postgres

Deploy pgvector 18 trixie

Just deployed

/var/lib/postgresql

Deploy and Host pgvector on Railway

run the following SQL in your database

CREATE EXTENSION IF NOT EXISTS vector;

Connect with: Postgres.Variables. DATABASE_PUBLIC_URL

A fork of Railway's Postgres 17 with Postgres 18 and pgvector support. Everything is working the same as the original Railway Postgres including UIs, connection management, and more.

pgvector is a powerful open-source extension for PostgreSQL that enables vector similarity search, making it ideal for AI and machine learning applications. Built on Postgres 18, this deployment combines the latest PostgreSQL features with native support for storing and querying high-dimensional vectors.

About Hosting pgvector

Hosting pgvector involves provisioning a managed PostgreSQL instance with the pgvector extension pre-installed, configuring storage, networking, and security settings, and ensuring automated backups and updates. Deploying on a platform like Railway abstracts away much of the operational complexity, providing developers with easy access to database endpoints, monitoring, and scaling options. With minimal setup, you can focus on building your AI-powered application while Railway manages infrastructure, uptime, and maintenance for your vector database.

Common Use Cases

  • Semantic search and similarity matching for text, images, and other embeddings
  • Retrieval-Augmented Generation (RAG) for LLM applications
  • Recommendation systems and personalization engines
  • Anomaly detection and clustering in high-dimensional data

Dependencies for pgvector Hosting

  • Railway account: Required to create and manage projects and databases.
  • Postgres client tools: Such as psql or compatible GUI clients for database administration.
  • Embedding model: An API or local model (e.g., OpenAI, Cohere, or open-source alternatives) to generate vectors for storage.

Deployment Dependencies

Implementation Details

# Using Railway CLI to create a new pgvector database
railway add plugin postgresql-pgvector@18

Or, using the Railway web dashboard, add a new Postgres plugin with pgvector and select version 18 during setup.

-- Enable the pgvector extension after connecting
CREATE EXTENSION IF NOT EXISTS vector;

-- Create a table with a vector column
CREATE TABLE items (
  id SERIAL PRIMARY KEY,
  content TEXT,
  embedding vector(1536)
);

-- Create an index for fast similarity search
CREATE INDEX ON items USING ivfflat (embedding vector_cosine_ops);

Why Deploy 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 pgvector on Railway, you get a production-ready vector database for your AI applications with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

View Template
peppermint
Docker-compose port for peppermint.sh