Skip to main content

Integrate with Paperless-ngx

Support level: Community

What is Paperless-ngx?

Paperless-ngx is a community-supported open-source document management system that transforms your physical documents into a searchable online archive.

-- https://docs.paperless-ngx.com/

Preparation

The following placeholders are used in this guide:

  • paperless.company is the FQDN of the Paperless-ngx installation.
  • authentik.company is the FQDN of the authentik installation.
info

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.

authentik configuration

Redirect URI changes in authentik 2026.5

In authentik versions earlier than 2026.5, all Redirect URIs are automatically treated as Authorization type. If you are using one of these older authentik versions, add only the Authorization URL to your Redirect URIs and do not configure a Post Logout URI.

To support the integration of Paperless-ngx with authentik, you need to create an application/provider pair in authentik.

Create an application and provider

  1. Log in to authentik as an administrator and open the authentik Admin interface.

  2. Navigate to Applications > Applications and click New Application to create an application and provider pair. (Alternatively you can first create a provider separately, then create the application and connect it with the provider.)

    • Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Note the Slug value because it is required later.
    • Choose a Provider type: select OAuth2/OpenID Connect 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.
      • Note the Client ID and Client Secret values because they will be required later.
      • Add a Redirect URI of type Strict Authorization as https://paperless.company/accounts/oidc/authentik/login/callback/.
    • 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.
  3. Click Submit to save the new application and provider.

Paperless-ngx configuration

Add the following settings to your Paperless-ngx configuration file:

Paperless-ngx reads Docker configuration from docker-compose.env.

docker-compose.env
PAPERLESS_APPS=allauth.socialaccount.providers.openid_connect
PAPERLESS_SOCIALACCOUNT_PROVIDERS={"openid_connect":{"OAUTH_PKCE_ENABLED":true,"APPS":[{"provider_id":"authentik","name":"authentik","client_id":"<Client ID from authentik>","secret":"<Client Secret from authentik>","settings":{"server_url":"https://authentik.company/application/o/<application_slug>/.well-known/openid-configuration","fetch_userinfo":true}}],"SCOPE":["openid","profile","email"]}}
PAPERLESS_LOGOUT_REDIRECT_URL=https://authentik.company/application/o/<application_slug>/end-session/
PAPERLESS_SOCIAL_AUTO_SIGNUP=true
PAPERLESS_SOCIALACCOUNT_ALLOW_SIGNUPS=true

Restart Paperless-ngx for the changes to take effect:

docker compose down && docker compose up -d

Remove PAPERLESS_SOCIAL_AUTO_SIGNUP if you want to allow only pre-created Paperless-ngx users to sign in with authentik.

To add authentik authentication to an existing Paperless-ngx user, log in to Paperless-ngx with local authentication, click the profile icon in the top-right, click My Profile, and then click Connect new social account.

Configure group sync (optional)

To sync groups from authentik, create matching groups in Paperless-ngx and add the following setting to your Paperless-ngx configuration file:

docker-compose.env or paperless.conf
PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true

With the default authentik profile scope, Paperless-ngx can read the groups claim. If you use a custom authentik scope mapping that publishes group names under another claim, set PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS_CLAIM to that claim name and include the scope that contains the claim in PAPERLESS_SOCIALACCOUNT_PROVIDERS.

Disable local login (optional)

After you have validated SSO, you can disable the Paperless-ngx username and password login form:

docker-compose.env or paperless.conf
PAPERLESS_DISABLE_REGULAR_LOGIN=true
PAPERLESS_REDIRECT_LOGIN_TO_SSO=true

This does not disable the Django admin login or local credential authentication through the Paperless-ngx API.

Configuration verification

To confirm that authentik is properly configured with Paperless-ngx, open Paperless-ngx, click the authentik login button, and complete the authentik sign-in flow.

Resources