Deploy acme-dns with Traefik on Docker


My main server has several applications installed and I am using Traefik as reversed proxy to route different traffics and obtain ssl for my different sites.

Now I want to set up an acme-dns on the same server. I am testing it on a backup server but I am not able to get it to work. Here is my docker-compose.yml

version: '3.3'

    image: traefik
    command: --api --docker
      - "80:80"
      - "443:443"
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik.toml:/traefik.toml
      - ./acme.json:/acme.json
      - "traefik.port=8080"
      - "traefik.backend=reverse-proxy"
      - "traefik.frontend.rule=Host:ta.example"
      - "traefik.enable=true"

    image: joohoi/acme-dns:latest
      - ./acme-dns/config:/etc/acme-dns:ro
      - ./acme-dns/data:/var/lib/acme-dns
      - ""

After setting up the traefik.toml I run sudo docker-compose up -d

Everything look normal, both container were created and running fine.

However, when I went to I was getting Bad Gateway

Here is the config file I modified and being used

# DNS interface. Note that systemd-resolved may reserve port 53 on
# In this case acme-dns will error out and you will need to define the listening interface
# for example: listen = ""
listen = ""
# protocol, "both", "both4", "both6", "udp", "udp4", "udp6" or "tcp", "tcp4", "tcp6"
protocol = "both"
# domain name to serve the requests off of
domain = ""
# zone name server
nsname = ""
# admin email address, where @  is substituted with .
nsadmin = ""
# predefined records served in addition to the TXT
records = [
    # domain pointing to the public IP of your acme-dns server
    " A Server Public IP",
    # specify that will resolve any * records
    " NS",
# debug messages from CORS etc
debug = false

# Database engine to use, sqlite3 or postgres
engine = "sqlite3"
# Connection string, filename for sqlite3 and postgres://$username:$password@$host/$db_name for postgres
# Please note that the default Docker image uses path /var/lib/acme-dns/acme-dns.db for sqlite3
connection = "/var/lib/acme-dns/acme-dns.db"
# connection = "postgres://user:password@localhost/acmedns_db"

# domain name to listen requests for, mandatory if using tls = "letsencrypt"
api_domain = ""
# listen ip eg.
ip = ""
# disable registration endpoint
disable_registration = false
# autocert HTTP port, eg. 80 for answering Let's Encrypt HTTP-01 challenges. Mandatory if using tls = "letsencrypt".
autocert_port = "80"
# listen port, eg. 443 for default HTTPS
port = "80"
# possible values: "letsencrypt", "cert", "none"
tls = "none"
# only used if tls = "cert"
tls_cert_privkey = "/etc/tls/"
tls_cert_fullchain = "/etc/tls/"
# only used if tls = "letsencrypt"
acme_cache_dir = "api-certs"
# CORS AllowOrigins, wildcards can be used
corsorigins = [
# use HTTP header to get the client ip
use_header = false
# header name to pull the ip address / list of ip addresses from
header_name = "X-Forwarded-For"

# logging level: "error", "warning", "info" or "debug"
loglevel = "debug"
# possible values: stdout, TODO file & integrations
logtype = "stdout"
# file path for logfile TODO
# logfile = "./acme-dns.log"
# format, either "json" or "text"
logformat = "text"

Any help is much appreciated.

Thank you.

did acme-dns created certificate successfully?

Yes it does work.

I have tried using it (registered with author’s site to obtain a wildcard cert with certbot successfully.

That’s why I want to host it myself.

looks like traefik wants more options to specified by lable for client containers?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.