Installation
There are four 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.3.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
TIP
Installation from Debian packages requires a dependency on GLIBC >= 2.35
, so only the following distributions are supported:
Debian 12 (Bookworm)
or laterUbuntu 22.04
or later
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.3.0/postgresql-17-vchord_0.3.0-1_$(dpkg --print-architecture).deb
sudo apt install ./postgresql-17-vchord_0.3.0-1_$(dpkg --print-architecture).deb
- Configure your PostgreSQL by modifying the
shared_preload_libraries
to include the extension.
psql -U postgres -c 'ALTER SYSTEM SET shared_preload_libraries = "vchord.so"'
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.
Configure your PostgreSQL by modifying the
shared_preload_libraries
to include the extension.
psql -U postgres -c 'ALTER SYSTEM SET shared_preload_libraries = "vchord.so"'
sudo systemctl restart postgresql.service
- Run the following SQL to ensure the extension is enabled.
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
Source
TIP
VectorChord supports UNIX-like operating systems. Please report an issue if you cannot compile.
VectorChord supports little-endian architectures but only provides performance advantages on x86_64 and aarch64.
You may need to install VectorChord from source. Please follow these steps.
- Clone the repository and checkout the branch.
git clone https://github.com/tensorchord/VectorChord.git
cd VectorChord
git checkout "0.3.0"
- Install a C compiler and Rust. For GCC, the version must be 14 or higher. For Clang, the version must be 16 or higher. Other C compilers are not supported. For Rust, the version must be the same as that recorded in
rust-toolchain.toml
.
You could download Clang from https://github.com/llvm/llvm-project/releases.
You could setup Rust with Rustup. See https://rustup.rs/.
- Install the devtool
cargo-pgrx
and set up it.
cargo install cargo-pgrx@$(sed -n 's/.*pgrx = { version = "\(=.*\)",.*/\1/p' Cargo.toml) --locked
cargo pgrx init --pg17=$(which pg_config)
- Install the extension to your system.
cargo pgrx install --sudo --release
sudo cp -a ./sql/upgrade/. $(pg_config --sharedir)/extension
- Run the following SQL to add the extension to
shared_preload_libraries
. Then restart the PostgreSQL cluster.
ALTER SYSTEM SET shared_preload_libraries = "vchord.so";
- Run the following SQL to ensure the extension is enabled.
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
TIP
By default, VectorChord
only finds clang
in PATH
as the C compiler.
If you need to use GCC, please set the environment variable CC to gcc
.