Authentication
To enable authentication, set the Tdarr Server env/config auth variable to true.
A random authSecretKey will be generated automatically when Tdarr starts up, but you can also set it manually as an env/config variable.
Once Tdarr starts up, you'll be prompted to set a username and password in the web UI (unless seededApiKey is set, see below).
After you sign in you'll need to head to the Tools -> API Keys page and create an API key for your Nodes to use.
You'll then need to set the apiKey env/config var on your Nodes so they can connect to your server.
Automatic API Key Creation
For automated deployments, you can use the seededApiKey environment variable to automatically create an API key when the server starts up. This is particularly useful for Docker deployments or automated setups where you want to ensure a specific API key exists without manual intervention.
Requirements:
- The API key must start with
tapi_ - The API key must be at least 14 characters long (including
tapi_) - The API key can only contain letters, numbers and underscores after
tapi_ - If the API key already exists, it will not be recreated
Example:
export seededApiKey=tapi_my_secure_api_key_123
Docker example:
docker run -ti \
-e "auth=true" \
-e "seededApiKey=tapi_my_secure_api_key_123" \
ghcr.io/haveagitgat/tdarr
Automatic Admin User Creation
If no users exist when the server starts, setting seededApiKey also creates an admin user with the seededApiKey value as its password. The web UI will then show the sign in page instead of the setup prompt, so the server can't be claimed by someone else before you sign in.
The admin user is only created when there are no users, so changing its password in the web UI or changing seededApiKey later will not reset it. You can change the password after signing in if you want it to be different from the API key.