Documentation
PostgreSQL Setup Guide
Switch from SQLite to PostgreSQL for enhanced concurrency, advanced JSONB operations, and strict data integrity in enterprise deployments.
Docker Compose Blueprint
If you prefer PostgreSQL as your primary data store for nLink, utilize the lightweight Alpine version to minimize your server's memory footprint while maintaining incredibly robust transactional guarantees.
postgres_db:
image: postgres:15-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password # Default password for Docker
POSTGRES_DB: nlink_db
# Optional: Expose port if you want to connect via external GUI tools
# ports:
# - "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:Connection Attributes
- Engine Version:
postgres:15-alpine
(Version 15+ brings massive improvements to sorting and native JSON analytics, making it highly optimal for nLink data nodes). - Credentials:
postgres:password
(Like MySQL, ensure you changePOSTGRES_PASSWORDwhen pushing to the cloud). - Exposed Port:
5432
(The standard port mapped so you can securely attach PGAdmin or other database introspectors directly).
Updating The System Target
If you choose to run Postgres instead of the embedded SQLite, you must explicitly tell the nLink image to target it via environment variables:
nlink:
environment:
- DATABASE_DEFAULT=POSTGRES
- POSTGRES_HOST=postgres_db
- POSTGRES_PASSWORD=password