API Key Authentication
All API endpoints under/api/* require authentication using an API key passed in the X-API-Key header.
Header Format
Example Request
Setting the API Password
The API password is configured via theDUBLY_PASSWORD environment variable when starting the server.
During Installation
If you used the install script, you were prompted to set the API password. It’s stored in/opt/dubly/.env:
Manual Configuration
For local development or manual deployments:.env file:
Changing the Password
- Update the
DUBLY_PASSWORDin your.envfile - Restart the Dubly service:
Authentication Errors
Missing API Key
Request:Invalid API Key
Request:Security Best Practices
Protect Your API Key
- Never commit your API password to version control
- Use environment variables or secure secret management systems
- Rotate regularly - change your password periodically
- Use HTTPS - always access the API over HTTPS in production
Strong Passwords
Generate a strong, random password:HTTPS in Production
The install script configures Caddy to automatically provision and renew SSL certificates. Always use HTTPS for API requests in production:Single User Design
Dubly is designed as a single-user system. There is one API password that grants full access to:- Create, read, update, and delete all links
- Access all analytics data
- Manage all domains
- Running separate Dubly instances
- Implementing a proxy with custom authorization logic
- Contributing multi-user features to the project