WIUNIX ACADEMY
Set up Traefik with Let’s Encrypt and HTTP/3 on Linux
Page 4 of 7. Review the earlier steps and prerequisites before continuing.
YOUR SYSTEM. YOUR STEPS.
Where are you working?
Choose your OS and version. The prerequisites, commands and troubleshooting follow your environment.
USE YOUR OWN VALUES
Configure this tutorial
Set the example values for your environment; related explanations and copy panels update together. Never enter passwords, private keys or tokens. Values stay in this tab and are not sent to the server or share links. Check actual DNS, certificates and network policy before running commands.
Different IP addresses, domains or ports? Open the settings below, change the values and select “Apply to tutorial”, then copy the updated commands.
Set values for my environment11 editable values
Review the actual service security context
Keep AppArmor/SELinux enforcement. RPM restores standard binary/unit labels, then inspect the real systemd service contexts and denials. This standalone-binary exercise does not build a dedicated least-privilege Traefik SELinux policy.
Unix UID permissions and systemd sandboxing are not proof of a confined SELinux domain. Investigate the actual blocked operation; never disable enforcement or apply unchecked audit2allow.
Proxy VM before first service start
if command -v aa-status >/dev/null; then sudo aa-status; fi
if command -v getenforce >/dev/null; then getenforce; fiLET’S BUILD
Start and inspect staging
Apply readable configuration permissions and validate systemd unit syntax before starting. This parser check does not validate Traefik YAML; use the process startup logs and private API route status for that. Starting now contacts the staging CA and may create an account/order under its terms: review the current subscriber agreement before your own public exercise. Do not retry issuance in a restart loop. Keep port 80 reachable for future challenges.
The loopback origin is polled within a bounded wait and must return the exact marker before the proxy is enabled; a simple process-start result can race listener readiness.
Dedicated Linux host
(
set -euo pipefail
sudo chown root:traefik-academy '/etc/traefik-academy/traefik.yml' '/etc/traefik-academy/dynamic/routes.yml'
sudo chmod 0640 '/etc/traefik-academy/traefik.yml' '/etc/traefik-academy/dynamic/routes.yml'
sudo systemd-analyze verify /etc/systemd/system/academy-traefik-origin.service /etc/systemd/system/traefik-academy.service
sudo systemctl daemon-reload
sudo systemctl enable --now academy-traefik-origin.service
ok=0
for attempt in $(seq 1 12); do
if body=$(curl --fail --silent --show-error --noproxy '*' --connect-timeout 2 --max-time 4 'http://127.0.0.1:8081/health.txt'); then
if [ "$body" = academy-traefik-origin-ok ]; then ok=1; break; fi
fi
sleep 1
done
[ "$ok" = 1 ] || { echo 'STOP: origin marker did not become ready' >&2; exit 1; }
printf '%s
' "$body"
sudo systemctl enable --now traefik-academy.service
sudo systemctl status traefik-academy.service --no-pager
sudo journalctl -u traefik-academy.service --since '10 minutes ago' --no-pager
sudo ss -lntup
)Exact origin marker; proxy active; no YAML/provider/ACME errors; admin/origin only loopback, web TCP80/TCP443 and QUIC UDP443.
LET’S BUILD
Verify the staging certificate without trusting it
From an independent client inspect the certificate subject/SAN/issuer/dates. Staging roots are intentionally untrusted. Only for this non-secret marker, the second probe temporarily skips trust to prove routing; do not enter credentials, install staging roots, bypass browser warnings or use this flag for production. Require the certificate to contain app.example.com and a staging issuer; a self-signed TRAEFIK DEFAULT CERT means issuance has not succeeded. The untrusted chain probe itself does not prove successful trusted TLS.
Independent external client
openssl s_client -connect 'app.example.com:443' -servername 'app.example.com' </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
curl --insecure --fail --silent --show-error --noproxy '*' 'https://app.example.com/health.txt'
curl --silent --show-error --head --noproxy '*' 'http://app.example.com/health.txt'
Staging certificate has correct SAN and staging issuer, marker is academy-traefik-origin-ok, HTTP redirects to the same HTTPS hostname.
LET’S BUILD
Move to the production CA once staging works
Stop here until DNS, firewall and staging issuance are correct. Back up the staging YAML, then open it with the protected editor. Change exactly caServer to the production URL and storage to the separate production file shown below; keep every other setting, including any approved contact email. Never rename/copy staging account JSON into production or erase an existing production file. Read and accept the CA subscriber terms yourself before starting issuance. Starting Traefik with this ACME resolver begins real account registration and certificate issuance, including the ACME client agreement to the CA terms; rate limits apply.
Dedicated Linux host
(
set -euo pipefail
sudo test ! -e '/etc/traefik-academy/traefik-staging.yml.saved'
sudo test ! -L '/etc/traefik-academy/traefik-staging.yml.saved'
sudo cp -a '/etc/traefik-academy/traefik.yml' '/etc/traefik-academy/traefik-staging.yml.saved'
sudoedit '/etc/traefik-academy/traefik.yml'
)Protected editor open; original staging configuration retained.
Production resolver replacement only
FILE FRAGMENT: replace the complete certificatesResolvers block with this block, not the whole file. Keep the static entrypoints/provider/API/log sections. If you added an approved contact email, retain its email key under acme in this replacement too. Staging and production use separate state files. The standard 90-day duration matches production defaults at this review date; do not assume it remains the CA lifetime forever. Recheck provider/Traefik renewal guidance when certificate profiles or lifetimes change.
certificatesResolvers:
le:
acme:
caServer: "https://acme-v02.api.letsencrypt.org/directory"
storage: "/var/lib/traefik-academy/acme-production.json"
httpChallenge:
entryPoint: web
LET’S BUILD
Require trusted TLS and the exact receiver
Restart only this proxy after the static edit. From the external client run the TLS and HTTP checks after issuance finishes; do not interpret a transient default certificate as success. The TLS verification must pass with normal system roots and hostname validation. Record the real issuer/expiry privately for monitoring. No --insecure is used from this point onward.
Dedicated Linux host
sudo systemctl restart traefik-academy.service
sudo journalctl -u traefik-academy.service --since '5 minutes ago' --no-pager
Proxy active, production issuance has no error; continue with the independent client checks.