Caddy can serve a home web application over HTTPS using a certificate trusted by browsers. For a basic public setup, the hostname must resolve to a reachable address, and certificate validation requests must reach Caddy. A simple reverse proxy lets Caddy handle the public connection while the application stays on a local address and port. The setup still depends on your network: public DNS, router forwarding, firewall rules, and an ISP connection capable of receiving the required inbound traffic.

Start only with a service you administer and are willing to expose. HTTPS encrypts the connection to Caddy and lets the browser verify the server for the requested hostname. It does not decide who may use the application or make the application safe to publish. Keep the application updated and configure its login and access rules before opening it to the internet. If the service is only for local use, keep it off the public internet and configure local HTTPS instead.

Confirm the Domain and Inbound Path

Choose a hostname under a domain you control, such as app.example.com, and edit its records at the active DNS provider. For IPv4 behind a home router, point the A record to the public IPv4 address and forward TCP ports 80 and 443 to the Caddy machine. Give that machine a stable LAN address so the forwarding rules keep reaching it.

For native IPv6, point the AAAA record to the Caddy machine's globally reachable IPv6 address. A typical IPv6 setup needs firewall rules permitting those connections to the device, not IPv4-style NAT port forwarding. In either case, the host firewall must allow the traffic, and Caddy must listen on the ports receiving it.

A private LAN address in public DNS cannot be reached by ordinary internet clients. If your ISP uses carrier-grade NAT (CGNAT), forwarding a port on your home router alone does not open a path through the ISP's IPv4 NAT. Ask whether the ISP can provide a public IPv4 address or usable inbound IPv6. An IPv6-only service will still be unavailable to clients without IPv6 connectivity; neither a DNS record nor an HTTPS setting removes that limitation.

If your public address changes, update DNS promptly, usually through a dynamic DNS updater that supports your DNS provider. Cached answers can continue to send clients to the old address until they expire. If you publish both A and AAAA records, confirm that both addresses reach Caddy. A stale AAAA record can make some clients fail even when IPv4 works.

Configure Caddy for the Application

With Caddy installed, verify that the application responds over HTTP at its intended local address and port. For Caddy and the application running directly on the same machine, an example Caddyfile is:

app.example.com {
    reverse_proxy 127.0.0.1:9000
}

Replace app.example.com with your hostname and 9000 with the application's listening port. The proxy sends requests to the local HTTP service; the browser-facing connection uses HTTPS. Keep the opening brace at the end of the first line and the closing brace on its own line.

Before the first start, check the file with caddy validate --config Caddyfile --adapter caddyfile, using the actual file path if it is elsewhere. Start Caddy through your service manager with that file. For an already running instance, use caddy reload --config Caddyfile --adapter caddyfile or the service manager's reload action, then inspect the result and logs. Do not start a second Caddy process on the same ports.

Bind the application to loopback when it only needs to be reached by Caddy on the same machine. If Caddy and the application run on different local devices, use the application's LAN address and allow its listening port only from the Caddy machine where practical. Check application behavior behind a proxy, including redirects, external URLs, and trusted proxy settings. A working local page is not enough if it generates links to a private IP or rejects the public hostname.

Meet the ACME Challenge Requirements

Caddy uses ACME to request and renew public certificates. The certificate authority validates control of the hostname through an HTTP-01 challenge on TCP port 80 or a TLS-ALPN-01 challenge on TCP port 443. Caddy enables both methods by default and can try the other method if one fails; a certificate does not require both challenges to succeed.

For validation to succeed, the certificate authority must reach Caddy at the address returned for your hostname. TLS-ALPN validation needs its special TLS handshake to reach Caddy, so another proxy terminating TLS in front of it can interfere. Keep both TCP ports available for the basic setup: port 80 also serves the automatic HTTP-to-HTTPS redirect.

If another service occupies those ports, the router sends traffic to the wrong host, or the public name resolves to an old address, issuance can fail. Inspect the actual Caddy logs and DNS answers rather than repeating requests without fixing the path. DNS-based validation is another option and does not need an inbound validation connection. It requires separate DNS-provider configuration, and obtaining a certificate that way still does not make an unreachable home application accessible to visitors.

Caddy may issue local certificates for local names, but those are not the same as public CA certificates trusted by ordinary remote clients. Do not treat a local trust-store prompt as proof that the public hostname has a publicly trusted certificate.

Verify HTTPS and Application Access

From a network outside the home LAN, open the exact public hostname over HTTPS. Confirm the browser reports a valid certificate for that hostname, the expected application loads, and HTTP requests redirect as intended. Test an authenticated and unauthenticated path to ensure the application still enforces its own access rules. Do not publish an administrative dashboard merely because the TLS connection succeeds.

Check that the certificate chain and hostname are correct and that the application does not expose private addresses in redirects or generated links. Check whether the application's own port is exposed directly to the internet and close unintended access. Test over a separate connection, such as a phone with Wi-Fi disabled, because reaching the public hostname from your LAN can depend on the router's NAT loopback support. Keep a note of the network used and any errors so later failures can be compared with a working setup.

Preserve Certificate Data and Monitor Renewals

Caddy needs a writable, persistent data directory for its managed certificate and account state. Preserve it across restarts or container replacements and restrict access to it. Losing that state can trigger unnecessary new issuance attempts or interrupt renewal. Keep the Caddy process running as a managed service and monitor its logs for certificate failures and web availability.

Recheck after router, ISP, DNS, firewall, or application changes. A certificate can be valid today while future renewal fails because port forwarding changed. Monitor the certificate served to visitors as well as Caddy's renewal logs, and investigate failures before that certificate expires.