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.
docker run goacme/lego -h
ArchLinux (official):
pacman -S lego
ArchLinux (AUR) (official):
yay -S lego-bin
FreeBSD (Ports) (unofficial):
cd /usr/ports/security/lego && make install clean
Homebrew user can install lego with:
brew install lego
or
pkg install lego
Requirements:
GO111MODULE=on
To install the latest version from sources, just run:
go install github.com/go-acme/lego/v4/cmd/lego@latest
or
git clone git@github.com:go-acme/lego.git
cd lego
make # tests + doc + build
make build # only build