Repository navigation
configuration
Complete reference for all Soketi configuration options.
- Configuration File
- Environment Variables
- App Manager Configuration
- Server Configuration
- Metrics Configuration
- Adapter Configuration
- Queue Configuration
- Rate Limiting
- SSL/TLS Configuration
Soketi can be configured using a JSON configuration file. By default, it looks for config.json in the current directory.
Specify a custom configuration file:
soketi --config /path/to/config.json{
"app_manager": {
"driver": "array",
"array": {
"apps": [
{
"id": "app-id",
"key": "app-key",
"secret": "app-secret",
"max_connections": 100,
"enable_client_messages": true,
"enabled": true,
"max_backend_events_per_second": 100,
"max_client_events_per_second": 100,
"max_read_requests_per_second": 100
}
]
}
},
"host": "0.0.0.0",
"port": 6001,
"metrics": {
"enabled": true,
"port": 9601,
"host": "0.0.0.0"
}
}All configuration options can be overridden using environment variables with the PUSHER_ prefix.
| Variable | Description | Default |
|---|---|---|
PUSHER_HOST |
Server host | 0.0.0.0 |
PUSHER_PORT |
Server port | 6001 |
PUSHER_DEBUG |
Enable debug mode | false |
PUSHER_MODE |
Server mode (full, server, worker) | full |
| Variable | Description | Default |
|---|---|---|
PUSHER_APP_MANAGER_DRIVER |
App manager driver (array, dynamodb, mysql, postgres) | array |
PUSHER_APP_MANAGER_ARRAY_APPS |
JSON array of apps (for array driver) | [] |
PUSHER_DEFAULT_APP_ID |
Default app ID (creates a single app) | - |
PUSHER_DEFAULT_APP_KEY |
Default app key (creates a single app) | - |
PUSHER_DEFAULT_APP_SECRET |
Default app secret (creates a single app) | - |
PUSHER_APP_MANAGER_CACHE_ENABLED |
Enable app manager cache | false |
PUSHER_APP_MANAGER_CACHE_TTL |
Cache TTL in seconds | 3600 |
| Variable | Description | Default |
|---|---|---|
PUSHER_ADAPTER_DRIVER |
Adapter driver (local, cluster, redis, nats) | local |
PUSHER_ADAPTER_REDIS_HOST |
Redis adapter host | 127.0.0.1 |
PUSHER_ADAPTER_REDIS_PORT |
Redis adapter port | 6379 |
PUSHER_ADAPTER_REDIS_DB |
Redis adapter database | 0 |
PUSHER_ADAPTER_REDIS_PASSWORD |
Redis adapter password | - |
PUSHER_ADAPTER_CLUSTER_PORT |
Cluster adapter port | 11002 |
PUSHER_ADAPTER_NATS_SERVERS |
NATS servers (comma-separated) | 127.0.0.1:4222 |
| Variable | Description | Default |
|---|---|---|
PUSHER_CACHE_DRIVER |
Cache driver (memory, redis) | memory |
PUSHER_CACHE_REDIS_HOST |
Redis cache host | 127.0.0.1 |
PUSHER_CACHE_REDIS_PORT |
Redis cache port | 6379 |
PUSHER_CACHE_REDIS_PASSWORD |
Redis cache password | - |
| Variable | Description | Default |
|---|---|---|
PUSHER_METRICS_ENABLED |
Enable metrics | false |
PUSHER_METRICS_PORT |
Metrics port | 9601 |
PUSHER_METRICS_PREFIX |
Metrics prefix | pusher |
| Variable | Description | Default |
|---|---|---|
PUSHER_MYSQL_HOST |
MySQL host | 127.0.0.1 |
PUSHER_MYSQL_PORT |
MySQL port | 3306 |
PUSHER_MYSQL_USER |
MySQL user | root |
PUSHER_MYSQL_PASSWORD |
MySQL password | - |
PUSHER_MYSQL_DATABASE |
MySQL database | main |
| Variable | Description | Default |
|---|---|---|
PUSHER_POSTGRES_HOST |
PostgreSQL host | 127.0.0.1 |
PUSHER_POSTGRES_PORT |
PostgreSQL port | 5432 |
PUSHER_POSTGRES_USER |
PostgreSQL user | postgres |
PUSHER_POSTGRES_PASSWORD |
PostgreSQL password | - |
PUSHER_POSTGRES_DATABASE |
PostgreSQL database | main |
| Variable | Description | Default |
|---|---|---|
PUSHER_DYNAMODB_TABLE |
DynamoDB table name | apps |
PUSHER_DYNAMODB_REGION |
AWS region | us-east-1 |
| Variable | Description | Default |
|---|---|---|
PUSHER_QUEUE_DRIVER |
Queue driver (sync, redis, sqs) | sync |
PUSHER_QUEUE_REDIS_HOST |
Redis queue host | 127.0.0.1 |
PUSHER_QUEUE_REDIS_PORT |
Redis queue port | 6379 |
PUSHER_QUEUE_SQS_URL |
SQS queue URL | - |
PUSHER_QUEUE_SQS_REGION |
SQS region | us-east-1 |
| Variable | Description | Default |
|---|---|---|
PUSHER_SSL_ENABLED |
Enable SSL | false |
PUSHER_SSL_CERT_PATH |
SSL certificate path | - |
PUSHER_SSL_KEY_PATH |
SSL key path | - |
| Variable | Description | Default |
|---|---|---|
PUSHER_CORS_ENABLED |
Enable CORS | true |
PUSHER_CORS_ORIGINS |
Allowed origins (comma-separated) | * |
PUSHER_DEFAULT_APP_ID=my-app \
PUSHER_DEFAULT_APP_KEY=my-key \
PUSHER_DEFAULT_APP_SECRET=my-secret \
soketi-rsPUSHER_APP_MANAGER_ARRAY_APPS='[{"id":"app1","key":"key1","secret":"secret1","enabled":true}]' \
soketi-rsPUSHER_ADAPTER_DRIVER=redis \
PUSHER_ADAPTER_REDIS_HOST=localhost \
PUSHER_ADAPTER_REDIS_PORT=6379 \
PUSHER_ADAPTER_REDIS_PASSWORD=mypassword \
soketi-rsenvironment:
PUSHER_DEFAULT_APP_ID: "shopilens"
PUSHER_DEFAULT_APP_KEY: "shopilens-key"
PUSHER_DEFAULT_APP_SECRET: "shopilens-secret"
PUSHER_ADAPTER_DRIVER: "redis"
PUSHER_ADAPTER_REDIS_HOST: "redis"
PUSHER_ADAPTER_REDIS_PORT: "6379"
PUSHER_ADAPTER_REDIS_PASSWORD: "mypassword"
PUSHER_CACHE_DRIVER: "redis"
PUSHER_CACHE_REDIS_HOST: "redis"
PUSHER_METRICS_ENABLED: "true"
PUSHER_METRICS_PORT: "9601"The app manager controls how applications are stored and managed.
Best for development and single-instance deployments:
{
"app_manager": {
"driver": "array",
"array": {
"apps": [
{
"id": "app-id",
"key": "app-key",
"secret": "app-secret",
"max_connections": 100,
"enable_client_messages": true,
"enabled": true,
"max_backend_events_per_second": 100,
"max_client_events_per_second": 100,
"max_read_requests_per_second": 100,
"webhooks": []
}
]
}
}
}For production deployments with MySQL:
{
"app_manager": {
"driver": "mysql",
"mysql": {
"host": "localhost",
"port": 3306,
"database": "soketi",
"username": "soketi",
"password": "password"
}
}
}For production deployments with PostgreSQL:
{
"app_manager": {
"driver": "postgres",
"postgres": {
"host": "localhost",
"port": 5432,
"database": "soketi",
"username": "soketi",
"password": "password"
}
}
}For AWS deployments:
{
"app_manager": {
"driver": "dynamodb",
"dynamodb": {
"table": "soketi_apps",
"region": "us-east-1"
}
}
}{
"host": "0.0.0.0",
"port": 6001,
"path": "/",
"max_payload_size": 100000
}| Option | Description | Default |
|---|---|---|
host |
Server bind address | 0.0.0.0 |
port |
Server port | 6001 |
path |
WebSocket path | / |
max_payload_size |
Maximum message size in bytes | 100000 |
Enable Prometheus-compatible metrics:
{
"metrics": {
"enabled": true,
"port": 9601,
"host": "0.0.0.0"
}
}Access metrics at http://localhost:9601/metrics.
Adapters enable horizontal scaling by synchronizing events across multiple Soketi instances.
No configuration needed. Only works with single instance:
{
"adapter": {
"driver": "local"
}
}For multi-instance deployments:
{
"adapter": {
"driver": "redis",
"redis": {
"host": "localhost",
"port": 6379,
"password": "password",
"db": 0,
"key_prefix": "soketi"
}
}
}For NATS-based clustering:
{
"adapter": {
"driver": "nats",
"nats": {
"servers": ["nats://localhost:4222"],
"prefix": "soketi"
}
}
}Configure queue for webhook delivery:
{
"queue": {
"driver": "local"
}
}For AWS SQS:
{
"queue": {
"driver": "sqs",
"sqs": {
"queue_url": "https://sqs.us-east-1.amazonaws.com/123456789/soketi-webhooks",
"region": "us-east-1"
}
}
}Configure rate limits per application:
{
"id": "app-id",
"max_connections": 100,
"max_backend_events_per_second": 100,
"max_client_events_per_second": 100,
"max_read_requests_per_second": 100
}| Option | Description | Default |
|---|---|---|
max_connections |
Maximum concurrent connections | 100 |
max_backend_events_per_second |
Backend event rate limit | 100 |
max_client_events_per_second |
Client event rate limit | 100 |
max_read_requests_per_second |
Read request rate limit | 100 |
Enable SSL/TLS for secure connections:
{
"ssl": {
"enabled": true,
"cert_file": "/path/to/cert.pem",
"key_file": "/path/to/key.pem"
}
}Note: In production, it's recommended to use a reverse proxy (Caddy or Nginx) for SSL/TLS termination.
{
"host": "0.0.0.0",
"port": 6001,
"path": "/",
"max_payload_size": 100000,
"app_manager": {
"driver": "postgres",
"postgres": {
"host": "localhost",
"port": 5432,
"database": "soketi",
"username": "soketi",
"password": "password"
}
},
"adapter": {
"driver": "redis",
"redis": {
"host": "localhost",
"port": 6379,
"password": "password",
"db": 0,
"key_prefix": "soketi"
}
},
"queue": {
"driver": "sqs",
"sqs": {
"queue_url": "https://sqs.us-east-1.amazonaws.com/123456789/soketi-webhooks",
"region": "us-east-1"
}
},
"metrics": {
"enabled": true,
"port": 9601,
"host": "0.0.0.0"
},
"ssl": {
"enabled": false
}
}- Getting Started - Quick start guide
- API Reference - API documentation
- Deployment Guide - Production deployment