Free Tools

Caddy: Free HTTPS, Automatically — The Go Web Server That Does the Boring Parts for You

By Asad Ali ·

19 min read

Caddy web server — free HTTPS automatically, with server, lock and shield shapes.

Caddy: Free HTTPS, Automatically — The Go Web Server That Does the Boring Parts for You

Caddy is a free, open-source web server written in Go that gives your site HTTPS automatically: point a domain name at it, and it fetches a real TLS certificate, installs it, redirects visitors from HTTP to HTTPS, and renews the certificate before it expires — with no separate certificate tool, no renewal cron job, and no manual configuration of TLS at all. That is the whole pitch, and it is the reason Caddy has quietly become the default choice for personal sites, self-hosted apps, and small production servers.

The one thing to get straight first: Caddy is not new. It was first released in April 2015 by Matt Holt, and the current generation, Caddy 2, has been stable since May 2020. If a post makes it sound like a brand-new discovery, that is the hype talking. What is real is a decade of development behind a genuinely simpler way to serve a site securely.

Key takeaway: If you can write a three-line config file and point a domain's DNS at your server, Caddy will handle HTTPS for you — certificates, renewals, redirects, HTTP/2 and HTTP/3 — for free, using public certificate authorities. The trade-off is that it needs a public domain name and reachable ports 80 and 443, and it is not a line-for-line replacement for every exotic Nginx or Apache setup.

What Caddy Actually Is

Caddy is a web server, like Nginx or Apache, but built around a different default: security is on unless you turn it off. It is written in Go, ships as a single static binary with no runtime dependencies, and runs on Linux, macOS, Windows, and inside Docker. Its configuration format, the Caddyfile, is deliberately short — a site address followed by the features you want — and it adapts to a JSON configuration underneath for automation.

The project is open source under the Apache License 2.0, and its source lives at github.com/caddyserver/caddy. As of 18 November 2026 the repository has about 79,000 stars and 5,300 forks on GitHub, and the latest stable release is v2.11.9, published 5 November 2026. For scale, W3Techs estimated in March 2026 that about 0.2% of the sites it scans use Caddy — small next to Nginx and Apache, but a real, measurable slice of the web, and one that has grown steadily for years.

Out of the box, Caddy is a static file server, a reverse proxy, a load balancer with health checks, and a TLS terminator. Plugins extend it — authentication, DNS providers, storage backends, web application firewall rules — but the core download needs nothing extra to serve a site over HTTPS.

The Correction: Caddy Is Ten Years Old, Not a New Discovery

Every few months a new wave of posts "discovers" Caddy, and the framing makes it sound like a fresh project. The history says otherwise:

  • 2014: Matt Holt writes the first code as a university project in Go, frustrated with the available servers.
  • 28 April 2015: Caddy is first released to the public, with automatic HTTPS as its core idea from day one. Let's Encrypt itself was still in closed testing at that point; Caddy supported it from the first day of its public beta in late 2015.
  • 24 April 2019: Caddy 1.0 is released, with more than 250 contributors by then.
  • 5 May 2020: Caddy 2 ships — a full rewrite with a JSON native config, an admin API, and a module system. Its configuration format is largely incompatible with Caddy 1, which is why old tutorials from before 2020 will not work.
  • 2020–2026: Steady releases add HTTP/3, on-demand TLS, encrypted ClientHello support, and a large plugin ecosystem. The current line is v2.11.x.

Why does the age matter? Because "automatic HTTPS" is not an experiment in Caddy — it is the most mature implementation of it in any web server, in the project's own words, and a decade of production use is the evidence. You are not betting on a new idea. You are using the server that proved the idea.

How Automatic HTTPS Works

How Caddy's Automatic HTTPS Works1. You writea domain name2. Caddy asksan ACME CA3. CA verifiesyou own the domain4. Cert installed+ auto-renewedDefault CAs: Let's Encrypt + ZeroSSL (automatic fallback)Challenges: HTTP-01 and TLS-ALPN-01 — the CA checks your server, not your paperworkHTTP redirects to HTTPS automatically. Renewal happens before expiry.

Here is the short version of what happens behind that diagram. When Caddy starts with a public domain name in its config, it contacts a certificate authority using the ACME protocol (RFC 8555) — Let's Encrypt by default, with ZeroSSL as a fallback. The authority proves you control the domain by asking Caddy to answer a challenge on your server, usually over HTTP on port 80 or TLS on port 443. Once the challenge passes, the authority issues a certificate, Caddy stores it in its data directory, and your site is served over HTTPS. Caddy watches the certificate's expiry and renews it automatically, well before it lapses, so there is no renewal day to remember and no outage when a certificate quietly expires.

Three details are worth knowing. First, Caddy redirects plain HTTP to HTTPS for you — you do not write a redirect rule. Second, certificates are stored locally in Caddy's data directory, which must be writable and persistent; if you wipe it, Caddy simply gets new certificates, but public authorities rate-limit how many you can request (Let's Encrypt allows 50 certificates per registered domain per week, for example). Third, for local or internal hostnames such as localhost or an intranet name, Caddy issues its own locally-trusted certificates instead — your browser trusts them because Caddy installs a local root certificate once, and it will ask for your password the first time it does that.

Quick Start: From Zero to HTTPS in About Five Minutes

You need three things before you start: a server or computer you control, a domain name whose DNS records point at it, and ports 80 and 443 reachable from the internet. The DNS part matters — set your domain's A record (and AAAA record if you use IPv6) to your server's IP address before you start Caddy, or the certificate authority cannot verify you and issuance will fail.

Step 1: Install Caddy

On Debian or Ubuntu, use the official package, which also sets Caddy up as a systemd service that starts on boot:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

On macOS, it is one command with Homebrew. On Windows, the same with Chocolatey. Docker users can pull the official image:

# macOS
brew install caddy

# Windows (Chocolatey)
choco install caddy

# Docker
docker pull caddy

You can also download a static binary from the project's GitHub releases page, or build from source with Go. If you need third-party plugins, build with xcaddy — Caddy modules are compiled into the binary, so there is no drop-in plugin folder the way Nginx has dynamic modules.

Step 2: Serve a Static Site With Three Lines

Create a file called Caddyfile (no extension) and put your site's files in a folder, for example /var/www/html. Then write:

example.com {
    root * /var/www/html
    file_server
}

That is a complete, production-ready config: Caddy gets a certificate for example.com, serves the files, redirects HTTP to HTTPS, and enables HTTP/2 and HTTP/3 by default. Start it with caddy run for a test, or use the installed service with sudo systemctl reload caddy after editing the system Caddyfile at /etc/caddy/Caddyfile.

Tip: Before reloading, check your config with caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile and tidy it with caddy fmt --overwrite. A reload is zero-downtime — Caddy swaps in the new config without dropping connections.

Step 3: Reverse Proxy an App

Most real setups put Caddy in front of an application — a Node.js app, a Python API, a self-hosted tool, a Docker container. The Caddyfile for that is just as short:

app.example.com {
    reverse_proxy localhost:3000
}

Replace 3000 with whatever port your app listens on. Caddy terminates TLS, forwards requests, and adds the usual proxy headers your app expects. For multiple backends, list them and Caddy load-balances between them, with health checks available through the reverse_proxy options. A fuller example with logging and compression:

app.example.com {
    encode zstd gzip
    log {
        output file /var/log/caddy/app.log
    }
    reverse_proxy localhost:3000 localhost:3001 {
        lb_policy round_robin
        health_uri /health
    }
}

That is the shape of a real deployment: one file, readable at a glance, HTTPS included. Compare that with the equivalent Nginx setup — a server block, certificate paths, a certbot command, a renewal timer, and a redirect block — and the appeal of Caddy becomes obvious.

Caddy vs Nginx vs Apache: What HTTPS Setup Actually Costs You

TaskCaddyNginxApache
First HTTPS certificateAutomatic on first runManual: install Certbot, run it, edit configManual: install Certbot, run it, edit config
Certificate renewalAutomatic, before expiryRenewal timer or cron job you must set upRenewal timer or cron job you must set up
HTTP to HTTPS redirectBuilt in, automaticExtra server block you write yourselfExtra rewrite rules you write yourself
Config to serve a site over HTTPS3 lines in a Caddyfile15–30 lines plus certificate paths20+ lines plus certificate paths
Wildcard certificatesSupported via DNS challenge and a DNS pluginSupported via Certbot DNS pluginsSupported via Certbot DNS plugins
HTTP/2 and HTTP/3On by defaultHTTP/2 on with config; HTTP/3 needs build flagsHTTP/2 via module; HTTP/3 not native
Config reloadZero-downtime, API or fileReload signal, brief config test neededGraceful restart
Raw performance at extreme scaleStrong; Nginx still the usual benchmarkThe reference point for high concurrencyHeavier per connection than Nginx
Ecosystem and exotic modulesGrowing plugin list, compiled in with xcaddyHuge module ecosystem, decades of guidesHuge module ecosystem, decades of guides

The honest read of that table: Caddy wins on setup effort by a wide margin, and for a personal site, a small business site, or a self-hosted stack, the difference ends there — all three servers will serve your traffic. Nginx keeps its crown where raw throughput at very large scale, or a very specific module, is the deciding factor. Apache keeps its place in shared hosting and legacy stacks. Choose on the shape of your problem, not on which logo is newer.

Real Use Cases

A personal site or blog. This is Caddy's home turf. A static site, a few pages, a custom domain — the three-line Caddyfile above is the entire deployment, and HTTPS never expires on you.

Self-hosted apps. If you run tools on your own server — a photo manager, a note-taking app, a file sync service, a media server — Caddy is the front door. One Caddyfile can give every app its own subdomain with HTTPS, so photos.example.com and notes.example.com each get a certificate automatically. Pair it with the HTTP Status Checker on asadwebs.com (asadwebs.com/tools/http-status-checker) after setup to confirm each subdomain answers over HTTPS.

Development and staging. Caddy's local HTTPS is genuinely useful here: run your app behind https://localhost with a locally-trusted certificate, so features that require a secure context — service workers, camera and microphone access, secure cookies — behave the way they will in production.

Small production services. APIs, dashboards, and internal tools that need TLS without an operations team. Caddy's admin API (listening on localhost:2019 by default) also lets you push config changes programmatically, which is how teams automate deployments without editing files on the server.

Docker stacks. The official Caddy image pairs well with Compose: one container terminates TLS for every other container in the stack, and the Caddyfile lives in version control next to the rest of the project.

How It Works Under the Hood

Caddy's native configuration format is JSON, and the Caddyfile is an adapter that turns the short human format into that JSON. When you run caddy run, Caddy loads the config, and for every domain name in it, its TLS automation decides what kind of certificate is needed. Public names go to a public ACME authority; local names get a local certificate from Caddy's own internal authority.

Issuance uses the ACME challenges the authority supports. HTTP-01 proves control by serving a token on port 80; TLS-ALPN-01 proves it during the TLS handshake on port 443. Wildcard certificates cannot use either of those — they need the DNS-01 challenge, which means Caddy must be able to create a DNS record through your provider, so you add the matching DNS plugin (Cloudflare, Route 53, DigitalOcean, and others) and your API credentials.

Certificates are managed by CertMagic, the Go library Caddy is built on. It handles issuance, storage, OCSP stapling (Caddy staples revocation status to the handshake by default, so browsers do not need a separate check), and renewal scheduling. Renewal is attempted well before expiry, and if an authority is unreachable, Caddy keeps serving the existing certificate and retries — a missed renewal window does not take your site down the same day.

On the protocol side, Caddy negotiates HTTP/2 and HTTP/3 by default, and its TLS defaults are modern: TLS 1.2 as the floor, current cipher suites, and no legacy protocol versions. You can tighten or loosen those settings in the global options block if your audience needs it.

Honest Limitations and Fine Print

Read this before you migrate: Caddy is simple on purpose, and simplicity has edges. None of these are deal-breakers, but each one has bitten someone who assumed Caddy worked like Nginx.
  • Automatic HTTPS needs the public internet. For a public domain, your DNS must point at the server and ports 80 and 443 must be reachable. Behind a restrictive firewall, on a network that blocks inbound ports, or on a hostname that only exists in your own DNS, public issuance fails. Internal names need the DNS challenge and a DNS provider plugin, or you accept Caddy's local certificates.
  • It is not a drop-in Nginx replacement. There is no mechanical translation from an Nginx config to a Caddyfile. Complex setups — Lua scripting, OpenResty logic, very specific caching or rewriting rules, legacy modules — need rethinking, not copying. Caddy has plugins for much of this (including a WAF module), but they are separate projects with their own maturity.
  • Plugins mean rebuilding. Caddy's modules are compiled into the binary. Adding one means building a custom binary with xcaddy (or using the download page), rather than installing a package and restarting. That is a small step, but it is a step Nginx users do not expect.
  • The Caddyfile is not the whole story. It covers most use cases, but the full power of Caddy lives in its JSON config and admin API. If you automate configuration at scale, expect to learn the JSON format — the Caddyfile adapter is intentionally the simpler, less expressive layer.
  • Certificate storage is your responsibility. Certificates live in Caddy's data directory. Back it up, keep it persistent across container restarts (mount a volume in Docker), and do not run two Caddy instances against the same storage. If the directory is lost, Caddy re-issues certificates — and can hit the authority's rate limits if you do it repeatedly.
  • Old tutorials are a trap. Anything written for Caddy 1 (before May 2020) uses a different config format and will not work. Check the date on any guide you follow, and prefer the official docs at caddyserver.com/docs.
  • It will not make a slow app fast. Caddy terminates TLS and proxies efficiently, but if your application is slow, the bottleneck is still the application. No web server fixes that.

Security and Privacy

Caddy's security posture is good by default, but "by default" is doing real work in that sentence, so here is what is on and what is not.

What is on by default: modern TLS versions and ciphers, HTTP to HTTPS redirects, OCSP stapling, and an admin API that only listens on localhost. Caddy ships no analytics or telemetry, so the server does not report your sites or usage back to anyone.

What you should add yourself: security headers. Caddy does not send an HSTS header unless you add one, and the same goes for a content security policy or a referrer policy. A single header directive covers it:

example.com {
    header Strict-Transport-Security "max-age=31536000; includeSubDomains"
    root * /var/www/html
    file_server
}

What to protect: the admin API. It listens on localhost:2019 and is restricted to local access by default — keep it that way. Never forward port 2019 to the internet, and if you enable remote administration, put authentication in front of it. Similarly, the data directory holds your private keys: keep its permissions tight and include it in your backups, encrypted like any other secret.

Privacy, honestly stated: getting a public certificate means your domain name is sent to a certificate authority (Let's Encrypt or ZeroSSL) and the issued certificate is recorded in public Certificate Transparency logs. That is true of every public certificate from every server, not something specific to Caddy — but it means a domain you intended to keep quiet becomes publicly visible the moment a certificate is issued for it. If that matters, use Caddy's local certificates for internal names instead of public ones.

Updates matter. Caddy is actively maintained, and TLS and HTTP/3 behaviour changes between releases. Keep the server updated the way you would any internet-facing software, and read the release notes before a major upgrade — v2.11.x releases in 2026 changed some defaults and fixed regressions, so a blind upgrade on a production box is not the way.

Installation Methods at a Glance

PlatformRecommended methodNotes
Debian / Ubuntu / RaspbianOfficial package from the Caddy repositoryInstalls as a systemd service; starts on boot; Caddyfile at /etc/caddy/Caddyfile
Fedora / RedHat / CentOSOfficial RPM packageSame systemd service setup as the Debian package
macOSHomebrew: brew install caddyCommunity-maintained formula; run manually or as a service
WindowsChocolatey or ScoopCommunity-maintained; run as a service with nssm or the built-in service support
DockerOfficial image: docker pull caddyMount a volume for the data directory so certificates survive restarts
Any platformStatic binary from GitHub releasesSingle file, no dependencies; verify the asset signature before use
Custom plugins neededBuild with xcaddyModules compile into the binary; use the download page or build from source

Frequently Asked Questions

Is Caddy really free?

Yes. Caddy is open source under the Apache License 2.0, the certificates it obtains from Let's Encrypt are free, and there is no paid tier required for automatic HTTPS. There is a commercial sponsor programme and a hosted offering around the project, but the server itself and its core features cost nothing.

Is Caddy new?

No. It was first released in April 2015 and the current generation, Caddy 2, has been stable since May 2020. Its automatic HTTPS feature is a decade old and is one of the most battle-tested implementations of its kind. Recent social posts that present it as a fresh discovery are recycling an old, good idea.

Do I need a domain name to use Caddy?

For public HTTPS, yes — a certificate authority can only issue certificates for names in public DNS. For local development, no: Caddy serves localhost and internal names over HTTPS with its own locally-trusted certificates.

Can Caddy replace Nginx or Apache?

For most small and medium sites, yes, and with far less configuration. For very large-scale deployments, or setups built on Nginx- or Apache-specific modules and scripting, it is a migration project rather than a swap — the config models are different, and exotic rules need rewriting.

What happens when a certificate expires?

Nothing, in normal operation: Caddy renews certificates automatically well before they expire. If renewal fails because the server is unreachable or DNS changed, Caddy keeps serving the existing certificate and retries, so a short outage on the authority's side does not take your site down.

Does Caddy work with Docker and reverse proxies?

Yes — it is one of its most common uses. The official image works with Compose, and a one-line reverse_proxy directive puts HTTPS in front of any container. Just remember to mount a persistent volume for the data directory, or your certificates will be re-issued on every container restart.

Is Caddy secure by default?

Largely, yes: modern TLS, automatic redirects, OCSP stapling, and a localhost-only admin API. You should still add security headers such as HSTS yourself, keep the admin API off the public internet, and keep Caddy updated like any internet-facing software.

Once your site is up, check it with the HTTP Status Checker to confirm it answers over HTTPS, or browse the full list at asadwebs.com/tools.

Need a website that just works? If you would rather have someone set up your site, server, or online store properly — HTTPS included — get in touch with Asad Webs and tell us what you are building.

Sources

Category: Free Tools

Tags: free-tools · open-source · web-development

About Asad Ali

Asad Ali is a graphics designer with over 20 years of experience — designing since 2003 — and the founder of Asad Webs, based in Pakistan. He builds the free online tools on this site and writes the guides published here.

LinkedIn Facebook Website
KEEP READING

Next guide

Ghost Downloader 3: The Free Open-Source IDM Alternative →

Related articles

Join the conversation

No account needed. Comments appear only after approval. Your email address will not be published.

Be the first to share a useful question or thought.

You won’t be subscribed to any mailing list.
WELCOME BACK

Sign in

Access your orders, saved products and account.