I need to change the domain on my server, which I've been using certbot to get certificates for successfully. I need to switch it to a different domain though. I did not set it up initially so I have no idea how it was done, and can't figure out how to look at the current configuration.

Every answer I've found says I need to refer to the 'webroot' directory, but I'm not sure which that is exactly. It also says the requested nginx plugin does not appear to be installed so I don't think I'm doing it right if that's not how it was done initially.

Ubuntu 16.4 + nginx

edit: here is my config file (replaced domain and account)

\# renew_before_expiry = 30 days
version = 0.12.0
archive_dir = /etc/letsencrypt/archive/domain.com
cert = /etc/letsencrypt/live/domain.com/cert.pem
privkey = /etc/letsencrypt/live/domain.com/privkey.pem
chain = /etc/letsencrypt/live/domain.com/chain.pem
fullchain = /etc/letsencrypt/live/domain.com/fullchain.pem

\# Options used in the renewal process
authenticator = standalone
installer = None
account = d78fibhjdsfbgqa8734gfu9ig93
  • what does /etc/letsencrypt/renewal/domainname.conf say? This contains the current configuration. – vidarlo Feb 9 '19 at 19:30
  • Yeah I found that file but it seems to only list the cert locations, put it in the main post – stackers Feb 9 '19 at 20:08
authenticator = standalone

This line basically means that certbot starts a standalone webserver. To do this, you first have to shut down your normal web server, then run certbot, and afterwards start your webserver again.

This can be done with

certbot -q renew --standalone --prehook "/usr/sbin/service nginx stop" --posthook "/usr/sbin/service nginx start"

which will stop nginx, get the certificate, and then restart nginx.

The other alternative is to install python-certbot-nginx, and let certbot figure out webroot automatically. This is the reference to the missing plugin (the requested nginx plugin does not appear to be installed).


You need to install certbot nginx plugin.

sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python-certbot-nginx 
  • How was it setup before without that plugin though? – stackers Feb 10 '19 at 18:02
  • I ran it but now it's got the wrong webroot and is displaying the nginx welcome page instead of my site – stackers Feb 10 '19 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.