Required Variables
These variables must be set for Dubly to start.API password for authentication. Required for all
/api/* endpoints via the X-API-Key header.Security Note: Use a strong, randomly generated password. This is the only authentication mechanism for the admin UI and API.Comma-separated list of allowed domains for short links.Example:
short.io,go.example.com,links.company.comDomain matching is case-insensitive. Only links with these domains can be created or accessed.Server Configuration
Port number the HTTP server listens on.Example:
3000Application name displayed in the admin UI.Example:
Company LinksDatabase Configuration
Path to the SQLite database file. Will be created automatically if it doesn’t exist.Example:
/var/lib/dubly/dubly.dbThe database file should be on a persistent volume in production environments.Geolocation
Path to the MaxMind GeoLite2-City.mmdb file for IP geolocation lookups.Example:
/var/lib/dubly/GeoLite2-City.mmdbWhen not set or empty, geolocation is gracefully disabled. Analytics will still be collected but without geographic data (country, city, region, coordinates will be empty).Download the GeoLite2 database from MaxMind.Analytics Configuration
Dubly uses an in-memory buffer for click analytics that periodically flushes to the database. These settings control the buffering behavior.How often the analytics buffer is flushed to disk.Format: Duration string (e.g.,
10s, 1m, 90s)Example: 60s for one minute intervalsShorter intervals mean more frequent writes (higher I/O) but less data loss on crashes. Must be a positive value.Maximum number of click events held in memory before flushing.Example:
100000When the buffer is full, new clicks are dropped rather than blocking redirects. Size this based on your expected traffic volume and flush interval. Must be a positive value.Cache Configuration
Maximum number of short links cached in memory for fast redirects.Example:
25000The cache uses an LRU (Least Recently Used) eviction policy. Higher values reduce database lookups for popular links but consume more memory. Must be a positive value.Memory estimate: Each cached entry uses approximately 200-300 bytes, so the default 10,000 entries use roughly 2-3 MB of RAM.Validation
Dubly validates configuration on startup:DUBLY_PASSWORDandDUBLY_DOMAINSmust be non-emptyDUBLY_FLUSH_INTERVAL,DUBLY_BUFFER_SIZE, andDUBLY_CACHE_SIZEmust be positive values- Invalid values for numeric/duration fields fall back to defaults
- Invalid domain list format will cause startup failure