Skip to content

Server Configuration

The backend server is configured via environment variables, typically set in your .env file or Docker Compose.

VariableDescriptionDefault
PANKHA_PORTHTTP/WebSocket Port3143
DATABASE_URLConnection string for PostgreSQLpostgresql://user:pass@host:5432/db
NODE_ENVEnvironment modeproduction
LOG_LEVELServer logging verbosityinfo

If port 3143 is already in use, change it in your .env file:

Terminal window
PANKHA_PORT=7000

Then restart:

Terminal window
docker compose down
docker compose up -d

Note: Update all agent config.json files to use the new port in their server_url.


To stop all services:

Terminal window
docker compose down

To remove all data (including database):

Terminal window
docker compose down -v

⚠️ Warning: The -v flag deletes all stored data permanently.


Before deleting volumes, understand where your data lives:

---
title: Docker Storage & Networking Map
---
graph TD
    Host[Host Machine]
    
    subgraph "Docker Environment"
        App[Pankha Server]
        DB[Postgres Database]
    end
    
    subgraph "Persistent Storage"
        VolDB[(pankha-db-data)]
    end
    
    Host -->|Port: 3143| App
    App <-->|Internal Net| DB
    DB <-->|Persists To| VolDB
    
    style VolDB fill:#ddd,stroke:#333,stroke-width:2px,shape:cylinder,color:#000
    style App fill:#ccffcc,stroke:#333,color:#000
    style DB fill:#ccffcc,stroke:#333,color:#000

/deployment-folder/
├── compose.yml # Container orchestration
├── .env # Environment variables (Port, DB, etc.)
└── volumes/ # Persistent data storage
└── pankha-db-data/ # Database files (Persisted from Postgres)

See Agents-Advanced-Settings for agent-specific configuration options like hysteresis, fan step %, and emergency temperature.