h4ckbot
Self-Hosting

Configuration reference

All environment variables for backend/.env. Copy backend/.env.example as a starting point.

Backend

H4CKBOT_LICENSE_KEYrequiredLicence key for the h4ckbot model. Obtained after access approval.
JWT_SECRETrequiredSecret used to sign session tokens. Generate with python -c 'import secrets; print(secrets.token_hex(32))'
DATABASE_URLrequiredPostgreSQL connection string. Use the internal Docker hostname: postgresql+asyncpg://postgres:password@postgres:5432/pentest_ai
REDIS_URLrequiredRedis connection string. Internal: redis://redis:6379/0
COOKIE_SECURErequiredSet to true in production. Ensures the session cookie is only sent over HTTPS.
APP_BASE_URLrequiredFull URL of your instance, e.g. https://ai.example.com. Used in verification emails.
ENVIRONMENTrequiredSet to production for production deploys.
RESEND_API_KEYrequiredResend API key for transactional email (verification, password reset).
EMAIL_FROMrequiredFrom address for outbound email, e.g. noreply@example.com.
POSTGRES_USERoptionalDatabase user. Defaults to postgres.
POSTGRES_PASSWORDoptionalDatabase password. Defaults to postgres — change this in production.
POSTGRES_DBoptionalDatabase name. Defaults to pentest_ai.

Frontend build args

These are baked in at build time. Set them in your shell or .env before running docker compose up --build.

NEXT_PUBLIC_PERSONA_NAMEoptionalDisplay name shown in the navbar. Defaults to h4ckbot.
NEXT_PUBLIC_PLAUSIBLE_DOMAINoptionalDomain for Plausible analytics. Leave blank to disable analytics.
BACKEND_INTERNAL_URLoptionalInternal URL the Next.js server uses to reach the backend. Defaults to http://backend:8000.

See also