---
title: "Deploy pg-pinecone"
description: "Open-source search on Postgres"
category: "Storage"
url: https://railway.com/deploy/pg-pinecone
---

# Deploy pg-pinecone

Open-source search on Postgres

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

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/pg-pinecone/manifest.json

- **Creator:** Pinecone
- **Category:** Storage

## Template content

### pg-pinecone

- **Image:** pineconeteam/pg_pinecone:pg18
- **Start command:** `/bin/sh -c 'unset PGHOST PGPORT; mkdir -p /docker-entrypoint-initdb.d; printf "%s\n" "CREATE EXTENSION IF NOT EXISTS vector;" "CREATE EXTENSION IF NOT EXISTS pg_pinecone;" > /docker-entrypoint-initdb.d/00-pg-pinecone.sql; exec docker-entrypoint.sh postgres -c shared_preload_libraries=pg_pinecone --port=5432'`

## Documentation

# Deploy and Host pg_pinecone on Railway

[pg_pinecone](https://github.com/pinecone-io/pg_pinecone) is an open-source Postgres extension for vector & full-text search on the data you already store, built on the engine Pinecone runs at scale. You use the same SQL as pgvector. A filter such as a tenant applies during the search, and the rows stay in Postgres. When a table needs more scale, send its search to Pinecone as a [remote backend](https://www.pinecone.io/blog/introducing-pg-pinecone/). Your queries stay the same.

## About Hosting pg_pinecone

This template deploys PostgreSQL 18 with pg_pinecone installed. Railway keeps the data on a volume and gives you a connection URL. The `railway` database already has the extensions enabled.

Use `DATABASE_URL` from other services in the project. Use `DATABASE_PUBLIC_URL` from your own computer.

```sql
CREATE TABLE items (
    id bigint PRIMARY KEY,
    embedding vector(3)
);

INSERT INTO items VALUES (1, '[1,2,3]'), (2, '[4,5,6]'), (3, '[7,8,9]');

SELECT pinecone.create_index('items', 'embedding');

SELECT id FROM items ORDER BY embedding <=> '[1,2,4]' LIMIT 2;
```

That search runs inside Postgres.

A Pinecone API key adds a few optional tools. Turn them on one at a time:

- A remote backend, when you need more scale
- `embed()`, to turn text into vectors from SQL
- Keyword search, and search that combines keywords with vectors
- `rerank()`, to put the best results first

## Common Use Cases

- Find the records behind a support assistant, a recommendation, or an agent that remembers past work
- Search by meaning, by keyword, or by both in one query
- Limit a search to one tenant, user, or category while still filling the result list
- Keep embeddings in Postgres, and send search to a remote backend when a table needs more scale

## Dependencies for pg_pinecone Hosting

The image includes PostgreSQL 18 and pg_pinecone. For the product itself, refer to more information here:

- [Introducing pg_pinecone](https://www.pinecone.io/blog/introducing-pg-pinecone/)
- [pg_pinecone on GitHub](https://github.com/pinecone-io/pg_pinecone)
- [Documentation](https://docs.pinecone.io/guides/pg-pinecone/overview) and [quickstart](https://docs.pinecone.io/guides/pg-pinecone/quickstart)
- Docker image: [pineconeteam/pg_pinecone](https://hub.docker.com/r/pineconeteam/pg_pinecone)

## Why Deploy pg_pinecone on Railway

You get search inside Postgres from one deploy. Connect with the URL Railway gives you, query with the SQL you already use, and add Pinecone as a remote backend when you need more scale.

## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

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