Installation
VectorChord is tested on the following operating system:
- Ubuntu (x86_64, aarch64)
- MacOS (aarch64)
- Windows (x86_64)
- Alpine Linux (x86_64, aarch64) [1]
Please report a bug if you encounter issues on any of the above operating systems, or submit a feature request for additional platform support.
There are 4 ways to install VectorChord.
Docker
VectorChord Image
The easiest way to try VectorChord is to run it from a ready-to use Docker image.
- Launch a VectorChord container in Docker.
docker run \
--name vchord-demo \
-e POSTGRES_PASSWORD=mysecretpassword \
-p 5432:5432 \
-d tensorchord/vchord-postgres:pg17-v0.5.0
- Connect to the database using the
psql
command line tool. The default username ispostgres
.
psql postgresql://postgres:mysecretpassword@localhost:5432/postgres
- Run the following SQL to ensure the extension is enabled.
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
TIP
To achieve full performance, please mount the volume to PostgreSQL data directory by adding the option like -v $PWD/pgdata:/var/lib/postgresql/data
You can configure PostgreSQL by the reference of the parent image in https://hub.docker.com/_/postgres/.
VectorChord Suite Image
In addition to the base image with the VectorChord extension, we provide an all-in-one image, tensorchord/vchord-suite:pg17-latest
. This comprehensive image includes all official TensorChord extensions. Developers should select an image tag that is compatible with their extension's version, as indicated in the support matrix.
- Launch container
docker run \
--name vchord-suite \
-e POSTGRES_PASSWORD=postgres \
-p 5432:5432 \
-d tensorchord/vchord-suite:pg17-20250408
# If you want to use ghcr image, you can change the image to `ghcr.io/tensorchord/vchord-suite:pg17-20250408`.
# if you want to use the latest version, you can use the tag `pg17-latest`.
Other sections may align with the above.
Debian packages
Debian packages are used for Debian-based Linux distributions, including Debian and Ubuntu. They can be easily installed by apt
. You can use this installation method on x86_64 Linux and aarch64 Linux.
- Download Debian packages in the release page, and install them by
apt
.
wget https://github.com/tensorchord/VectorChord/releases/download/0.5.0/postgresql-17-vchord_0.5.0-1_$(dpkg --print-architecture).deb
sudo apt install ./postgresql-17-vchord_0.5.0-1_$(dpkg --print-architecture).deb
- Configure your PostgreSQL by modifying the
shared_preload_libraries
to include the extension. And then restart the PostgreSQL cluster.
psql -U postgres -c 'ALTER SYSTEM SET shared_preload_libraries = "vchord"'
sudo systemctl restart postgresql.service
- Run the following SQL to ensure the extension is enabled.
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
Prebuilt binaries
TIP
Installation from prebuilt binaries requires a dependency on GLIBC >= 2.35
, so only the following distributions are supported:
Debian 12 (Bookworm)
or laterUbuntu 22.04
or laterRed Hat Enterprise 10.0
or laterFedora 36
or lateropenSUSE 15.6
or later
Prebuilt binaries are used for other Linux distributions. You can consider repackaging the precompiled binaries. You can use this installation method on x86_64 Linux and aarch64 Linux.
- Download prebuilt binaries in the release page, and repackage it referring to your distribution's documentation. Then install it by system package manager. We do not recommend doing this, but if you wish, you can also manually copy the files to the system directory.
cp -r ./pkglibdir/. $(pg_config --pkglibdir)
cp -r ./sharedir/. $(pg_config --sharedir)
- Configure your PostgreSQL by modifying the
shared_preload_libraries
to include the extension. And then restart the PostgreSQL cluster.
psql -U postgres -c 'ALTER SYSTEM SET shared_preload_libraries = "vchord"'
- Run the following SQL to ensure the extension is enabled.
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
PGXN
TIP
See Source for build requirements.
- Install VectorChord from PostgreSQL Extension Network with:
pgxnclient install vchord # or `pgxnclient install vchord --sudo`
- Configure your PostgreSQL by modifying the
shared_preload_libraries
to include the extension. And then restart the PostgreSQL cluster.
psql -U postgres -c 'ALTER SYSTEM SET shared_preload_libraries = "vchord"'
- Run the following SQL to ensure the extension is enabled.
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
TIP
There is a broken VectorChord 0.4.1
package on PGXN. Please do not use it. Use version 0.4.2
or later instead.
Source
TIP
Build requirements:
- any port of
make
clang >= 16
withlibclang
rust >= 1.89
withcargo
It's recommended to use Rustup for installing Rust on most platforms, while on Alpine Linux, using the system package manager is advised.
You can set the environment variable CC
to specify the desired C compiler for the build system. If you do not set this variable, the build system automatically searches for clang and gcc. To compile all C code with clang, set CC
to the path of clang. To compile all C code with gcc, set CC
to the path of gcc; note that in this case, there is a requirement gcc >= 14
.
Rust version requirement is not a long-term guarantee; we will raise the required Rust version with each new release.
- Download the source code, build and install it with
make
.
curl -fsSL https://github.com/tensorchord/VectorChord/archive/refs/tags/0.5.0.tar.gz | tar -xz
cd VectorChord-0.5.0
make build
make install # or `sudo make install`
- Configure your PostgreSQL by modifying the
shared_preload_libraries
to include the extension. And then restart the PostgreSQL cluster.
psql -U postgres -c 'ALTER SYSTEM SET shared_preload_libraries = "vchord"'
- Run the following SQL to ensure the extension is enabled.
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
VectorChord is tested with PostgreSQL 15 in
community
repository, 16 and 17 inmain
repository on Alpine Linux 3.22. ↩︎