# lego

> ACME client and library for Let's Encrypt and other ACME CAs written in Go

Source: https://talira.ai/catalog/lego-ayx3gsam
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool, Library
- Categories: [networking / tls / certificate automation](https://talira.ai/categories/networking/tls/certificate-automation), [languages / go](https://talira.ai/categories/languages/go)
- Platforms: linux, macos, windows, docker, cli[^1][^6]
- Licence: MIT[^3]
- Pricing: Free and open source[^3][^4]
- Pricing notes: Free under MIT; the maintainers ask for donations.
- Free tier: yes[^3][^4]
- Self-hostable: yes[^1]
- API: yes[^4][^5]
- Backed by: [go-acme](https://talira.ai/orgs/go-acme.md)
- Sponsors: FairSSL, Canonical, RedirHub

lego is an ACME client and Go library that obtains, renews and revokes TLS certificates from [Let's Encrypt](https://talira.ai/catalog/let-s-encrypt-dqtcmges.md) (its default) or any RFC 8555 certificate authority, with short codes for others such as ZeroSSL, Google Trust Services, Sectigo, SSL.com, GlobalSign and DigiCert. It's a single static binary that answers HTTP-01 with its own web server or through a webroot, TLS-ALPN-01, DNS-01 through more than 200 built-in DNS provider integrations, and the new DNS-PERSIST-01, and it supports IP address certificates, ACME Renewal Information, certificate profiles and existing CSRs. The v5 command line manages many certificates, accounts and CAs from a `.lego.yml` file, obtains and renews with one `run` command, and runs pre, deploy and post hooks. As a library it lets Go programs request certificates and plug in their own challenge solvers. It's MIT-licensed, maintained by the go-acme project, and installed from release binaries for Linux, [macOS](https://talira.ai/catalog/macos-8swyggxb.md), Windows and the BSDs, the goacme/lego [Docker](https://talira.ai/catalog/docker-engine-9442r3nw.md) image, a snap or `go install`.

## Links

- Website: https://go-acme.github.io/lego/
- GitHub: https://github.com/go-acme/lego
- Docs: https://go-acme.github.io/lego/

## Ways to install

### App stores

- [Snap](https://talira.ai/catalog/snap-3jtdmjpc.md): <https://snapcraft.io/lego>[^1]

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/lego>[^2]

## Problems it solves

- get Let's Encrypt certificates from a single static binary on servers where I can't install Python or other runtimes
- get a wildcard certificate through DNS validation with a less common DNS provider that other tools don't support
- add certificate issuance from Let's Encrypt to my Go program as a library instead of shelling out
- plug my own challenge solver into a Go ACME library so my service can prove domain control its own way
- manage many certificates, ACME accounts and certificate authorities from one config file instead of long command lines
- obtain certificates inside a Docker container or CI job with DNS provider credentials passed as environment variables
- get a TLS certificate for an IP address from an ACME certificate authority
- renew when the CA suggests through ACME renewal information instead of on a fixed schedule
- validate a domain once with a persistent DNS TXT record instead of updating DNS on every renewal
- switch from Let's Encrypt to ZeroSSL, Google Trust Services or a commercial ACME CA without changing tools
- sign an existing certificate signing request through ACME instead of letting the client create the key
- reload nginx or copy files to other machines after each successful certificate renewal
- a certificate client that runs the same way on Linux, FreeBSD, OpenBSD, macOS and Windows
- get certificates on a server where port 80 is taken, by answering the challenge over TLS on port 443

## Features

- ACME v2 (RFC 8555) client and Go library
- HTTP-01 with a built-in web server or a webroot, DNS-01, TLS-ALPN-01 (RFC 8737) and DNS-PERSIST-01 challenges
- more than 200 DNS provider integrations, including Route 53, Cloudflare, Akamai EdgeDNS and Alibaba Cloud DNS
- IP address certificates (RFC 8738)
- ACME Renewal Information (RFC 9773) and certificate profiles
- short codes for ACME CAs: Let's Encrypt (default), ZeroSSL, Google Trust Services, Sectigo DV/OV/EV, SSL.com, GlobalSign, DigiCert, Actalis and others
- ZeroSSL sign-up by access key, email or External Account Binding
- obtain, renew and revoke certificates, from scratch or from an existing CSR
- wildcard and SAN certificates, with CNAME delegation of challenges supported by default
- YAML configuration file (.lego.yml) for servers, accounts, challenges and certificates
- pre, deploy and post hooks around issuance and renewal
- custom challenge solvers through the library
- single binaries for Linux, macOS, Windows, FreeBSD, OpenBSD and Solaris, plus a Docker image
- snap and AUR packages maintained by the lego maintainers

## Capabilities

- Has an API: plan not known
- Has a command line tool: plan not known

## Trust

Overall: 0.44 out of 1.
Signals: backing 0.45, extensibility 0.40.

- backed by go-acme
- sponsored by FairSSL, Canonical, RedirHub

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [Certbot](https://talira.ai/catalog/certbot-d2gnzbtd.md): EFF's tool to obtain certs from Let's Encrypt and (optionally) auto-enable HTTPS on your server
- [dehydrated](https://talira.ai/catalog/dehydrated-h47d57dx.md): letsencrypt/acme client implemented as a shell-script – just add water
- [win-acme](https://talira.ai/catalog/win-acme-2cf9zgjq.md): A simple ACMEv2 client for Windows (for use with Let's Encrypt et al.)
- [cert-manager](https://talira.ai/catalog/cert-manager-cgn4m30b.md): Cloud native certificate management
- [acme.sh](https://talira.ai/catalog/acme-sh-hhfyzz1q.md): A pure Unix shell script ACME client for SSL / TLS certificate automation
- [Nginx UI](https://talira.ai/catalog/nginx-ui-hyxg8yyq.md): Yet another WebUI for Nginx

## Sources

[^1]: https://go-acme.github.io/lego/install/ (checked 20 Nov 2026)
[^2]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
[^3]: https://github.com/go-acme/lego/blob/main/LICENSE (checked 20 Nov 2026)
[^4]: https://github.com/go-acme/lego (checked 20 Nov 2026)
[^5]: https://go-acme.github.io/lego/library/ (checked 20 Nov 2026)
[^6]: https://github.com/go-acme/lego/releases/tag/v5.6.0 (checked 20 Nov 2026)
