Installation
Multiple ways to install depending on your setup.
One-Line Installer (Recommended)
bash <(curl -fsSL https://raw.githubusercontent.com/aaron777collins/BetterPGVectorN8N/main/install.sh)
The installer auto-detects your n8n environment and offers the best option:
| Your Setup | What It Does |
|---|---|
| Docker Compose | Creates persistent setup that survives rebuilds |
| Running Container | Installs directly into the container |
| npm/Local Install | Adds to ~/.n8n/nodes |
| Nothing Found | Creates fresh n8n + pgvector stack |
Installer Options
# Download first
curl -fsSL https://raw.githubusercontent.com/aaron777collins/BetterPGVectorN8N/main/install.sh -o install.sh
chmod +x install.sh
# Pick your method:
./install.sh --standalone # New n8n + pgvector Docker setup
./install.sh --docker # Add to existing Docker Compose
./install.sh --direct # Install into running container
./install.sh --npm # Install to ~/.n8n/nodes
./install.sh --update # Update existing installation
./install.sh --help # Show all options
Updating to Latest Version
# Update via installer
./install.sh --update
# Or restart container (auto-updates on startup)
docker compose restart n8n
The Docker init script automatically checks for updates on each container start.
Via n8n UI
- Open n8n
- Go to Settings → Community Nodes
- Click Install
- Enter:
n8n-nodes-pgvector-advanced - Click Install
Note: UI-installed nodes may not persist across Docker rebuilds. See Docker Guide for persistent installation.
Via npm
Install to n8n’s custom nodes directory
mkdir -p ~/.n8n/nodes
cd ~/.n8n/nodes
npm init -y
npm install n8n-nodes-pgvector-advanced
Then restart n8n.
Install globally (if n8n is installed globally)
npm install -g n8n-nodes-pgvector-advanced
From Source
git clone https://github.com/aaron777collins/BetterPGVectorN8N.git
cd BetterPGVectorN8N
npm install
npm run build
Link for development
# In the package directory
npm link
# In your n8n directory or ~/.n8n/nodes
npm link n8n-nodes-pgvector-advanced
Docker Installation
For Docker deployments, community nodes need special handling to persist across container rebuilds.
Quick start with examples:
git clone https://github.com/aaron777collins/BetterPGVectorN8N.git
cd BetterPGVectorN8N/examples/docker
docker compose up -d
For detailed Docker setup, see the Docker Guide.
Prerequisites
PostgreSQL with pgvector
You need PostgreSQL 12+ with the pgvector extension.
Option 1: Docker (easiest)
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=password ankane/pgvector
Option 2: Install extension manually
-- Connect to your database
CREATE EXTENSION IF NOT EXISTS vector;
See pgvector installation guide for more options.
Verify Installation
After installation, the PGVector Advanced node should appear in n8n’s node panel.
- Open n8n
- Create a new workflow
- Search for “PGVector Advanced”
- The node should appear in results
If not found, check:
- n8n was restarted after installation
- No errors in n8n startup logs
- Package is in the correct location
MCP Server for AI Agents
This package includes an MCP (Model Context Protocol) server for AI agents.
# Run directly via npx
npx n8n-nodes-pgvector-advanced
# Or install globally
npm install -g n8n-nodes-pgvector-advanced
pgvector-mcp
Environment variables:
export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=your_db
export PGUSER=your_user
export PGPASSWORD=your_password
Available tools:
pgvector_upsert- Insert/update embeddingspgvector_query- Similarity searchpgvector_delete- Delete by ID, external ID, or metadatapgvector_get- Retrieve specific embeddingspgvector_admin- Schema and index management
Next Steps
- Quick Start Guide - Get up and running
- Operations Reference - See all available operations
- Docker Guide - Persistent Docker installation