1. Home
  2. Install
Install · every platform

Install pgvector

Pick your platform, copy the commands, run CREATE EXTENSION vector. We checked every package channel on 2026-10-27 — several still ship old versions, and one Docker detail silently loses data on Postgres 18.

Tested on pgvector 0.8.7 · PostgreSQL 18.6Updated 2026-10-2712 min read

Fastest path: run Postgres 18 with pgvector in Docker, then enable the extension. On Ubuntu or Debian, use the PGDG apt repository and install postgresql-18-pgvector. On Windows, use Docker Desktop unless you need a native install.

bash
docker run -d -e POSTGRES_PASSWORD=secret -p 5432:5432 pgvector/pgvector:pg18-trixie
psql -h localhost -U postgres -c "CREATE EXTENSION vector;"

Choose your platform#

Each tab is a complete path from nothing to a working vector type. Your choice is remembered on the other install pages.

bashStart Postgres 18 with pgvector
docker run -d --name pgvector \
  -e POSTGRES_PASSWORD=secret \
  -p 5432:5432 \
  -v pgdata:/var/lib/postgresql \
  pgvector/pgvector:pg18-trixie
bashEnable and verify
docker exec -it pgvector psql -U postgres -c "CREATE EXTENSION vector;" \
  -c "SELECT extversion FROM pg_extension WHERE extname = 'vector';"

The volume path is /var/lib/postgresql for Postgres 18 images and /var/lib/postgresql/data for 17 and older — details below. Need another version, Compose, or a pinned tag? Use the Docker command builder.

Which channels actually ship 0.8.7?#

pgvector 0.8.7 was released on 2026-10-01. Packaging channels catch up at different speeds, and the gap matters: 0.8.2 fixed a buffer overflow in parallel HNSW builds, 0.8.3 fixed possible HNSW index corruption during vacuum, and 0.8.4–0.8.7 fixed further vacuum and IVFFlat memory bugs (full history). We checked each channel's own package index on 2026-10-27:

Channelpgvector versionPostgres majorsVerdict
Docker pgvector/pgvector0.8.713–18 (amd64, arm64)✅ Current
PGDG apt (postgresql-NN-pgvector)0.8.713–19 (Debian 13); 16–19 checked on Debian 12, Ubuntu 24.04✅ Current
PGDG yum/dnf (pgvector_NN)0.8.714–18 (EL 9); 17–18 (EL 10)✅ Current
Homebrew pgvector0.8.717, 18✅ Current
PGXN vector0.8.713+ (builds from source)✅ Current
FreeBSD ports / quarterly0.8.7 / 0.8.2—⚠️ Quarterly lags
Postgres.app 2.9.6 (macOS)0.8.615–18⚠️ One behind
conda-forge0.8.618 (Linux/macOS), 16 only on Windows⚠️ One behind
Unofficial Windows DLLs (andreiramani)0.8.713–18⚠️ Community build
Alpine postgresql-pgvector0.8.1—❌ Old (edge and 3.24)
Debian 13 archive0.8.017❌ Old — use PGDG
Ubuntu 24.04 archive0.6.016❌ Very old — use PGDG

Sources: Docker Hub tag API, apt.postgresql.org and download.postgresql.org package indexes, formulae.brew.sh, api.pgxn.org, freshports.org, the Postgres.app 2.9.6 build makefiles, api.anaconda.org, pkgs.alpinelinux.org, sources.debian.org and Launchpad.

Download pgvector#

There is no installer or binary download from the pgvector project. What you "download" depends on your platform:

  • Source code: every release is a git tag — git clone --branch v0.8.7 https://github.com/pgvector/pgvector.git, or a source tarball from github.com/pgvector/pgvector/tags and PGXN.
  • Prebuilt for Linux: packages from the PGDG apt and yum repositories (below).
  • Prebuilt container: docker pull pgvector/pgvector:pg18-trixie.
  • Windows: no official binaries — see your options.

Docker#

The pgvector/pgvector images are the official postgres images with pgvector compiled in (the Dockerfile is FROM postgres:$PG_MAJOR-$DEBIAN_CODENAME), so every POSTGRES_* variable and init-script convention works the same way.

Which tag should I use?#

Tag patternExampleBase OSpgvector version
pgNN-trixiepg18-trixieDebian 13Floating — moves to each new release
pgNN-bookwormpg18-bookwormDebian 12Floating
pgNNpg18Debian 12 (alias of bookworm)Floating
X.Y.Z-pgNN-trixie0.8.7-pg18-trixieDebian 13Pinned to 0.8.7

Podman runs the same images; use the fully qualified name, docker.io/pgvector/pgvector:pg18-trixie, if your registries config doesn't search Docker Hub by default.

There is no latest tag and no Alpine variant. Compressed images are about 160–170 MB for current majors on both amd64 and arm64. For production, pin the pgvector version (0.8.7-pg18-trixie) so an image pull never changes your extension version underneath you.

The Postgres 18 volume path change#

Data loss trap. Postgres 18 images moved PGDATA to /var/lib/postgresql/18/docker and declare the volume at /var/lib/postgresql. Copying an old Compose file that mounts /var/lib/postgresql/data onto a pg18 image means your data lives in an anonymous volume and disappears with the container. On 17 and older, the reverse is true: mount /var/lib/postgresql/data.

Docker command builder#

Pick a version and options; the builder emits a docker run command and an equivalent compose.yaml with the right volume path and shared-memory size.

bashdocker run
yamlcompose.yaml

    Adding pgvector to your own image#

    If you already maintain a Dockerfile on the official postgres image, add the PGDG package instead of switching base images (the official image already has the PGDG apt repository configured):

    dockerfileDockerfile
    FROM postgres:18-trixie
    RUN apt-get update \
     && apt-get install -y --no-install-recommends postgresql-18-pgvector \
     && rm -rf /var/lib/apt/lists/*

    Linux packages#

    On Debian, Ubuntu, RHEL and derivatives the reliable source is the PostgreSQL Global Development Group (PGDG) repository — the same people who package Postgres itself. On 2026-10-27 it had 0.8.7 for every supported Postgres major we checked. Commands are in the platform tabs above. Package names:

    DistributionPackageVersion on 2026-10-27
    Debian / Ubuntu (PGDG)postgresql-18-pgvector0.8.7
    RHEL / Rocky / Alma / Fedora (PGDG)pgvector_180.8.7
    FreeBSDpostgresql18-pgvector0.8.7 (ports), 0.8.2 (quarterly)
    Alpinepostgresql-pgvector0.8.1
    Any (conda)conda install -c conda-forge pgvector0.8.6

    macOS#

    Homebrew is the quickest route if you run Postgres from Homebrew: brew install pgvector installs into both postgresql@17 and postgresql@18. Prebuilt bottles are listed for Apple Silicon only, so on Intel Macs Homebrew compiles it. The formula only adds pgvector to postgresql@17 and postgresql@18; for an older formula such as postgresql@16, build from source with that formula's pg_config.

    Postgres.app bundles pgvector for Postgres 15 and newer, so there is nothing to install: connect and run CREATE EXTENSION vector;. The stable release (2.9.6) ships pgvector 0.8.6; the 3.0 beta ships 0.8.7.

    EDB installer: build from source and point at its pg_config:

    bash
    export PG_CONFIG=/Library/PostgreSQL/18/bin/pg_config
    cd /tmp && git clone --branch v0.8.7 https://github.com/pgvector/pgvector.git && cd pgvector
    make
    sudo --preserve-env=PG_CONFIG make install

    Windows#

    pgvector has no official Windows installer. You have four realistic options:

    OptionBest forpgvector versionEffort
    Docker DesktopLocal development0.8.7Lowest — one command
    Build with nmakeNative Postgres from the EDB installerAny (you choose the tag)Needs Visual Studio C++ tools
    WSL 2 + UbuntuLinux-like dev environment0.8.7 via PGDGFollow the Ubuntu steps inside WSL
    Unofficial prebuilt DLLsNo compiler available0.8.7 (PG 13–18)Copy files — but unofficial

    Two things that do not work, despite what older tutorials say: the EDB installer and StackBuilder do not include pgvector (we checked the 17.11 and 18.6 Windows binary distributions — neither contains vector.dll), and conda-forge's Windows build targets Postgres 16 only.

    Building with nmake, step by step#

    1. Install the compiler. Install Visual Studio 2022 Build Tools (or Community) with the Desktop development with C++ workload. You also need Git for Windows.
    2. Open the right prompt. Start menu → x64 Native Tools Command Prompt for VS 2022 → right-click → Run as administrator. The plain Command Prompt or the x86 prompt will not work.
    3. Point at your Postgres. set "PGROOT=C:\Program Files\PostgreSQL\18" — adjust the major version to match your install.
    4. Build and install. Clone the v0.8.7 tag and run nmake /F Makefile.win then nmake /F Makefile.win install (commands in the Windows tab). The install step copies vector.dll into lib and the SQL/control files into share\extension.
    5. Enable it. In psql or pgAdmin's Query Tool: CREATE EXTENSION vector;

    Windows build errors#

    ErrorCause and fix
    Cannot open include file: 'postgres.h'PGROOT is wrong or unset. Check the path contains include\server.
    error C2196: case value '4' already usedYou're in a 32-bit prompt. Use the x64 Native Tools prompt, then nmake /F Makefile.win clean and rebuild.
    unresolved external symbol float_to_shortest_decimal_bufnPostgres 17.0–17.2 on Windows. Upgrade Postgres to 17.3 or later.
    Access is denied during installThe prompt is not elevated. Re-open it with Run as administrator.

    Building from source (Linux and macOS)#

    Building from source gets you any version on any platform with a C compiler. You need the server development headers: postgresql-server-dev-18 on Debian/Ubuntu, postgresql18-devel on PGDG RHEL.

    • Several Postgres installs? make builds against whichever pg_config is first on your PATH. Set export PG_CONFIG=/usr/lib/postgresql/18/bin/pg_config explicitly, run make clean, and use sudo --preserve-env=PG_CONFIG make install.
    • Building on one machine, running on another? pgvector compiles with -march=native by default on some platforms, which can crash with Illegal instruction on a different CPU. Use make OPTFLAGS="" — the official Docker images do exactly this.

    Managed Postgres providers#

    You can't install extensions on managed services, but pgvector is pre-installed nearly everywhere. The version is whatever the provider ships — and most lag well behind 0.8.7. Documented versions on 2026-10-27:

    ProviderNewest documented pgvectorHow to enable
    Amazon RDS for PostgreSQL0.8.2 (PG 14–18); 0.8.0 on PG 13CREATE EXTENSION vector;
    Amazon Aurora PostgreSQL0.8.2 (latest minors of 14–18)CREATE EXTENSION vector;
    Google Cloud SQL0.8.5 (PG 13+)CREATE EXTENSION vector;
    Google AlloyDB0.8.5.google-1CREATE EXTENSION vector; (as alloydbsuperuser)
    Azure Database for PostgreSQL0.8.2 (PG 13–18)Allow-list vector in the azure.extensions server parameter first, then CREATE EXTENSION vector;
    Neon0.8.6 (PG 18); 0.8.0 (PG 14–17)CREATE EXTENSION vector;
    SupabaseNot stated in docsDashboard → Database → Extensions, or create extension vector with schema extensions;
    Tiger Cloud (Timescale)Not statedCREATE EXTENSION vector; (not enabled by default)
    DigitalOceanNot statedCREATE EXTENSION vector; (pre-installed on Advanced Edition)
    Crunchy Bridge, Heroku, RenderNot statedCREATE EXTENSION vector;
    bashAzure: allow-list the extension first
    az postgres flexible-server parameter set \
      --resource-group my-rg --server-name my-server \
      --name azure.extensions --value "vector"

    On a managed service, SELECT default_version FROM pg_available_extensions WHERE name = 'vector'; tells you what the provider has made available; if it's newer than your extversion, run ALTER EXTENSION vector UPDATE;. More provider detail on the ecosystem page.

    Enable and verify#

    Installing puts files on the server; enabling registers the extension in one database. Run this in every database that needs vectors — from psql, pgAdmin's Query Tool, DBeaver's SQL editor or any other client:

    psqlEnable pgvector and confirm the version
    demo=# CREATE EXTENSION IF NOT EXISTS vector;
    CREATE EXTENSION
    
    demo=# SELECT extversion FROM pg_extension WHERE extname = 'vector';
     extversion 
    ------------
     0.8.7
    (1 row)

    To see what's installed on the server versus enabled in this database — useful after an upgrade:

    psqlpsql · PostgreSQL 18.6 · pgvector 0.8.7
    demo=# SELECT name, default_version, installed_version FROM pg_available_extensions WHERE name = 'vector';
      name  | default_version | installed_version 
    --------+-----------------+-------------------
     vector | 0.8.7           | 0.8.7
    (1 row)

    Then a 10-second smoke test that the type and an index both work:

    sqlSmoke test
    CREATE TABLE smoke (id bigserial PRIMARY KEY, embedding vector(3));
    INSERT INTO smoke (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');
    CREATE INDEX ON smoke USING hnsw (embedding vector_l2_ops);
    SELECT id, embedding <-> '[3,1,2]' AS distance FROM smoke ORDER BY distance LIMIT 1;
    DROP TABLE smoke;

    Ready for real data? The quickstart walks through storing embeddings, and the index planner sizes your first index.

    If CREATE EXTENSION fails#

    These are the three errors people actually hit, captured from real sessions.

    extension "vector" is not available#

    The package isn't installed for this Postgres server. Here's PostgreSQL 16 on our test machine, where only the 18 package was installed:

    outputPostgreSQL 16 without postgresql-16-pgvector
    ERROR:  extension "vector" is not available
    DETAIL:  Could not open extension control file "/usr/share/postgresql/16/extension/vector.control": No such file or directory.
    HINT:  The extension must first be installed on the system where PostgreSQL is running.

    Install the package that matches the server's major version (check with SHOW server_version;). The most common cause is two Postgres installs — the package went into one, your client is connected to the other. In Docker, it means you're running postgres rather than pgvector/pgvector.

    permission denied to create extension "vector"#

    psqlA non-superuser role
    demo=# SET ROLE app_user;
    SET
    
    demo=# CREATE EXTENSION vector;
    ERROR:  permission denied to create extension "vector"
    HINT:  Must be superuser to create this extension.
    
    demo=# RESET ROLE;
    RESET

    pgvector is not marked as a trusted extension, so CREATE EXTENSION needs a superuser (or the provider's admin role, such as rds_superuser or azure_pg_admin). Ask an administrator to run it once per database; afterwards ordinary roles can use the type.

    type "vector" does not exist#

    psqlExtension enabled in one database, used from another
    demo=# \c other
    You are now connected to database "other" as user "postgres".
    
    other=# CREATE TABLE t (embedding vector(3));
    ERROR:  type "vector" does not exist
    LINE 1: CREATE TABLE t (embedding vector(3));
                                      ^
    
    other=# \c demo
    You are now connected to database "demo" as user "postgres".

    The extension is enabled in a different database, or in a schema that isn't on your search_path (Supabase puts it in extensions). Run CREATE EXTENSION vector; in this database, or qualify the type as extensions.vector. More errors on the troubleshooting page.

    Upgrade pgvector#

    1. Install the new binaries. apt install postgresql-18-pgvector / brew upgrade pgvector / pull the new Docker tag / rebuild from the new git tag.
    2. Update each database. ALTER EXTENSION vector UPDATE; runs the upgrade scripts. If it says the version "is already installed", the server still has the old files — usually a restart or the wrong pg_config.
    3. Check. SELECT extversion FROM pg_extension WHERE extname = 'vector';
    psqlRunning ALTER EXTENSION when already current
    demo=# ALTER EXTENSION vector UPDATE;
    NOTICE:  version "0.8.7" of extension "vector" is already installed
    ALTER EXTENSION

    No release since 0.3.1 has required rebuilding indexes after an upgrade — the changelog's only reindex instruction is for IVFFlat indexes created on 0.2.7 or 0.3.0. Upgrading from an old release? See upgrade notes by version.

    Uninstall#

    sql
    DROP EXTENSION vector;

    This fails while any column uses a pgvector type. DROP EXTENSION vector CASCADE; succeeds — by dropping every vector column and index in the database. Take a backup first.

    Frequently asked questions

    Is there a pgvector download for Windows (an .exe or .zip)?

    Not from the pgvector project: its GitHub releases page has no binaries, and the maintainers recommend Docker or building from source with Visual Studio's nmake. A community repository (andreiramani/pgvector_pgsql_windows) publishes unofficial prebuilt DLLs — its 0.8.7 release covers PostgreSQL 13–18 — but it is not affiliated with the project, so review it before use. The EDB installer and StackBuilder do not include pgvector.

    Does the official postgres Docker image include pgvector?

    No. The postgres image only ships PostgreSQL and its contrib extensions. Use pgvector/pgvector:pg18-trixie (built on top of postgres:18-trixie) or install postgresql-18-pgvector in your own Dockerfile.

    Which pgvector version do I get with apt install on Ubuntu?

    From Ubuntu's own archive, an old one: Ubuntu 24.04 ships 0.6.0 and Debian 13 ships 0.8.0. Add the PostgreSQL Global Development Group (PGDG) repository to get 0.8.7 — that's the method we used to build the test server for this site.

    Do I need to run CREATE EXTENSION in every database?

    Yes. Installing the package puts the files on the server; CREATE EXTENSION vector; registers the types and operators in one database. Run it once in each database that needs vectors (or in template1 so new databases inherit it).

    Which PostgreSQL versions does pgvector 0.8.7 support?

    PostgreSQL 13 and newer, and Docker images exist for 13 through 18. The next release, 0.9.0, drops PostgreSQL 13 and 14 according to the upstream changelog, so new projects should start on 16 or later.

    How do I check which pgvector version is installed?

    Run SELECT extversion FROM pg_extension WHERE extname = 'vector'; for the version active in the current database, and SELECT default_version FROM pg_available_extensions WHERE name = 'vector'; for the version installed on the server. If they differ, run ALTER EXTENSION vector UPDATE;.