Installation
This guide covers different ways to install and run Linktor.
Prerequisites
- Docker and Docker Compose (recommended)
- Or: Go 1.21+, Node.js 20+, PostgreSQL 15+, Redis 7+
Docker Installation (Recommended)
The easiest way to get started is with Docker Compose:
# Clone the repository
git clone https://github.com/linktor/linktor.git
cd linktor
# Copy environment file
cp .env.example .env
# Optional: avoid local port conflicts
# LINKTOR_API_PORT=18081
# LINKTOR_ADMIN_PORT=13000
# LINKTOR_POSTGRES_PORT=15432
# LINKTOR_REDIS_PORT=16379
# Start all services
docker compose up --build
This will start:
- API Server on
LINKTOR_API_PORT(8081by default) - Admin Dashboard on
LINKTOR_ADMIN_PORT(3000by default) - PostgreSQL on
LINKTOR_POSTGRES_PORT(5432by default) - Redis on
LINKTOR_REDIS_PORT(6379by default) - NATS on
LINKTOR_NATS_PORT(4222by default) - MinIO on
LINKTOR_MINIO_PORT(9000by default)
Environment Variables
Configure Linktor by editing the .env file:
# Published ports
LINKTOR_API_PORT=8081
LINKTOR_ADMIN_PORT=3000
LINKTOR_POSTGRES_PORT=5432
LINKTOR_REDIS_PORT=6379
LINKTOR_NATS_PORT=4222
LINKTOR_NATS_MONITOR_PORT=8222
LINKTOR_MINIO_PORT=9000
LINKTOR_MINIO_CONSOLE_PORT=9001
LINKTOR_BASE_URL=http://localhost:8081
# Database
LINKTOR_DATABASE_HOST=localhost
LINKTOR_DATABASE_PORT=5432
LINKTOR_DATABASE_USER=linktor
LINKTOR_DATABASE_PASSWORD=linktor
LINKTOR_DATABASE_DATABASE=linktor
LINKTOR_DATABASE_SSL_MODE=disable
# Redis
LINKTOR_REDIS_HOST=localhost
LINKTOR_REDIS_PORT=6379
# NATS
LINKTOR_NATS_URL=nats://localhost:4222
# MinIO
MINIO_ENDPOINT=localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
# JWT Secret (generate a strong secret)
LINKTOR_JWT_SECRET=your-super-secret-key-change-in-production
# Admin frontend
NEXT_PUBLIC_API_URL=http://localhost:8081/api/v1
NEXT_PUBLIC_WS_URL=ws://localhost:8081/api/v1/ws
NEXT_PUBLIC_WEBHOOK_BASE_URL=http://localhost:8081
# AI Providers (optional)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
# Channel Credentials (configure as needed)
TWILIO_ACCOUNT_SID=...
TWILIO_AUTH_TOKEN=...
Manual Installation
For development or custom deployments:
1. Start Dependencies
# PostgreSQL
docker run -d --name postgres \
-e POSTGRES_USER=linktor \
-e POSTGRES_PASSWORD=linktor \
-e POSTGRES_DB=linktor \
-p 5432:5432 postgres:15
# Redis
docker run -d --name redis -p 6379:6379 redis:7
# NATS
docker run -d --name nats -p 4222:4222 nats:latest
# MinIO
docker run -d --name minio \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
-p 9000:9000 minio/minio server /data
2. Build and Run API Server
cd internal
go mod download
go build -o linktor ./cmd/server
./linktor
3. Build and Run Admin Dashboard
cd web/admin
npm install
npm run dev
Kubernetes Deployment
See Kubernetes Guide for production-ready Kubernetes manifests.
Health Check
Verify the installation:
# Check API health
curl "${LINKTOR_BASE_URL:-http://localhost:8081}/health"
# Expected response
{"status": "healthy"}
Next Steps
- Quick Start - Create your first chatbot
- Authentication - Set up API authentication