Traefik with docker/podman provider fails: Permission denied

I’m trying to setup traefik with the podman/docker provider but I’m getting the following error message:

Failed to retrieve information of the docker client and server host error="permission denied while trying to connect to the Docker daemon socket at unix:///run/user/1000/podman/podman.sock ..

Here’s my config:

{ config, ... }:
{
  services.traefik = {
    enable = true;
    staticConfigOptions = {
      group = "podman";
      api = {
        dashboard = true;
      };

      providers = {
        docker = {
          exposedByDefault = false;
          endpoint = "unix:///run/user/1000/podman/podman.sock";
        };
      };
      entryPoints = {
        http = {
          address = ":80";
        };
      };
    };

    dynamicConfigFile = config.age.secrets.traefik-dynamicConfigFile.path;
  };
}

This is the output of eza -lg /run/user/1000/podman:

Permissions Size User   Group Date Modified Name
srw-rw----     - tornax users 26 Sep 14:29   podman.sock

Does anyone know how to fix that?

Hi, I believe group = "podman"; should be moved outside of staticConfigOptions

I did’t know it was possible to run traefik outside of docker to reverse proxy http traffic into docker, I’m going to test that today :slight_smile:

EDIT: it does work with docker compose (without exposing ports, replicas and load balancing are ok), but it doesn’t work in swarm mode.