# Post Install ACME Falining Fix

<span style="white-space: pre-wrap;">This guide walks you through the exact steps to diagnose and fix ACME certificate issues during a Pangolin installation. These steps cover the most common real‑world causes: DNS mismatches, blocked ports, Traefik misconfiguration, and redirect loops. Follow the checklist in order—each step rules out a specific failure point so you can quickly identify what’s wrong and get ACME issuing certificates again.</span>

<div id="bkmrk-" style="white-space: normal;">  
</div>### Troubleshoot Steps

#### <span style="white-space: normal;">Verify DNS is pointing to the correct server</span>

<span style="white-space: pre-wrap;">ACME will always fail if DNS points to the wrong IP.</span>

- <span style="white-space: pre-wrap;">`A yourdomain.com → <your VPS IP>`</span>
- <span style="white-space: pre-wrap;">`A *.yourdomain.com → <your VPS IP>`</span>

1. <span style="white-space: pre-wrap;">Check your server’s public IP and make sure it matches your DNS records</span>

```bash
curl ifconfig.me
```

<div id="bkmrk--1" style="white-space: normal;"></div>#### <span style="white-space: normal;">Test port 80 from outside the server</span>

<span style="white-space: pre-wrap;">ACME HTTP‑01 requires port 80 to be reachable publicly.</span>

1. <span style="white-space: pre-wrap;">From your laptop or phone:</span>

<div id="bkmrk--2" style="white-space: normal;"><div style="white-space: normal;">  
</div></div>```bash
curl -I http://yourdomain.com
```

<span style="white-space: pre-wrap;">Interpret the result:</span>

- <span style="white-space: pre-wrap;">**200 / 301 / 404** → Port 80 is open (good)</span>
- <span style="white-space: pre-wrap;">**Timeout** → Firewall or provider is blocking port 80</span>
- <span style="white-space: pre-wrap;">**Connection refused** → Traefik is not listening on port 80</span>

<div id="bkmrk--3" style="white-space: normal;">  
</div>#### <span style="white-space: normal;">Check VPS firewall (UFW)</span>

<div id="bkmrk-bash" style="white-space: normal;"><div style="white-space: normal;"><div style="white-space: normal;">  
</div></div><div class="rounded-b-xl bg-background-static-850 px-4 pb-1.5 dark:bg-background-static-900"><div style="white-space: pre;">  
</div></div></div>```bash
sudo ufw status
```

<div id="bkmrk-code" style="white-space: normal;"><div style="white-space: normal;"><div style="white-space: normal;"><span style="white-space: pre-wrap;">You should see</span></div></div><div class="rounded-b-xl bg-background-static-850 px-4 pb-1.5 dark:bg-background-static-900"><div style="white-space: pre;">  
</div></div></div>```bash
80/tcp   ALLOW
443/tcp  ALLOW
```

<span style="white-space: pre-wrap;">If missing:</span>

```bash
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
```

<div id="bkmrk--4" style="white-space: normal;">  
</div>#### <span style="white-space: normal;">Check hosting provider firewall</span>

<span style="white-space: pre-wrap;">For example Hetzner has an external firewall that overrides UFW</span>

1. <span style="white-space: pre-wrap;">Go to your VPS dashboard</span>
2. <span style="white-space: pre-wrap;"><span style="white-space: pre-wrap;">Server → Networking → Firewalls</span></span>

<div id="bkmrk-code-1" style="white-space: normal;"></div>```bash
TCP 80
TCP 443
```

<span style="white-space: pre-wrap;">If port 80 is missing → ACME will fail every time.</span>

#### <span style="white-space: normal;">Confirm Traefik is listening on port 80</span>

<div id="bkmrk-bash-2" style="white-space: normal;"><div style="white-space: normal;"><div style="white-space: normal;">1. <span style="white-space: pre-wrap;">SSH into server and run following command</span>

</div></div></div>```bash
sudo ss -tulpn | grep :80
```

<span style="white-space: pre-wrap;">Expected:</span>

```bash
docker-proxy ... LISTEN ... :80
```

<span style="white-space: pre-wrap;">If nothing is listening → Traefik didn’t bind to port 80.</span>

#### <span style="white-space: normal;">Disable HTTP→HTTPS redirect during ACME</span>

<span style="white-space: pre-wrap;">This is the most common Traefik issue.</span>

<span style="white-space: pre-wrap;">If Traefik redirects ACME requests to HTTPS before a certificate exists, ACME fails.</span>

1. <span style="white-space: pre-wrap;">SSH into the server, and go to dynamic-compose.yaml. Usually in config &gt; traefik folder</span>

```yaml
main-app-router-redirect:
  entryPoints:
    - web
  middlewares:
    - redirect-to-https
```

2. <span style="white-space: pre-wrap;"><span style="white-space: pre-wrap;">Temporarily comment out the redirect:</span></span>

```yaml
# - redirect-to-https
```

3. <span style="white-space: pre-wrap;">Restart Traefik:</span>

```bash
sudo docker compose restart traefik
```

<div id="bkmrk--7" style="white-space: normal;">Uncomment the redirect after successful redirect</div>#### <span style="white-space: normal;">Ensure ACME is using HTTP‑01 on the correct entrypoint</span>

<span style="white-space: pre-wrap;">In traefik onfig yaml</span>

```yaml
httpChallenge:
  entryPoint: web
```

<span style="white-space: pre-wrap;">Entrypoints must be:</span>

```yaml
entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"
```