Sign in

ldap-auth

3.4.8-ls7

Ldap-auth software is for authenticating users who request protected resources from servers proxied by nginx. It includes a daemon (ldap-auth) that communicates with an authentication server, and a webserver daemon that generates an authentication cookie based on the user’s credentials. The daemons are written in Python for use with a Lightweight Directory Access Protocol (LDAP) authentication server (OpenLDAP or Microsoft Windows Active Directory 2003 and 2012).

docker pull ghcr.io/linuxserver-playground/ldap-auth:latest
3.4.8-ls7 · amd64 · CI screenshot · test report

Quick start · configure#

Pick the optional settings and mods you want, set your paths, ports and values, then copy the result.

Image
Identity

The user the application runs as and its timezone.

Required
the port for ldap auth daemon
the port for ldap login page
Optional settings5

Tick what you need; it is added to every output with its value.

Mods

0 for ldap-auth, 0 universal mods suggested for it, and 13 other universal mods. Ticked mods join one DOCKER_MODS value in the order you tick them.

---
services:
  ldap-auth:
    image: ghcr.io/linuxserver-playground/ldap-auth:latest
    container_name: ldap-auth
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    ports:
      - 8888:8888
      - 9000:9000
    restart: unless-stopped

Required settings only. Tick optional settings and mods to add them.

Install on …

Adding a store to your platform

Version tags#

TagLatest buildBuiltTests
:latestStable releasesbranch master · stable3.4.8-ls7amd64 · arm64 passed

Architectures#

Pulling :latest picks the right one for your host automatically.

  • x86_64amd64-latest
  • arm64arm64v8-latest

Inside the latest image#

ghcr.io/linuxserver-playground/ldap-auth:3.4.8-ls7

Explore this build
Base image
ghcr.io/linuxserver-playground/baseimage-alpine:3.24
Upstream version
3.4.8
amd64 compressed
40.9 MB · 9 layers
arm64 compressed
41.7 MB · 9 layers
amd64 packages
105 · Alpine Linux v3.24
arm64 packages
105 · Alpine Linux v3.24
Tests
passed
Built
Reason
weekly package check

In the fleet#

Live branches, their latest release, upstream version and next scheduled check.

ldap-auth on the fleet board

live branchesloading…

Branch → tagLast buildReleasedUpstreamDriftNext checkFlags
master → :latestsuccess
3.4.8
? unknown––

Application setup#

  • This container itself does not have any settings and it relies on the pertinent information passed through in http headers of incoming requests. Make sure that your webserver is set up with the right config.
  • Here’s a sample config: nginx-ldap-auth.conf.
  • Unlike the upstream project, this image encodes the cookie information with fernet, using a randomly generated key during container creation (or optionally user defined).
  • Also unlike the upstream project, this image serves the login page at /ldaplogin (as well as /login) to prevent clashes with reverse proxied apps that may also use /login for their internal auth.

Parameters#

Ports#
PortFunctionRequired
8888:8888the port for ldap auth daemonrequired
9000:9000the port for ldap login pagerequired
Environment variables#
VariableFunctionRequired
PUID=1000User IDrequired
PGID=1000Group IDrequired
TZ=Etc/UTCTimezonerequired
FERNETKEY=Optionally define a custom valid fernet key (only needed if container is frequently recreated, or if using multi-node setups, invalidating previous authentications)optional
CERTFILE=Optionally point this to a certificate file to enable HTTP over SSL (HTTPS) for the ldap auth daemonoptional
KEYFILE=Optionally point this to the private key file, matching the certificate file referred to in CERTFILEoptional

Read-Only Operation#

This image can be run with a read-only container filesystem. For details please read the docs.

Non-Root Operation#

This image can be run with a non-root user. For details please read the docs.

Environment variables from files (Docker secrets)#

You can set any environment variable from a file by using a special prepend FILE__.

As an example:

-e FILE__MYVAR=/run/secrets/mysecretvariable

Will set the environment variable MYVAR based on the contents of the /run/secrets/mysecretvariable file.

Umask for running applications#

For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it’s value it does not add. Please read up here before asking for support.

User / Group Identifiers#

When using volumes (-v flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id your_user as below:

id your_user

Example output:

uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)

Updating Info#

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.

Below are the instructions for updating containers:

Via Docker Compose

  • Update images:

    • All images:

      docker-compose pull
    • Single image:

      docker-compose pull ldap-auth
  • Update containers:

    • All containers:

      docker-compose up -d
    • Single container:

      docker-compose up -d ldap-auth
  • You can also remove the old dangling images:

    docker image prune

Via Docker Run

  • Update the image:

    docker pull ghcr.io/linuxserver-playground/ldap-auth:latest
  • Stop the running container:

    docker stop ldap-auth
  • Delete the container:

    docker rm ldap-auth
  • Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)

  • You can also remove the old dangling images:

    docker image prune

Image Update Notifications - Diun (Docker Image Update Notifier)

Tip

We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.

Building locally#

If you want to make local modifications to these images for development purposes or just to customize the logic:

git clone https://github.com/linuxserver-playground/docker-ldap-auth.git
cd docker-ldap-auth
docker build \
  --no-cache \
  --pull \
  -t ghcr.io/linuxserver-playground/ldap-auth:latest .

The ARM variants can be built on x86_64 hardware and vice versa using ghcr.io/linuxserver/qemu-static

docker run --rm --privileged ghcr.io/linuxserver/qemu-static --reset

Once registered you can define the dockerfile to use with -f Dockerfile.aarch64.

Every push builds and tests the image with the shared workflow in linuxserver-playground/workflows; every build’s tests, screenshots and package changes are on the image’s builds on the website.

Builds#

The newest five builds per branch, each with its CI report; 2 older releases are on GitHub, listed below.

TagBuiltReasonChangeResultSize
3.4.8-ls7master · 85669954weekly package checkbasesuccess40.9 MB amd6441.7 MB arm64
3.4.8-ls6master · ed9f57a2weekly package checkbasesuccess40.7 MB amd6441.5 MB arm64
3.4.8-ls5master · 54a77a2bweekly package checkbasesuccess40.7 MB amd6441.5 MB arm64
3.4.8-ls4master · a27013e1weekly package checkbasesuccess40.7 MB amd6441.5 MB arm64
3.4.8-ls3master · 4d0406e2release check or requested rebuildbasesuccess40.5 MB amd6441.3 MB arm64
Older releases2Release, run record and run on GitHub

Mods#

Add a mod with DOCKER_MODS=<image>; separate several with |.

All mods for ldap-auth

No mod targets ldap-auth specifically; the 13 universal mods work with every image.

Reverse proxy#

ldap-auth listens on http://ldap-auth:9000.

What you named the ldap-auth container; SWAG resolves it on the shared network.

Uncomments the matching include lines; API locations stay open so client apps keep working.

  • Save as /config/nginx/proxy-confs/ldap-auth.subdomain.conf in SWAG (drop the .sample) and restart SWAG.
  • Your DNS needs a record for ldap-auth.yourdomain.com (a CNAME to the domain, or a wildcard), and SWAG's SUBDOMAINS must cover it.
  • The ldap-auth container and SWAG must share a user-defined Docker network so the name resolves.
## Version 2026/11/25
# make sure that your ldap-auth container is named ldap-auth
# make sure that your dns has a cname set for ldap-auth

server {
    listen 443 ssl;
#    listen 443 quic;
    listen [::]:443 ssl;
#    listen [::]:443 quic;

    server_name ldap-auth.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    # enable for Authentik (requires authentik-location.conf in the location block)
    #include /config/nginx/authentik-server.conf;

    # enable for Tinyauth (requires tinyauth-location.conf in the location block)
    #include /config/nginx/tinyauth-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        # enable for Authentik (requires authentik-server.conf in the server block)
        #include /config/nginx/authentik-location.conf;

        # enable for Tinyauth (requires tinyauth-server.conf in the server block)
        #include /config/nginx/tinyauth-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app ldap-auth;
        set $upstream_port 9000;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}

Default sample.

Source: linuxserver-playground.github.io/hub/api/v1/catalog/ldap-auth/proxy.json

Changelog#

  1. Rebase to Alpine 3.24.

  2. Add legacy-cgi. Fix fernet key storage.

  3. Rebase to Alpine 3.21. Add support for read-only and non-root.

  4. Rebase to Alpine 3.20.

  5. Rebase to Alpine 3.19.

  6. Sync upstream changes, including the ability to disable referrals with X-Ldap-DisableReferrals.

  7. Rebase to Alpine 3.18, deprecate armhf.

  8. Rebase to alpine 3.17.

19 earlier entries
  1. Rebase to alpine 3.15.
  2. Add linuxserver wheel index.
  3. Clean up cargo/rust cache.
  4. Rebasing to alpine 3.13.
  5. Set form action correctly.
  6. Fix bug related to unset optional CERTFILE and KEYFILE vars.
  7. Add support for HTTP over SSL (HTTPS).
  8. Add support for optional user defined fernet key.
  9. Rebasing to alpine 3.12, serve login page at /ldaplogin as well as /login, to prevent clashes with reverese proxied apps.
  10. Add support for self-signed CA certs.
  11. Switch to python3.
  12. Rebasing to alpine 3.11.
  13. Fall back to base64 encoding when basic http auth is used.
  14. Rebasing to alpine 3.10.
  15. Switching to new Base images, shift to arm32v7 tag.
  16. Rebasing to alpine 3.9.
  17. Update pip
  18. Add TZ parameter, remove unnecessary PUID/PGID params
  19. Initial release.

Support#

Questions about running ldap-auth? Start with the documentation and the community; open an issue for bugs.

  • Shell access whilst the container is running:

    docker exec -it ldap-auth /bin/bash
  • To monitor the logs of the container in realtime:

    docker logs -f ldap-auth
  • Container version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' ldap-auth
  • Image version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' ghcr.io/linuxserver-playground/ldap-auth:latest

Community project

Improve ldap-auth

This image is kept up by volunteers, and you can be one of them. You don't need to know how the pipeline works: point an AI agent at the harness and describe what you want. It reproduces the problem in your Docker, tests the change and drafts the pull request for you to check.

Ask your agent

  • Something is wrong with the ldap-auth image: <what you saw>. Reproduce it, fix it and draft the PR.
  • Add <package> to the ldap-auth image, test it and draft the PR.
  • Make a mod for ldap-auth that <what you need>, and test it.

Contributing an image Every way to help Get the harness (opens in a new tab)

Related

Browse all

doublecommander

03760012-ls11

Double Commander is a free cross platform open source file manager with two panels side by side. It is inspired by Total Commander and features some new ideas.

0 GitHub starsselkiesarm64

fail2ban

1.1.0-r2-ls10

Fail2ban is a daemon to ban hosts that cause multiple authentication errors.

0 GitHub starsalpinearm64

hishtory-server

v0.335-ls7

hiSHtory is a better shell history. It stores your shell history in context (what directory you ran the command in, whether it succeeded or failed, how long it took, etc). This is all stored locally and end-to-end encrypted for syncing to to all your other computers.

0 GitHub starsalpinearm64

kali-linux

42353ed8-ls13

Kali-linux - is an Advanced Penetration Testing Linux distribution used for Penetration Testing, Ethical Hacking and network security assessments. KALI LINUX ™ is a trademark of OffSec.

0 GitHub starsselkiesarm64