Configuration

The environment variables for hosting a Sugabots installation.

Sugabots reads its settings from environment variables. With Docker Compose, set them under environment in compose.yml.

Database

VariableDefaultDescription
DATABASE_URLRequiredPostgreSQL connection string. It may go through a transaction pooler such as PgBouncer when DATABASE_DIRECT_URL is set.
DATABASE_DIRECT_URLDATABASE_URLA direct connection to PostgreSQL, set when DATABASE_URL goes through a transaction pooler. The workflow engine's locks and live updates use it, in a pool of up to 6 connections.
DATABASE_POOL_SIZE10The most connections the server's main pool opens on DATABASE_URL. Sign-in holds up to 2 more. Without a pooler, keep the total under the database's max_connections, less what its host reserves.

Server

VariableDefaultDescription
NODE_ENVproductiondevelopment or production.
PORT3000Port the API binds.
PUBLIC_URLhttp://localhost: followed by PORTWhere a browser reaches the API, without its /api path. Links in emails and OAuth redirects start here, so it must not be a container-internal address.
WEB_APP_URLPUBLIC_URLWhere the web app is served, when it is hosted apart from the API. Invite links and connection sign-ins return here.
CONTENT_ORIGINunsetAn origin of its own for bot-made HTML pages, e.g. https://pages.example-content.com, pointed at the same server. It serves pages only, isolated from the app's cookies and site; a separate domain isolates best. Its hostname must differ from the app's, and a proxy in front must pass the request's Host header through unchanged, which is how the server tells the two apart. Unset, pages are written into their frame instead.
SUGABOTS_SKIP_MIGRATIONSfalseDocker image only. Set to true to skip applying pending migrations on start.

Secrets

Generate each with openssl rand -base64 32. Keep them private and backed up.

VariableDefaultDescription
BETTER_AUTH_SECRETRequiredSigning key for sessions and tokens. Changing it signs everybody out.
CREDENTIALS_ENCRYPTION_KEYRequiredSeals every stored credential: model and search provider keys, connection secrets, and connection sign-ins. Losing it makes them unreadable.

Access

VariableDefaultDescription
SIGNUP_MODEclosedWho may create an account. closed: nobody signs themselves up; people arrive by invitation to a workspace, except the first account on a new installation. referral: also anybody with a member's referral link. open: anybody.
REQUIRE_EMAIL_VERIFICATIONfalseWhether a new account must open a link in its inbox before it gets a session. With the console email provider, the link is printed to the server's console.

Network

VariableDefaultDescription
ALLOW_UNSAFE_WORKSPACE_URLSfalseWhether the addresses a workspace gives, for its model and search providers and its connections, may be plain HTTP or on a local network such as localhost or your LAN. Unsafe because plain HTTP is unencrypted and a workspace can then reach whatever else is on your network. Turn it on for a self-hosted install using Ollama, LM Studio, vLLM, local MCP servers and the like; keep it off on an installation serving other people's workspaces.
ALLOW_PRIVATE_WEB_FETCH_NETWORKfalseWhether an agent's web_fetch tool may read pages at private addresses. Turn it on for a self-hosted install whose agents should read an intranet.
ALLOW_PRIVATE_MODEL_PROVIDER_NETWORKfalseDeprecated: use ALLOW_UNSAFE_WORKSPACE_URLS, which takes precedence when both are set. Still read, with a warning in the logs.

Email

VariableDefaultDescription
EMAIL_PROVIDERconsoleconsole, which prints each email to the server's log, webhook or resend.
EMAIL_WEBHOOK_URLRequired for webhookReceives each email as JSON: from, to, cc, bcc and replyTo as {email, name} addresses, subject, and text and/or html. Must use HTTPS in production, and answer with a 2xx status within 15 seconds.
EMAIL_WEBHOOK_TOKENNoneFor webhook. Sent as a bearer token with each delivery.
EMAIL_RESEND_API_KEYRequired for resendA Resend API key with permission to send.
EMAIL_TRANSACTIONAL_FROMRequired in productionSender of emails a user's own action triggers, such as verification and invitations, like Sugabots <no-reply@example.com>.

File storage

VariableDefaultDescription
BLOB_STORE_PROVIDERpostgresWhere files are kept, such as tool results too large to hand a model whole. postgres keeps them in the database, up to 100 MiB each. filesystem keeps them on disk, for a single server. Choose before any files are kept: changing it doesn't move them.
BLOB_STORE_FILESYSTEM_ROOTRequired for filesystemThe directory files are kept under. In the Docker image, mount a volume at /data/files. A folder from the server must be writable by uid 1000. Back it up with the database.
THREAD_FILE_MAX_BYTESThe blob store's limitThe largest file a thread keeps, in bytes, when lower than what the blob store keeps.

Web app

Vite inlines anything prefixed VITE_ into the bundle, so nothing secret goes here.

VariableDefaultDescription
VITE_API_URL/api on the page's own originWhere the API is, path included. Set it when the web app is hosted apart from the API.