Provider connection error Cannot connect to the Docker daemon

I intend to use version v2.0 of Traefik and have therefore tested something first. If I want to use the Swarm Mode, I always get the following log entries:

time="2019-09-22T21:30:28Z" level=error msg="Provider connection error Cannot connect to the Docker daemon at tcp://127.0.0.1:2377. Is the docker daemon running?, retrying in 507.606314ms" providerName=docker

My docker.yml file:

version: '3.5'

services:
  reverse-proxy:
    image: traefik:v2.0
    command: --api.insecure=true --providers.docker
    environment:
      - "TRAEFIK_LOG_LEVEL=DEBUG"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik:/etc/traefik

  whoami:
    image: containous/whoami
    deploy:
      labels:
        - traefik.http.routers.whoami.rule=Host(`w.deubahn.de`)
        - traefik.http.services.whoami.loadbalancer.server.port=8080

My traefik.toml file:

[providers]
    [providers.docker]
        endpoint = "tcp://127.0.0.1:2377"
        swarmMode = true
        watch = true

[api]
    insecure = true

Source: StackOverflow