# Self-host pgvector Postgres

> PostgreSQL 17 with the pgvector extension preinstalled, for embeddings next to your relational data.

- Page: https://levelrail.com/templates/pgvector/
- JSON: https://levelrail.com/templates/pgvector.json
- Category: Database Tools
- Licence: PostgreSQL (Permissive license)
- Source: https://github.com/pgvector/pgvector
- Upstream docs: https://github.com/pgvector/pgvector

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 0.8.6-pg17-trixie

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| pgvector | pgvector/pgvector | 0.8.6-pg17-trixie | 5432 | pgvector_data -> /var/lib/postgresql/data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| pgvector | POSTGRES_DB | preset |
| pgvector | POSTGRES_PASSWORD | generated |
| pgvector | POSTGRES_USER | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy pgvector --name my-pgvector
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/pgvector/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy pgvector Postgres on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for pgvector Postgres, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image pgvector/pgvector:0.8.6-pg17-trixie is what you deploy there.

Self-host pgvector Postgres, pgvector Postgres docker compose file, deploy pgvector Postgres on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
