Integrate with Sonarr
Support level: Community
What is Sonarr?
Sonarr is an internet PVR for Usenet and Torrents.
Sonarr does not provide native SSO. This guide uses the authentik Proxy Provider to authenticate requests before they reach Sonarr.
Preparation
The following placeholders are used in this guide:
sonarr.companyis the FQDN of the Sonarr installation.authentik.companyis the FQDN of the authentik installation.
This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.
When Sonarr is configured for external authentication, Sonarr trusts the authentication layer in front of it. Make sure users can access Sonarr only through authentik, and do not expose the Sonarr backend directly to the internet.
authentik configuration
To support the integration of Sonarr with authentik, you need to create an application/provider pair in authentik and assign it to a proxy outpost.
Create an application and provider
-
Log in to authentik as an administrator and open the authentik Admin interface.
-
Navigate to Applications > Applications and click New Application to open the application wizard.
- Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings.
- Choose a Provider type: select Proxy Provider as the provider type.
- Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
- Set Mode to Proxy.
- Set External host to
https://sonarr.company. - Set Internal host to the URL that the authentik proxy outpost uses to reach Sonarr.
- If Sonarr and the authentik proxy outpost are both running in the same Docker deployment, set the value to
http://<sonarr_container_name>:8989. - If Sonarr runs on a different server than the authentik proxy outpost, set the value to
http://sonarr.company:8989.
- If Sonarr and the authentik proxy outpost are both running in the same Docker deployment, set the value to
- Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's Application Dashboard page.
-
Click Submit to save the new application and provider.
Configure proxy outpost
The proxy provider requires an authentik proxy outpost. If you do not already have a proxy outpost, follow the outpost documentation to create and deploy one.
Add the Sonarr application to a proxy outpost that will serve it:
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Applications > Outposts.
- Click the edit icon for the proxy outpost. This can be the built-in authentik Embedded Outpost or another proxy outpost.
- Under Available Applications, select the Sonarr application and move it to Selected Applications.
- Click Update to save your changes.
Sonarr configuration
Configure Sonarr to trust the external authentication layer provided by authentik.
-
In Sonarr, navigate to System > Status and note the AppData directory value. The
config.xmlfile is stored in this directory. -
Stop Sonarr.
-
Open
config.xmland replace any existingAuthenticationMethodvalue withExternal. Make sure that the file contains only oneAuthenticationMethodentry.config.xml<AuthenticationMethod>External</AuthenticationMethod> -
Start Sonarr.
Configure DNS or your reverse proxy so that requests for https://sonarr.company are routed to the authentik proxy outpost. The authentik proxy outpost then forwards authenticated requests to Sonarr through the Internal host configured on the proxy provider.
Configuration verification
To verify the login flow, open Sonarr. You should be redirected to authentik before the Sonarr web interface is shown.