# Install lego with Homebrew, apk, apt, MacPorts, Nix, pacman, scoop, winget, zypper

Let's Encrypt client and ACME library. Version 5.2.2 via Homebrew; verified 2026-06-02.

## Install

```sh
sudo av install brew:lego
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install lego
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install lego
```

  Evidence: MacPorts ports tree: security/lego/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add lego
```

  Evidence: Alpine Linux edge package indexes: lego from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install lego
```

  Evidence: Debian stable package indexes: lego from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#lego
```

  Evidence: nixpkgs package indexes: pkgs/by-name/le/lego/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S lego
```

  Evidence: Arch Linux sync databases: lego from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install lego
```

  Evidence: openSUSE Tumbleweed package metadata: lego from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/lego
```

  Evidence: Scoop official bucket manifest trees: bucket/lego.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id GoACME.lego -e
```

  Evidence: Windows Package Manager source index: GoACME.lego from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:lego
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/lego>
- **Version:** 5.2.2
- **Source summary:** Let's Encrypt client and ACME library
- **Homepage:** <https://go-acme.github.io/lego/>
- **Repository:** <https://github.com/go-acme/lego>
- **Upstream docs:** <https://go-acme.github.io/lego>
- **License:** MIT
- **Source archive:** <https://github.com/go-acme/lego/archive/refs/tags/v5.2.2.tar.gz>
- **Last updated:** 2026-06-02T16:51:52Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- lego (cli)
- lego (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 5.2.2
- Package-manager updated: 2026-06-02
- Local data: ok
- Upstream repository: https://github.com/go-acme/lego
- Upstream latest detected: v5.2.2 (current)
## Project history and usage

Lego is an ACME client and Go library for obtaining, renewing, and revoking certificates from Let's Encrypt and other ACME certificate authorities.

### Project history

The project began in 2015, before Let's Encrypt's public beta and before ACME became an RFC. A maintainer discussion explains that lego started around the need to make HTTPS automatic in a Go web-server project, at a time when Certbot still had a different name and ACME client tooling was experimental.

Lego evolved into both a command-line client and an embeddable Go library. Its docs emphasize support for ACME v2/RFC 8555, multiple ACME servers, HTTP-01, DNS-01, TLS-ALPN-01, DNS-PERSIST-01, wildcard and SAN certificates, and a large DNS-provider integration matrix.

### Adoption history

Lego's package-manager adoption is broad because certificate automation needs simple deployment on servers, containers, NAS devices, and CI hosts. The Homebrew, Debian, Ubuntu, Alpine, Arch, MacPorts, Nix, Scoop, winget, and zypper package presence in the input mirrors that role: it is a practical infrastructure binary rather than a language-only library.

### How it is used

Users commonly call `lego run` or `lego renew` with an email, domains, and a challenge method. DNS-01 support is especially important for wildcard certificates and machines that cannot expose HTTP challenges; the docs maintain per-provider credential and environment-variable pages for that integration surface.

### Why package nerds care

Lego is package-nerd significant because it turned the messy edge of ACME automation into a portable Go binary with hundreds of provider integrations. It also became a library substrate for other Go programs that wanted certificate automation without shelling out to Certbot.

### Timeline

- 2015: The project started before Let's Encrypt's public beta.
- 2015-12-03: Dependency metadata records lego v0.1.0.
- 2019-03: RFC 8555 standardized ACME v2.
- 2024-09-05: The project disclosed GHSA-q82r-2j7m-9rv4 for HTTPS enforcement in ACME API use.
- 2026-05: Official docs listed more than 200 DNS providers.

### Related projects

- Related ACME clients include Certbot, acme.sh, dehydrated, Caddy's automatic HTTPS stack, Traefik's ACME support, win-acme, and Boulder, the Let's Encrypt CA software. Related standards include ACME RFC 8555 and challenge specifications such as HTTP-01, DNS-01, and TLS-ALPN-01.

### Sources

- <https://deps.dev/go/github.com%2Fgo-acme%2Flego/v2.7.2%2Bincompatible>
- <https://github.com/advisories/GHSA-q82r-2j7m-9rv4>
- <https://github.com/go-acme/lego>
- <https://github.com/go-acme/lego/discussions/1914>
- <https://github.com/go-acme/lego/releases>
- <https://go-acme.github.io/lego/>
- <https://go-acme.github.io/lego/dns/>
- <https://www.rfc-editor.org/rfc/rfc8555>


## Security Notes

No matching local secret-handling manifest was found for lego. Nucleus package metadata is still published here so future coverage has a stable package URL.


## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** lego
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - lego - 4.9.1-2: normalized package name match | Debian stable package indexes: lego from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Let's Encrypt client | https://github.com/go-acme/lego
- Nix - lego: normalized package name match | nixpkgs package indexes: pkgs/by-name/le/lego/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - lego - 4.9.1-2: normalized package name match | Ubuntu 24.04 LTS package indexes: lego from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Let's Encrypt client | https://github.com/go-acme/lego
- apk - lego - 4.35.2-r1: normalized package name match | Alpine Linux edge package indexes: lego from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Let's Encrypt client and ACME library written in Go | https://github.com/go-acme/lego
- apk - lego-doc - 4.35.2-r1: normalized package name match | Alpine Linux edge package indexes: lego-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Let's Encrypt client and ACME library written in Go (documentation) | https://github.com/go-acme/lego
- pacman - lego - 5.2.2-1: normalized package name match | Arch Linux sync databases: lego from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Lets Encrypt client and ACME library | https://go-acme.github.io/lego
- zypper - lego - 5.2.2-1.1: normalized package name match | openSUSE Tumbleweed package metadata: lego from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Let's Encrypt/ACME client and library written in Go | https://github.com/go-acme/lego
- MacPorts - lego: normalized package name match | MacPorts ports tree: security/lego/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/lego: normalized package name match | Scoop official bucket manifest trees: bucket/lego.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - GoACME.lego: normalized package name match | Windows Package Manager source index: GoACME.lego from https://cdn.winget.microsoft.com/cache/source.msix


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [acme.sh](https://www.automicvault.com/pkg/brew/acme-sh/) - Shares av.db curated category or tags: acme, certificates, cli, letsencrypt, security.
- [certbot](https://www.automicvault.com/pkg/brew/certbot/) - Shares av.db curated category or tags: acme, certificates, cli, letsencrypt, security.
- [showcert](https://www.automicvault.com/pkg/brew/showcert/) - Shares av.db curated category or tags: certificates, cli, letsencrypt, security.
- [certgraph](https://www.automicvault.com/pkg/brew/certgraph/) - Shares av.db curated category or tags: certificates, cli, security.
- [certigo](https://www.automicvault.com/pkg/brew/certigo/) - Shares av.db curated category or tags: certificates, cli, security.
- [certstrap](https://www.automicvault.com/pkg/brew/certstrap/) - Shares av.db curated category or tags: certificates, cli, security.
- [crip](https://www.automicvault.com/pkg/brew/crip/) - Shares av.db curated category or tags: certificates, cli, security.
- [gimmecert](https://www.automicvault.com/pkg/brew/gimmecert/) - Shares av.db curated category or tags: certificates, cli, security.
- [dnsrobocert](https://www.automicvault.com/pkg/brew/dnsrobocert/) - Security-sensitive metadata or terminology overlaps. Shared terms: acme, certificates, cli, encrypt, let.

## Combined YAML source

View the package source record on GitHub. [combined/lego.yml](https://github.com/automic-vault/db/blob/main/combined/lego.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
