Install pgvector
pgvector supports PostgreSQL 13 and newer. You can compile it from source, or install it with Docker, a package manager, or conda-forge. Pick the method that matches your environment, then enable the extension once per database.
Requirements
- PostgreSQL 13 or newer (the Docker images ship for 13 through 18).
- For a source build: a C compiler,
make, and the PostgreSQL development headers. - Enough privileges to install files into your PostgreSQL directories (
make installmay needsudo), or permission to install packages.
v0.8.6 and use 18 as the PostgreSQL version. Replace both with the version you actually target. The latest version is available on the releases page.Download & releases
pgvector has no binary installer — it is a PostgreSQL extension you get as source, a package, or a container image. The current release is v0.8.6 (2026-07-29).
- Source: download the release from the GitHub releases, or clone the tag and build it.
- Docker:
docker pull pgvector/pgvector:pg18-trixie— tags are available for PostgreSQL 13 through 18. - Package managers: Homebrew, APT, Yum, pkg, APK, PGXN, and conda-forge.
Linux & macOS
Compile and install the extension. This is the canonical installation method and works on any Unix-like system with the PostgreSQL development files.
- Install PostgreSQL 13+ and the development files for your distribution.
- Clone the repository at the release tag.
- Build the extension with
make. - Install it with
make install(addsudoif needed).
cd /tmp
git clone --branch v0.8.6 https://github.com/pgvector/pgvector.git
cd pgvector
make
make install # may need sudo
If compilation fails with postgres.h: No such file or directory, or you have multiple PostgreSQL installations, see install troubleshooting.
Windows
Ensure C++ support in Visual Studio is installed, then open the x64 Native Tools Command Prompt for VS as administrator and build with nmake.
set "PGROOT=C:\Program Files\PostgreSQL\18"
cd %TEMP%
git clone --branch v0.8.6 https://github.com/pgvector/pgvector.git
cd pgvector
nmake /F Makefile.win
nmake /F Makefile.win install
Set PGROOT to your actual PostgreSQL installation path. Common issues (missing header, architecture mismatch, permissions) are covered in install troubleshooting.
Docker
The official image adds pgvector to the standard Postgres image. Pull a tag matching your PostgreSQL version, then run it the same way as the Postgres image.
$ docker pull pgvector/pgvector:pg18-trixie
$ docker run --name pgvector -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d pgvector/pgvector:pg18-trixie
| PostgreSQL | Tags | Short tag |
|---|---|---|
| 18 | pg18-trixie, 0.8.6-pg18-trixie, pg18-bookworm, 0.8.6-pg18-bookworm | pg18, 0.8.6-pg18 |
| 17 | pg17-trixie, 0.8.6-pg17-trixie, pg17-bookworm, 0.8.6-pg17-bookworm | pg17, 0.8.6-pg17 |
| 16 | pg16-trixie, 0.8.6-pg16-trixie, pg16-bookworm, 0.8.6-pg16-bookworm | pg16, 0.8.6-pg16 |
| 15 | pg15-trixie, 0.8.6-pg15-trixie, pg15-bookworm, 0.8.6-pg15-bookworm | pg15, 0.8.6-pg15 |
| 14 | pg14-trixie, 0.8.6-pg14-trixie, pg14-bookworm, 0.8.6-pg14-bookworm | pg14, 0.8.6-pg14 |
| 13 | pg13-trixie, 0.8.6-pg13-trixie, pg13-bookworm, 0.8.6-pg13-bookworm | pg13, 0.8.6-pg13 |
Build the image yourself
$ git clone --branch v0.8.6 https://github.com/pgvector/pgvector.git
$ cd pgvector
$ docker build --pull --build-arg PG_MAJOR=18 -t myuser/pgvector .
maintenance_work_mem, make sure the container --shm-size is at least that size, or parallel HNSW index builds can fail. For example: docker run --shm-size=1g ....Package managers
Use a package when it fits your platform. Each command installs pgvector for the named PostgreSQL version — replace 18 with your version.
Homebrew (macOS)
With Homebrew PostgreSQL, install the formula. It is added to the postgresql@18 and postgresql@17 formulas. See the formula page.
brew install pgvector
PGXN
Install from the PostgreSQL Extension Network: pgxn.org/dist/vector.
pgxn install vector
APT (Debian & Ubuntu)
Packages come from the PostgreSQL APT repository. Follow its setup instructions first, then install.
sudo apt install postgresql-18-pgvector
Yum / DNF (RHEL family)
RPM packages come from the PostgreSQL Yum repository. Follow its setup instructions for your distribution, then install.
sudo yum install pgvector_18
# or
sudo dnf install pgvector_18
pkg (FreeBSD)
Install the package, or build from the port. See FreshPorts: databases/pgvector.
pkg install postgresql18-pgvector
# or from the port
cd /usr/ports/databases/pgvector
make install
APK (Alpine)
Install the Alpine package. See Alpine package search.
apk add postgresql-pgvector
conda-forge
With Conda PostgreSQL, install from conda-forge. This method is community-maintained via the pgvector-feedstock.
conda install -c conda-forge pgvector
Postgres.app
pgvector comes preinstalled with Postgres.app version 15 and newer. Download the latest release and enable the extension as usual.
GitHub Actions
For continuous integration, use the official pgvector/setup-pgvector action to install pgvector in a GitHub Actions workflow.
Hosted Postgres
pgvector is available on many hosted PostgreSQL providers, so you often do not need to install anything. Enable the extension as usual once your provider offers it. Check each provider's documentation for the pgvector version it currently supports; the upstream project also maintains a community list in issue #54.
Supabase
Offers pgvector for vector columns and AI features.
Neon
Ships the pgvector extension on its serverless Postgres.
Timescale
Provides pgvector, plus the pgvectorscale extension.
Amazon RDS for PostgreSQL
Lists pgvector among its supported extensions.
Google Cloud SQL
Supports pgvector in Cloud SQL for PostgreSQL.
Azure Database for PostgreSQL
Includes pgvector in its supported extensions.
Enable and verify
Installation places the extension files on the server. To use it, enable the extension once per database, then confirm the version.
- Enable the extension with
CREATE EXTENSION vector;. - Verify the version with a query against
pg_extension— it should report0.8.6.
CREATE EXTENSION vector;
SELECT extversion FROM pg_extension WHERE extname = 'vector';
-- expected: 0.8.6
If you see type "vector" does not exist, the extension has not been enabled in that database. Run CREATE EXTENSION vector; while connected to it. See the documentation for the next steps.
Upgrade pgvector
Install the latest version using the same method you originally used, then run the extension update in each database you want to upgrade.
ALTER EXTENSION vector UPDATE;
SELECT extversion FROM pg_extension WHERE extname = 'vector';
Uninstall pgvector
To remove pgvector, drop the extension in each database where it is enabled, then remove the installed files. There is no separate service to stop.
- Remove the extension from each database. If columns or indexes use a vector type, either drop them first or use
CASCADEto remove the dependent objects automatically. - Remove the installed files using the same method you installed with: your package manager, the Docker image, or — for a source build — the
make uninstalltarget provided by the PostgreSQL extension build system (PGXS).
-- drops dependent columns and indexes too
DROP EXTENSION vector CASCADE;
-- or, if nothing depends on the type
DROP EXTENSION vector;
The make uninstall target comes from PostgreSQL's extension build infrastructure (PGXS).
Install troubleshooting
These are the documented installation problems and their fixes. For query and index problems, see the troubleshooting page.
fatal error: postgres.h: No such file or directoryCause: the PostgreSQL development files are not installed.
Fix (Ubuntu / Debian):
sudo apt install postgresql-server-dev-18Cause: pg_config resolves to a different installation than your server.
Fix: point PG_CONFIG at the correct binary and re-run the build (run make clean before make if needed). Use --preserve-env if make install needs sudo.
export PG_CONFIG=/Library/PostgreSQL/18/bin/pg_config
sudo --preserve-env=PG_CONFIG make installIllegal instruction at runtime after compilingCause: by default pgvector compiles with -march=native on some platforms for best performance, so the binary may not run on a different CPU.
Fix: compile for portability.
make OPTFLAGS=""no such sysroot directoryCause: your PostgreSQL installation points to a path that no longer exists.
Fix: inspect the flags, then reinstall PostgreSQL to repair the path.
pg_config --cppflagsCannot open include file: 'postgres.h': No such file or directoryCause: PGROOT does not point to your PostgreSQL installation.
Fix: set PGROOT correctly (see the Windows build) and re-run nmake.
error C2196: case value '4' already usedCause: you are not using the x64 toolchain.
Fix: use the x64 Native Tools Command Prompt for VS, clean, and rebuild.
nmake /F Makefile.win cleanunresolved external symbol float_to_shortest_decimal_bufnCause: a known issue with PostgreSQL 17.0–17.2.
Fix: upgrade to PostgreSQL 17.3 or newer.
Access is denied during installCause: insufficient permissions.
Fix: re-run the installation as an administrator.