Prerequisites
Before installing Blnk, ensure you have the following installed:Docker
Docker Engine 20.10+ for container runtime
Docker Compose
Docker Compose v2.0+ for orchestration
Some Docker installations use
docker-compose (with hyphen) instead of docker compose. Adjust commands accordingly based on your setup.Installation Steps
Create Configuration File
Create a
blnk.json configuration file in the project root:blnk.json
The default configuration works out of the box with the provided
docker-compose.yaml. Customize the values for your environment as needed.Start Blnk Server
Launch all services using Docker Compose:This starts the following services:
- server - Blnk API server (port 5001)
- worker - Background job processor (port 5004)
- postgres - PostgreSQL database (port 5432)
- redis - Redis queue backend (port 6379)
- typesense - Search engine (port 8108)
- jaeger - Distributed tracing (port 16686)
Docker Compose Configuration
Thedocker-compose.yaml file defines the complete Blnk stack:
docker-compose.yaml
Understanding the Services
Understanding the Services
- server: Runs database migrations and starts the API server
- worker: Processes queued transactions, webhooks, and background jobs
- postgres: Stores all ledger data with persistence via Docker volumes
- redis: Manages job queues and caching
- typesense: Enables fast search across balances, transactions, and ledgers
- jaeger: Provides distributed tracing for observability (optional)
Environment Variables
Blnk supports configuration via environment variables. Create a.env file based on .env.example:
.env
Configuration File vs Environment Variables
Blnk supports two configuration methods:- Configuration File (
blnk.json) - Recommended for structured configuration - Environment Variables - Override file settings or configure without a file
blnk.json settings. All configuration file options have corresponding environment variable equivalents prefixed with BLNK_.
Port Reference
| Service | Port | Description |
|---|---|---|
| API Server | 5001 | Main REST API endpoint |
| Workers | 5004 | Worker monitoring port |
| PostgreSQL | 5432 | Database connection |
| Redis | 6379 | Queue backend |
| Typesense | 8108 | Search API |
| Jaeger UI | 16686 | Tracing dashboard |
Common Installation Issues
Port Already in Use
Port Already in Use
If you see errors about ports already being in use:
-
Check what’s using the port:
-
Either stop the conflicting service or change Blnk’s port in
blnk.json:
Database Connection Failed
Database Connection Failed
If the server can’t connect to PostgreSQL:
-
Ensure PostgreSQL container is running:
-
Check the database DNS in
blnk.jsonmatches your PostgreSQL container name and credentials - Wait for PostgreSQL to fully initialize (can take 10-30 seconds on first start)
Permission Denied Errors
Permission Denied Errors
If you encounter permission issues with volumes:
Next Steps
Now that Blnk is installed and running:Quick Start
Create your first ledger, balance, and transaction
Configuration
Explore advanced configuration options