Environment Variables
Ditto uses the following environment variables to configure its behavior:
Essential
These following variables are required:
DITTO_NSEC- Ditto secret key for internal use. Site configuration, NIP-05 grants, moderation events, and more are signed with this key.
Server
These variables configure the HTTP server:
PORT- Port for the HTTP server to listen on. Defaults to4036.LOCAL_DOMAIN- Domain name for the Ditto server, exhttps://example.com. Defaults tohttp://localhost:4036.
Database
DATABASE_URL- URL for the Postgres database. Supportspostgres://,file://andmemory://protocols. Defaults tofile://data/pgdata. File and memory use PGlite, but it is recommended to use a real Postgres database in production.PG_POOL_SIZE- Number of connections to the Postgres database. Defaults to10.
Timeouts
DB_TIMEOUT_DEFAULT- Default timeout for database queries in milliseconds. Defaults to5000.DB_TIMEOUT_RELAY- Timeout for relay queries in milliseconds. Defaults to1000.DB_TIMEOUT_TIMELINES- Timeout for timelines in the API, eg home, notifications, hashtag timelines, and account timelines. Defaults to15000.
Miscellaneous
FIREHOSE_ENABLED- Whether to connect to continuously stream data from other relays. Defaults totrue.DITTO_POLICY- Policy plugin import. See Policies for more information.