2019-03-08 20:47:06 +02:00
---
title: "Installation"
date: 2019-03-03T16:39:46+01:00
weight: 1
draft: false
---
## Binaries
2019-03-11 18:56:48 +02:00
To get the binary just download the latest release for your OS/Arch from [the release page ](https://github.com/go-acme/lego/releases ) and put the binary somewhere convenient.
2019-03-08 20:47:06 +02:00
lego does not assume anything about the location you run it from.
## From Docker
```bash
2019-03-11 18:56:48 +02:00
docker run goacme/lego -h
2019-03-08 20:47:06 +02:00
```
## From package managers
2023-08-19 19:03:45 +02:00
- [ArchLinux ](https://archlinux.org/packages/extra/x86_64/lego/ ) (official):
2019-03-08 20:47:06 +02:00
2022-06-17 00:25:42 +02:00
```bash
2023-04-07 14:27:09 +02:00
pacman -S lego
```
- [ArchLinux (AUR) ](https://aur.archlinux.org/packages/lego-bin ) (official):
```bash
yay -S lego-bin
2022-06-17 00:25:42 +02:00
```
2019-03-08 20:47:06 +02:00
2024-03-15 04:12:08 +02:00
- [Snap ](https://snapcraft.io/lego ) (official):
```bash
sudo snap install lego
```
2024-06-20 20:37:37 +02:00
Note: The snap can only write to the `/var/snap/lego/common/.lego` directory.
2024-03-15 04:12:08 +02:00
2022-06-17 00:25:42 +02:00
- [FreeBSD (Ports) ](https://www.freshports.org/security/lego ) (unofficial):
2019-03-08 20:47:06 +02:00
2022-06-17 00:25:42 +02:00
```bash
2024-09-04 14:04:43 +02:00
pkg install lego
2022-06-17 00:25:42 +02:00
```
2019-07-27 07:08:04 +02:00
2024-01-30 15:06:03 +02:00
- [Gentoo ](https://gitweb.gentoo.org/repo/proj/guru.git/tree/app-crypt/lego ) (unofficial):
You can [enable GURU ](https://wiki.gentoo.org/wiki/Project:GURU/Information_for_End_Users ) repository and then:
```bash
emerge app-crypt/lego
```
- [Homebrew ](https://formulae.brew.sh/formula/lego ) (unofficial):
2023-05-24 00:44:33 +02:00
```bash
brew install lego
```
2022-06-17 00:25:42 +02:00
or
2019-07-27 07:08:04 +02:00
2022-06-17 00:25:42 +02:00
```bash
pkg install lego
```
2019-07-27 07:08:04 +02:00
2024-09-04 14:54:29 +02:00
- [OpenBSD (Ports) ](https://openports.pl/path/security/lego ) (unofficial):
```bash
pkg_add lego
```
2019-03-08 20:47:06 +02:00
## From sources
2019-08-13 17:07:06 +02:00
Requirements:
2024-03-20 21:30:35 +02:00
- go1.22+.
2019-08-13 17:07:06 +02:00
- environment variable: `GO111MODULE=on`
2022-08-04 00:15:33 +02:00
To install the latest version from sources, just run:
2019-03-08 20:47:06 +02:00
```bash
2022-08-04 00:15:33 +02:00
go install github.com/go-acme/lego/v4/cmd/lego@latest
2019-03-08 20:47:06 +02:00
```
2020-05-17 00:57:55 +02:00
or
```bash
git clone git@github.com:go-acme/lego.git
2022-08-04 00:15:33 +02:00
cd lego
2020-05-17 00:57:55 +02:00
make # tests + doc + build
make build # only build
```