nginx-proxy with Docker: Automatic HTTPS from Container Settings (Linux, Windows, Mac)
Before you start
- 19 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
nginx-proxy is a free, open-source Nginx reverse proxy in a Docker container that watches your other containers and sends each host name to the right one, based on a single setting (VIRTUAL_HOST); its companion, acme-companion, then gets and renews the Let's Encrypt certificate for that name, so one container setting gives you HTTPS.

Logo: the official nginx-proxy project (github.com/nginx-proxy/nginx-proxy, file docs/img/nginx-proxy_light_theme.png, MIT repository licence)
There is no web page and no site list to edit: you add two lines to the app's own Compose file and the route and certificate follow. It is a different tool from the point-and-click Nginx Proxy Manager we covered earlier.
| What | Value (official sources, read 3 December 2026) |
|---|---|
| Current versions | nginx-proxy 1.11.8 (27 November 2026) and acme-companion v2.8.3 (27 November 2026) |
| Images to pin | nginxproxy/nginx-proxy:1.11.8 and nginxproxy/acme-companion:2.8.3 (tags checked on Docker Hub; no v) |
| Time and size | About 40 minutes plus DNS waiting (our estimate). About 76 MB and 29 MB compressed for amd64 (Docker Hub API) |
| Ports | TCP 80 and 443 on the proxy only |
| Licence | MIT for both projects |
| Official docs | nginx-proxy and acme-companion |
At a glance:
- What it is: two containers. nginx-proxy routes; acme-companion gets certificates.
- Add a site:
VIRTUAL_HOST(route) andACME_HOST(certificate) on the app's container. - The price: the Docker socket is mounted in both containers. A separate docker-gen setup reduces that.
- Not a login page: it secures the connection. Add a password file or single sign-on.
How it fits together#
Both containers read the Docker socket. nginx-proxy turns each VIRTUAL_HOST into an Nginx route. acme-companion asks Let's Encrypt for a certificate for each ACME_HOST, saves it in a shared folder, and nginx-proxy starts using it.
Drawn for this guide from the official docs. The dashed line means nginx reads the file; no request is sent.
HTTP-01 is the default way Let's Encrypt checks the name is yours: it visits http://your-name/.well-known/acme-challenge/... on port 80, and the companion puts the answer file in the shared html folder.
Before you start#
Note: every domain, e-mail and password on this page is a dummy (
app.example.com,[email protected], the useradmin). Replace them with your own, and keep real secrets out of Git.
You need an always-on machine with Docker and Compose and a domain whose DNS you can edit.
| System | What to have |
|---|---|
| Linux | Docker Engine and the Compose plugin |
| Windows | Windows 10 or later, Docker Desktop (WSL 2 backend), PowerShell |
| Mac | Docker Desktop, Intel or Apple Silicon |
docker --version docker compose version
HTTP-01 certificates need (acme-companion README): a DNS A record for app.example.com (and no wrong AAAA record), public TCP ports 80 and 443 forwarded to this machine (never block port 80), and nothing else listening there. Check the ports:
sudo ss -ltnp 'sport = :80 or sport = :443'
Mac: sudo lsof -nP -iTCP:80 -iTCP:443 -sTCP:LISTEN. Windows: Get-NetTCPConnection -State Listen -LocalPort 80,443 -ErrorAction SilentlyContinue. No output means the ports are free.
Checklist:
- [ ] Both Docker commands print a version
- [ ] Ports 80 and 443 are free, and you can edit DNS and port forwarding
Tested by DIY Lab Hub: not yet. Commands come from the official docs and source at the release tags, read on 3 December 2026. We did not run them on a real machine.
Tip: A laptop with Docker Desktop (Windows, Mac) rarely has a reachable public port 80. You can still follow Steps 1 to 3 there to learn the routing. No public port 80 at all? Use the DNS-01 challenge (see the FAQ).
Step 1: Create the folders, the network and the settings file#
Everything lives under ~/docker_volumes/nginx-proxy. The certs and acme folders hold private keys and your Let's Encrypt account, so keep them private. The .env file starts with the test Let's Encrypt server (staging), so mistakes do not use up real limits.
Linux#
mkdir -p ~/docker_volumes/nginx-proxy/{certs,html,acme,vhost.d,htpasswd,backups}
cd ~/docker_volumes/nginx-proxy
cat > .env << 'EOF'
[email protected]
LE_CA_URI=https://acme-staging-v02.api.letsencrypt.org/directory
EOF
chmod 600 .env
docker network create proxy
Windows (PowerShell)#
$base = "$HOME\docker_volumes\nginx-proxy"
foreach ($d in "certs","html","acme","vhost.d","htpasswd","backups") {
New-Item -ItemType Directory -Force "$base\$d" | Out-Null
}
Set-Location $base
@'
[email protected]
LE_CA_URI=https://acme-staging-v02.api.letsencrypt.org/directory
'@ | Set-Content -Encoding ascii .env
docker network create proxy
Mac (Terminal)#
Same commands as Linux.
Replace the dummy e-mail; Let's Encrypt can warn you about expiring certificates there. The network proxy is the one our Traefik guide also uses; "already exists" is fine.
Check it worked. ls -la (Windows: Get-ChildItem -Force) shows .env and the six folders, and docker network ls lists proxy.
Step 2: Write the Compose file and start the two containers#
Linux#
cd ~/docker_volumes/nginx-proxy
cat > compose.yaml << 'EOF'
services:
nginx-proxy:
image: nginxproxy/nginx-proxy:1.11.8
container_name: nginx-proxy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
labels:
- "com.github.nginx-proxy.nginx"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./certs:/etc/nginx/certs:ro
- ./html:/usr/share/nginx/html
- ./vhost.d:/etc/nginx/vhost.d:ro
- ./htpasswd:/etc/nginx/htpasswd:ro
networks:
- proxy
acme-companion:
image: nginxproxy/acme-companion:2.8.3
container_name: nginx-proxy-acme
restart: unless-stopped
depends_on:
- nginx-proxy
environment:
- DEFAULT_EMAIL=${LE_CONTACT_EMAIL}
- ACME_CA_URI=${LE_CA_URI}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./certs:/etc/nginx/certs:rw
- ./html:/usr/share/nginx/html:rw
- ./acme:/etc/acme.sh
networks:
proxy:
external: true
EOF
docker compose up -d
docker compose ps
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\nginx-proxy"
@'
services:
nginx-proxy:
image: nginxproxy/nginx-proxy:1.11.8
container_name: nginx-proxy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
labels:
- "com.github.nginx-proxy.nginx"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./certs:/etc/nginx/certs:ro
- ./html:/usr/share/nginx/html
- ./vhost.d:/etc/nginx/vhost.d:ro
- ./htpasswd:/etc/nginx/htpasswd:ro
networks:
- proxy
acme-companion:
image: nginxproxy/acme-companion:2.8.3
container_name: nginx-proxy-acme
restart: unless-stopped
depends_on:
- nginx-proxy
environment:
- DEFAULT_EMAIL=${LE_CONTACT_EMAIL}
- ACME_CA_URI=${LE_CA_URI}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./certs:/etc/nginx/certs:rw
- ./html:/usr/share/nginx/html:rw
- ./acme:/etc/acme.sh
networks:
proxy:
external: true
'@ | Set-Content -Encoding ascii compose.yaml
docker compose up -d
docker compose ps
Mac (Terminal)#
Same commands as Linux.
The lines that matter:
| Line | Why |
|---|---|
| Two socket paths | nginx-proxy wants the socket at /tmp/docker.sock, the companion at /var/run/docker.sock (both documented) |
certs :ro and :rw | Only the companion writes certificates and private keys |
html shared | The companion writes the challenge files, nginx serves them on port 80 |
acme | The Let's Encrypt account and renewal state. Keep it with certs |
Label com.github.nginx-proxy.nginx | How the companion finds the proxy. NGINX_PROXY_CONTAINER with the container name does the same |
${...}, no version: | Compose fills values from .env; the version: key is obsolete |
The official files use named Docker volumes. We use folders under ~/docker_volumes and did not test every system. If certificates never appear, or the log says "Permission denied" for the challenge folder, switch the three folders to named volumes (certs:/etc/nginx/certs plus a volumes: block), as the maintainer advised in issue 506.
Check it worked. docker compose ps shows both containers running, and docker compose logs --tail=30 has no line starting Error:. We did not run this; the companion's log starts with Info: running acme-companion version ....
Tip: Docker Desktop handles the socket mount in its own Linux VM. We did not test it there; a socket problem shows in this log at once.
Step 3: Add your first app and test the routing#
A small web app proves the route before any certificate. traefik/whoami prints the request it gets. We make it listen on port 8080, so you see what VIRTUAL_PORT does.
Linux#
mkdir -p ~/docker_volumes/whoami && cd ~/docker_volumes/whoami
cat > compose.yaml << 'EOF'
services:
whoami:
image: traefik/whoami:v1.12.0
container_name: whoami
restart: unless-stopped
expose:
- "8080"
environment:
- WHOAMI_PORT_NUMBER=8080
- VIRTUAL_HOST=app.example.com
- VIRTUAL_PORT=8080
networks:
- proxy
networks:
proxy:
external: true
EOF
docker compose up -d
curl -i -H "Host: app.example.com" http://localhost/
Windows (PowerShell)#
New-Item -ItemType Directory -Force "$HOME\docker_volumes\whoami" | Out-Null
Set-Location "$HOME\docker_volumes\whoami"
@'
services:
whoami:
image: traefik/whoami:v1.12.0
container_name: whoami
restart: unless-stopped
expose:
- "8080"
environment:
- WHOAMI_PORT_NUMBER=8080
- VIRTUAL_HOST=app.example.com
- VIRTUAL_PORT=8080
networks:
- proxy
networks:
proxy:
external: true
'@ | Set-Content -Encoding ascii compose.yaml
docker compose up -d
curl.exe -i -H "Host: app.example.com" http://localhost/
Mac (Terminal)#
Same commands as Linux.
Use your own name instead of app.example.com. The Host: header picks the site, so this works before DNS exists. The app must expose its port and share a network with the proxy (nginx-proxy README). Without VIRTUAL_PORT, nginx-proxy takes the single exposed port, or else port 80.
Check it worked. You get HTTP/1.1 200 OK and the whoami text (Hostname: ..., IP: ..., the shape shown in its README). A 503 means the name does not match.
Tip:
VIRTUAL_HOSTtakes only a name, such asapp.example.com, or several separated by commas. A port number in it is not supported. UseVIRTUAL_PORTfor the port.
Step 4: Point the name at your server and get a test certificate#
First the outside world: create the DNS A record, forward ports 80 and 443, and check from outside your network (a phone on mobile data) that http://app.example.com shows the whoami text. Then add the certificate request to the app's environment: list:
environment:
- WHOAMI_PORT_NUMBER=8080
- VIRTUAL_HOST=app.example.com
- VIRTUAL_PORT=8080
- ACME_HOST=app.example.com
Every name in ACME_HOST must also be in VIRTUAL_HOST. Recreate the container, then watch the companion.
Linux#
cd ~/docker_volumes/whoami && docker compose up -d cd ~/docker_volumes/nginx-proxy docker compose logs -f acme-companion
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\whoami"; docker compose up -d Set-Location "$HOME\docker_volumes\nginx-proxy" docker compose logs -f acme-companion
Mac (Terminal)#
Same commands as Linux.
Stop the log with Ctrl+C when it settles. A log in an older issue showed Creating/renewal app.example.com certificates... (app.example.com); yours may differ. Then:
docker exec nginx-proxy-acme cert_status curl -kI https://app.example.com
On Windows use curl.exe. cert_status is a companion utility that prints your certificates. -k is needed because the test certificate is not trusted.
Check it worked. cert_status lists app.example.com and curl -kI answers 200. curl -I http://app.example.com now redirects to HTTPS (the docs: a name with a usable certificate gets port 80 redirected to 443). Nothing happened? See Troubleshooting.
Tip: Add
ACME_HOSTonly when DNS is ready. A failed check on the real server (Step 5) counts against Let's Encrypt limits.
Step 5: Switch to real certificates#
Change .env to the production server, recreate the companion, and ask it to renew now.
Linux#
cd ~/docker_volumes/nginx-proxy sed -i 's/acme-staging-v02/acme-v02/' .env docker compose up -d docker exec nginx-proxy-acme force_renew
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\nginx-proxy" (Get-Content .env) -replace 'acme-staging-v02','acme-v02' | Set-Content -Encoding ascii .env docker compose up -d docker exec nginx-proxy-acme force_renew
Mac (Terminal)#
cd ~/docker_volumes/nginx-proxy sed -i '' 's/acme-staging-v02/acme-v02/' .env docker compose up -d docker exec nginx-proxy-acme force_renew
force_renew is documented as renewing all certificates in use. We expect it to replace the test one; we did not run it.
Check it worked. curl -I https://app.example.com (no -k) answers 200 with no certificate error, and the browser's padlock is closed. Still an unknown issuer? Run force_renew again and read the log.
Tip: The default certificate authority is Let's Encrypt, not ZeroSSL, even though ZeroSSL maintains these repositories. You need no ZeroSSL account.
Step 6: Tune one site: upload size and a password#
Per-site Nginx settings are plain files in vhost.d. The file name is exactly the host name, with no .conf, and no server { } wrapper inside.
Linux#
cd ~/docker_volumes/nginx-proxy echo 'client_max_body_size 100m;' > vhost.d/app.example.com docker run --rm -it -v "$PWD/htpasswd:/work" httpd:2.4.71-alpine htpasswd -cB /work/app.example.com admin docker compose restart nginx-proxy docker exec nginx-proxy nginx -t
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\nginx-proxy" 'client_max_body_size 100m;' | Set-Content -Encoding ascii vhost.d\app.example.com docker run --rm -it -v "$($PWD.Path)\htpasswd:/work" httpd:2.4.71-alpine htpasswd -cB /work/app.example.com admin docker compose restart nginx-proxy docker exec nginx-proxy nginx -t
Mac (Terminal)#
Same commands as Linux.
The htpasswd tool asks for the password twice and writes a file named after the host. nginx-proxy turns on basic authentication for every file in that folder. Leave out -c for a second user, because -c creates the file anew. admin is a dummy; the Apache httpd image just supplies the tool on all three systems. The restart matters: the template checks for these files when it writes the config, which happens when containers start or stop (our reading of the template; the docs do not spell it out).
Other settings from the docs: several names with VIRTUAL_HOST=a.example.com,b.example.com; several containers under one name with VIRTUAL_PATH=/api/ and VIRTUAL_DEST=/ (the app must still build links starting with that path); ENABLE_IPV6=true on the proxy (it does not repair a bad IPv6 route).
Check it worked. curl -I https://app.example.com answers 401 Unauthorized; with -u admin:<your-password> it answers 200 (our reading of the docs; not run).
Tip: Adding or removing a file in
vhost.dorhtpasswdneeds a proxy restart. Changing the text of an existingvhost.dfile needs onlydocker exec nginx-proxy nginx -s reload. Runnginx -tfirst: a typo is easier to read there than in a broken proxy.
Keep the Docker socket away from Nginx (optional)#
In the simple setup the internet-facing Nginx also holds the Docker socket. Docker's security page says anyone who can use the Docker API can start a container with the host's / folder inside it, and then "the container can alter your host filesystem without any restriction". The flag :ro protects only the socket file, not the commands sent through it.
The official alternative runs plain nginx with no socket, docker-gen (it writes the Nginx config) on an internal network, and the companion. nginx-proxy publishes a -dockergen image with the template built in (since 1.11.5). We combined the official pages; we did not run the result.
services:
nginx:
image: nginx:1.31.10-alpine
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
labels:
- "com.github.nginx-proxy.nginx"
- "com.github.nginx-proxy.nginx-proxy.nginx"
volumes:
- ./conf.d:/etc/nginx/conf.d
- ./certs:/etc/nginx/certs:ro
- ./html:/usr/share/nginx/html
- ./vhost.d:/etc/nginx/vhost.d:ro
- ./htpasswd:/etc/nginx/htpasswd:ro
networks:
- proxy
docker-gen:
image: nginxproxy/nginx-proxy:1.11.8-dockergen
container_name: nginx-proxy-gen
restart: unless-stopped
labels:
- "com.github.nginx-proxy.docker-gen"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./conf.d:/etc/nginx/conf.d
- ./certs:/etc/nginx/certs:ro
- ./html:/usr/share/nginx/html:ro
- ./vhost.d:/etc/nginx/vhost.d:ro
- ./htpasswd:/etc/nginx/htpasswd:ro
networks:
- gen
# acme-companion: the same block as in Step 2
networks:
proxy:
external: true
gen:
internal: true
Use this instead of the Step 2 file (same folders, plus conf.d). The nginx container carries two labels: one for the companion, one for docker-gen's reload signal. The folders certs, vhost.d, htpasswd and html must be shared with docker-gen, or it writes a config that Nginx cannot use (official warning). Do not set NETWORK_ACCESS=internal on an app here (issue 2805, open).
This lowers the exposure; it does not remove it, because docker-gen and the companion still hold the socket. The companion's docs describe DOCKER_HOST=tcp://... with TLS client certificates (since 2.8.0); we found no official recipe for a filtered socket proxy with nginx-proxy. Our docker-socket-proxy guide explains the idea; we did not test it with this stack.
Put it behind HTTPS with Traefik instead (or Caddy)#
Pick nginx-proxy if you like Nginx files and VIRTUAL_HOST; pick another proxy if you prefer one container that handles certificates itself. Run only one of them on ports 80 and 443. The table summarises the three designs; it is no speed ranking.
| nginx-proxy + acme-companion | Traefik | Caddy Docker Proxy | |
|---|---|---|---|
| How you add a site | VIRTUAL_HOST and ACME_HOST env vars | Labels on the container | Labels in Caddyfile syntax |
| Certificates | Separate companion | Built in | Built in |
| Own Nginx snippets | Yes, files in vhost.d | No (middlewares) | No (Caddy directives) |
| Dashboard | None | Yes | None |
| Docker socket | In two or three containers | In the Traefik container | In the Caddy container |
| Pick it when | You know Nginx and want plain files per site | You want routing rules and a dashboard | You want the shortest config |
With Traefik instead#
Set up Traefik with our Traefik guide, then give the app these labels instead of the nginx-proxy variables:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.whoami.rule=Host(`app.example.com`)"
- "traefik.http.routers.whoami.entrypoints=https"
- "traefik.http.routers.whoami.tls=true"
- "traefik.http.routers.whoami.tls.certresolver=le"
- "traefik.http.services.whoami.loadbalancer.server.port=8080"
Without Traefik: Caddy#
Caddy keeps its sites in one Caddyfile and gets Let's Encrypt certificates by itself for a public name. With the apps on the proxy network, conf/Caddyfile is:
app.example.com {
reverse_proxy whoami:8080
}
Run caddy:2.11.9 with ports 80 and 443 published, ./conf/Caddyfile mounted at /etc/caddy/Caddyfile and a data folder, then check with curl -I https://app.example.com. For a home-only name, tls internal makes Caddy sign its own certificate. Our Caddy guide shows both routes and how to trust the root on Linux, Windows and Mac.
Security and testing#
| Control | How |
|---|---|
| Docker socket | Treat it as root access to the host. :ro is not a limit on the API. Use the separate docker-gen setup if the proxy faces the internet |
| Trust your containers | Issue 2784 (19 October 2026, open when we read it) reports that a crafted VIRTUAL_HOST value can inject Nginx directives, so any container that sets its own environment could reroute traffic. We did not reproduce it. Run no untrusted containers beside the proxy |
| Private keys | The companion keeps keys at mode 600 by default. Keep certs and acme private and out of Git |
| Ports | Publish only 80 and 443, on the proxy. Apps use expose, never ports |
Quick tests, from the proxy folder:
docker compose ps docker compose logs --tail=50 docker exec nginx-proxy nginx -T docker exec nginx-proxy-acme cert_status curl -I https://app.example.com
nginx -T prints the generated config; the upstream block for your host should list your container's address (official troubleshooting page).
Common mistakes#
| Mistake | Why it happens | Do this instead |
|---|---|---|
503 Service Temporarily Unavailable (issue 1082) | The requested name and VIRTUAL_HOST differ (wallabag against wallabag.localhost) | Use the identical name, or send -H "Host: app.example.com". The server's IP matches no name |
Error: can't get nginx-proxy container ID ! (issue 616) | The companion cannot find the proxy container | Keep the label com.github.nginx-proxy.nginx, or set NGINX_PROXY_CONTAINER |
stat() ".../acme-challenge/hello-world" failed (13: Permission denied) (issue 506) | Nginx cannot read the challenge folder: bind-mount rights, on one NAS a Windows ACL setting | Fix the permissions, or use a named volume for html |
Typo LETENCRYPT_HOST fixed, still 500 (issue 689) | A restart keeps the old environment | docker compose up -d recreates the container. Check with docker exec <app> env |
invalid parameter "3000" (issue 2782, open) | VIRTUAL_PORT= 3000 has a space | Write VIRTUAL_PORT=3000 |
No certificate files after recreating only certs (issue 1304, open) | The acme state was kept and the companion skipped the renewal | Keep certs and acme together; back up and restore both |
| Proxy moved to other host ports (as in issue 1175) | Let's Encrypt checks public ports 80 and 443 | Keep both reachable; a changed host port works only if the router forwards port 80 to it |
Pulled latest (issue 1300, open) | latest follows the main branch. One report: empty key.pem files after such an update | Pin 1.11.8 and 2.8.3 and change them on purpose |
AI assistants: ACME_CHALLENGE_TYPE or separate DNS_API variables (issue 1221) | Invented names. The log showed the HTTP-01 path: DNS-01 was never on | Use ACME_CHALLENGE=DNS-01 and one ACMESH_DNS_API_CONFIG |
AI assistants: jwilder/nginx-proxy, jrcs/letsencrypt-nginx-proxy-companion, version: "3", volumes_from | Old tutorials (the 2020 issues above use those names) | Use nginxproxy/nginx-proxy and nginxproxy/acme-companion, no version: line |
| AI assistants: "acme-companion now defaults to ZeroSSL" | ZeroSSL maintains the repositories | The default ACME_CA_URI is Let's Encrypt. ZeroSSL is opt-in and needs an account |
Tip: Since acme-companion 2.8.0 the names are
ACME_HOSTandACME_EMAIL. The olderLETSENCRYPT_HOSTandLETSENCRYPT_EMAILstill work (the template readsACME_HOSTfirst), but do not mix them.
Tip: Compose applies a changed
environment:or label only when it recreates the container. After every edit rundocker compose up -d, notrestart.
Troubleshooting#
| Problem | Solution |
|---|---|
| 503 | Compare the requested name with VIRTUAL_HOST. docker exec nginx-proxy nginx -T should show an upstream for that name |
| 502 | The app is still starting (the case in issue 1082), or VIRTUAL_PORT is wrong |
The upstream block lists no container address | App and proxy share no Docker network. Add networks: [proxy] to the app |
| No certificate | Set DEBUG=1 on the companion, docker compose up -d, read docker compose logs acme-companion. Check DNS, ports 80 and 443 from outside, a stray AAAA record, CAA answers |
| Challenge test | docker exec nginx-proxy-acme bash -c 'echo hi > /usr/share/nginx/html/.well-known/acme-challenge/hello-world', then open that path on your name from outside (official test) |
| Nginx will not reload | docker exec nginx-proxy nginx -t names the file and line |
| Still the test certificate | docker exec nginx-proxy-acme force_renew, then cert_status |
Exact error texts#
Error: you need to share your Docker host socket with a volume at /var/run/docker.sock: the socket mount is missing or is a folder (companion entrypoint, v2.8.3). It may addmight not be readable; on SELinux hosts add:z.Error: can't access to '/etc/nginx/certs' directory !: the folder is not mounted writable on the companion. Forhtmlthe current version only warns (changed after issue 1159).Error retrieving docker server version info: ... dial unix /tmp/docker.sock: connect: permission denied: the proxy cannot use the socket, seen with rootless Docker (issue 706). Mount that user's own socket.
Known bugs (open, December 2026)#
- acme-companion 1299: a short restart of an app can remove its certificate links, and the proxy then fails with
cannot load certificate. - acme-companion 1310: leaked file descriptors stop certificate work (reported on v2.6.3).
- nginx-proxy 2804: regex paths in
VIRTUAL_HOST_MULTIPORTSare ignored since 1.11.0.
We found nothing that stops a plain setup like this one.
Updates and backups#
Update. Read both release pages first. Change both tags in compose.yaml, then:
cd ~/docker_volumes/nginx-proxy docker compose pull docker compose up -d docker compose logs --tail=50
Windows: the same, after Set-Location "$HOME\docker_volumes\nginx-proxy". With named volumes, never use docker compose down -v: it deletes your certificates and account.
What to back up. certs and acme together (see issue 1304), plus vhost.d, htpasswd, .env and compose.yaml. The archive holds private keys: keep it private.
Linux and Mac#
Save as ~/docker_volumes/nginx-proxy/backup.sh:
#!/usr/bin/env bash set -euo pipefail base="$HOME/docker_volumes/nginx-proxy" out="$base/backups/nginx-proxy-$(date +%F).tar.gz" tar -czf "$out" -C "$base" certs acme vhost.d htpasswd .env compose.yaml chmod 600 "$out"
Run chmod 700 on it and add this line with crontab -e (on a Mac write /Users/<your-user>/...):
0 3 * * * /home/<your-user>/docker_volumes/nginx-proxy/backup.sh
Windows (PowerShell)#
Save as $HOME\docker_volumes\nginx-proxy\backup.ps1, then run it daily at 03:00 in Task Scheduler with powershell.exe -NoProfile -File <full-path-to-the-script>:
$base = "$HOME\docker_volumes\nginx-proxy" $out = "$base\backups\nginx-proxy-$(Get-Date -Format yyyy-MM-dd).tar.gz" tar.exe -czf $out -C $base certs acme vhost.d htpasswd .env compose.yaml
Restore test#
Unpack the archive in an empty folder on a spare machine, then:
docker network create proxy docker compose up -d docker exec nginx-proxy-acme cert_status
The list should show your certificates again, with no new order for them. We did not run a restore.
Performance and resources#
The docs give no minimum RAM or CPU, and we measured none. Run docker stats. The companion checks certificates every hour (CERTS_UPDATE_INTERVAL) and renews after 60 days (ACME_RENEW_AFTER); for Let's Encrypt that is 30 days before expiry.
FAQ#
Can I get a wildcard certificate? Yes, with the DNS-01 challenge only: ACME_CHALLENGE=DNS-01 plus ACMESH_DNS_API_CONFIG for your DNS provider (acme-companion page "Let's Encrypt and ACME"). DNS-01 also works when port 80 cannot be opened. The provider key is a secret: keep it in .env with chmod 600.
Do I need port 80 if I only use HTTPS? For HTTP-01, yes. Let's Encrypt validates on port 80 only, and the README says not to block it or use HTTPS_METHOD=nohttp.
Sources#
- nginx-proxy: repository, release 1.11.8 (27 November 2026), README, docs, separate-containers example, LICENSE (MIT)
- acme-companion: repository, release v2.8.3 (27 November 2026), v2.8.0 (10 July 2026, the
ACME_*names); docs at v2.8.3: basic usage, Docker Compose, advanced usage, environment variables, Let's Encrypt and ACME, utilities, entrypoint - Images on Docker Hub (tags checked): nginx-proxy, acme-companion, traefik/whoami v1.12.0, caddy
- Let's Encrypt challenge types, staging environment, Docker daemon attack surface, Apache htpasswd
- Issues read: nginx-proxy 1082, 2782, 2784, 2804, 2805; acme-companion 506, 616, 689, 706, 1159, 1175, 1221, 1299, 1300, 1304, 1310
Checked against the official docs on 2026-12-03. Nothing was run on a real machine by DIY Lab Hub; the commands come from the docs, the source and the issues above.