To get the binary just download the latest release for your OS/Arch from the release page and put the binary somewhere convenient. lego does not assume anything about the location you run it from.

From Docker

docker run goacme/lego -h

From package managers

  • ArchLinux (official):

    pacman -S lego
  • ArchLinux (AUR) (official):

    yay -S lego-bin
  • Snap (official):

    sudo snap install lego
  • FreeBSD (Ports) (unofficial):

    cd /usr/ports/security/lego && make install clean
  • Gentoo (unofficial):

    You can enable GURU repository and then:

    emerge app-crypt/lego
  • Homebrew (unofficial):

    brew install lego


    pkg install lego

From sources


  • go1.22+.
  • environment variable: GO111MODULE=on

To install the latest version from sources, just run:

go install


git clone
cd lego
make        # tests + doc + build
make build  # only build