Acmetool
:lock: acmetool, an automatic certificate acquisition tool for ACME (Let's Encrypt)
Install / Use
/learn @hlandau/AcmetoolREADME
<div align="center"><img src="https://hlandau.github.io/acmetool/img/acmetool-logo-black.png" alt="acmetool" /></div>
<p align="center"><a href="https://webchat.freenode.net/?channels=%23acmetool"><img src="https://img.shields.io/badge/webchat-freenode%20%23acmetool-blue.svg" alt="[webchat: freenode #acmetool]" /></a> <br/> <a href="https://github.com/hlandau/acmetool/releases"><img src="https://img.shields.io/github/downloads/hlandau/acmetool/total.svg" alt="[download count]" /></a> <a href="https://github.com/hlandau/acmetool/releases"><img src="https://img.shields.io/github/release/hlandau/acmetool.svg" alt="[version]" /></a><br/> <a href="https://launchpad.net/~hlandau/+archive/ubuntu/rhea/+packages"><img src="https://img.shields.io/badge/ppa-debian%2Fubuntu-lightgrey.svg" alt="[ppa debian/ubuntu]"/></a> <a href="https://drone.io/hlandau/acmetool"><img src="https://img.shields.io/drone/build/hlandau/acmetool" alt="Build Status" /></a></p>acmetool is an easy-to-use command line tool for automatically acquiring certificates from ACME servers (such as Let's Encrypt). Designed to flexibly integrate into your webserver setup to enable automatic verification. Unlike the official Let's Encrypt client, this doesn't modify your web server configuration.
<p>:white_check_mark: Zero-downtime autorenewal<br/> :white_check_mark: Supports any webserver<br/> :white_check_mark: Fully automatable<br/> :white_check_mark: Single-file dependency-free binary<br/> :white_check_mark: Idempotent<br/> :white_check_mark: Fast setup</p>You can perform verifications using port 80 or 443 (if you don't yet have a
server running on one of them); via webroot; by configuring your webserver to
proxy requests for /.well-known/acme-challenge/ to a special port (402) which
acmetool can listen on; or by configuring your webserver not to listen on port
80, and instead running acmetool's built in HTTPS redirector (and challenge
responder) on port 80. This is useful if all you want to do with port 80 is
redirect people to port 443.
You can run acmetool on a cron job to renew certificates automatically (acmetool --batch). The
preferred certificate for a given hostname is always at
/var/lib/acme/live/HOSTNAME/{cert,chain,fullchain,privkey}. You can configure
acmetool to reload your webserver automatically when it renews a certificate.
acmetool is intended to be "magic-free". All of acmetool's state is stored in a simple, comprehensible directory of flat files. The schema for this directory is documented.
acmetool is intended to work like "make". The state directory expresses target domain names, and whenever acmetool is invoked, it ensures that valid certificates are available to meet those names. Certificates which will expire soon are renewed. acmetool is thus idempotent and minimises the use of state.
acmetool can optionally be used without running it as
root. If you have
existing certificates issued using the official client, acmetool can import
those certificates, keys and account keys (acmetool import-le).
acmetool supports both RSA and ECDSA keys and certificates. acmetool's notification hooks system allows you to write arbitrary shell scripts to be executed when new certificates are obtained. By default, this is used to reload webservers automatically, but it can also be used to distribute certificates to other servers or for other purposes.
Getting Started
Binary releases: Binary releases are available.
Download the release appropriate for your platform and simply copy the
acmetool binary to /usr/bin.
_cgo releases are preferred over non-_cgo releases where available, but
non-_cgo releases may be more compatible with older OSes.
Ubuntu users: A binary release PPA, ppa:hlandau/rhea (package acmetool) is available.
$ sudo add-apt-repository ppa:hlandau/rhea
$ sudo apt-get update
$ sudo apt-get install acmetool
You can also download .deb files manually.
(Note: There is no difference between the .deb files for different Ubuntu release codenames; they are interchangeable and completely equivalent.)
Debian users: The Ubuntu binary release PPA also works with Debian:
# echo 'deb http://ppa.launchpad.net/hlandau/rhea/ubuntu xenial main' > /etc/apt/sources.list.d/rhea.list
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9862409EF124EC763B84972FF5AC9651EDB58DFA
# apt-get update
# apt-get install acmetool
You can also download .deb files manually.
(Note: There is no difference between the .deb files for different Ubuntu release codenames; they are interchangeable and completely equivalent.)
RPM-based distros: A copr RPM repository is available.
If you have dnf installed:
$ sudo dnf copr enable hlandau/acmetool
$ sudo dnf install acmetool
Otherwise use the .repo files on the repository
page and use yum,
or download RPMs and use rpm directly.
Void Linux users: acmetool is in the repositories:
$ sudo xbps-install acmetool
Arch Linux users: An AUR PKGBUILD for building from source is available.
$ wget https://aur.archlinux.org/cgit/aur.git/snapshot/acmetool-git.tar.gz
$ tar xvf acmetool-git.tar.gz
$ cd acmetool-git
$ makepkg -s
$ sudo pacman -U ./acmetool*.pkg.tar.xz
Alpine Linux users: An APKBUILD for building from source is available.
FreeBSD users: FreeBSD port is available.
Building from source: You will need Go installed to build from source.
If you are on Linux, you will need to make sure the development files for
libcap are installed. This is probably a package for your distro called
libcap-dev or libcap-devel or similar.
# This is necessary to work around a change in Git's default configuration
# which hasn't yet been accounted for in some places.
$ git config --global http.followRedirects true
$ git clone https://github.com/hlandau/acme
$ cd acme
$ make && sudo make install
# (People familiar with Go with a GOPATH setup can alternatively use go get/go install:)
$ git config --global http.followRedirects true
$ go get github.com/hlandau/acmetool
After installation
# Run the quickstart wizard. Sets up account, cronjob, etc.
# (If you want to use ECDSA keys or set RSA key size, pass "--expert".)
$ sudo acmetool quickstart
# Configure your webserver to serve challenges if necessary.
# See https://hlandau.github.io/acmetool/userguide#web-server-configuration
$ ...
# Request the hostnames you want:
$ sudo acmetool want example.com www.example.com
# Now you have certificates:
$ ls -l /var/lib/acme/live/example.com/
The quickstart subcommand is a recommended wizard which guides you through
the setup of ACME on your system.
The want subcommand states that you want a certificate for the given hostnames.
(If you want separate certificates for each of the hostnames, run the want
subcommand separately for each hostname.)
The default subcommand, reconcile, is like "make" and makes sure all desired
hostnames are satisfied by valid certificates which aren't soon to expire.
want calls reconcile automatically.
If you run acmetool reconcile on a cronjob to facilitate automatic renewal,
pass --batch to ensure it doesn't attempt to interact with a terminal.
You can increase logging severity for debugging purposes by passing
--xlog.severity=debug.
Validation Options
<img src="https://i.imgur.com/h1rtdek.png" align="right" alt="[screenshot]" />Webroot: acmetool can place challenge files in a given directory, allowing your normal
web server to serve them. The files must be served from the path you specify at
/.well-known/acme-challenge/.
Information on configuring your web server.
Proxy: acmetool can respond to validation challenges by serving them on port 402. In
order for this to be useful, you must configure your webserver to proxy
requests under /.well-known/acme-challenge/ to
http://127.0.0.1:402/.well-known/acme-challenge.
Information on configuring your web server.
Stateless: You configure your webserver to respond statelessly to challenges for a given account key without consulting acmetool. This requires nothing more than a one-time web server configuration change and no "moving parts". Information on configuring stateless challenges.
Redirector: acmetool redirector starts an HTTP server on port 80 which redirects all
requests to HTTPS, as well as serving any necessary validation responses. The
acmetool quickstart wizard can set it up for you if you use systemd.
Otherwise, you'll need to configure your system to run acmetool redirector --service.uid=USERNAME --service.daemon=1 as a service, where USERNAME is
the username you want the daemon to drop to.
Make sure your web server is not listening on port 80.
Listen: If you are for some reason not running anything on port 80 or 443, acmetool will use those ports. Either port being available is sufficient. This is only really useful for development purposes.
Hook: You can write custom shell scripts (or binary executables) which acmetool invokes to provision challenge files at the desired location. For example, you c
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
