certbot certonly --webroot -w /var/www/html -d example.com

Category: Web Servers & Proxies

certbot certonly --webroot -w /var/www/html -d example.com

Issue a cert via a file in your web root

The webroot plugin drops a token file into /var/www/html and asks the CA to fetch it over HTTP, which works when your web server already serves that directory. No server restart is needed, unlike standalone. Point -w at the directory your vhost serves for the domain.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.