[Unit] Description=Traefik Documentation=https://docs.traefik.io After=network-online.target AssertFileIsExecutable=/usr/bin/traefik [Service] # Run traefik as its own user (create new user with: useradd -r -s /bin/false -U -M traefik) User=traefik AmbientCapabilities=CAP_NET_BIND_SERVICE # configure service behavior Type=notify ExecStart=/usr/bin/traefik --configfile=/etc/traefik/static.yaml WorkingDirectory=/etc/traefik Restart=always WatchdogSec=1s # lock down system access # prohibit any operating system and configuration modification ProtectSystem=strict # create separate, new (and empty) /tmp and /var/tmp filesystems PrivateTmp=true # make /home directories inaccessible ProtectHome=true # turns off access to physical devices (/dev/...) PrivateDevices=true # make kernel settings (procfs and sysfs) read-only ProtectKernelTunables=true # make cgroups /sys/fs/cgroup read-only ProtectControlGroups=true ReadWritePaths=/etc/traefik ReadWritePaths=/var/log/traefik # limit number of processes in this unit #LimitNPROC=1 [Install] WantedBy=multi-user.target