Install python-certbot-nginx without reinstalling Nginx

I want to install Certbot and the Nginx plugin from apt but without reinstalling Nginx.

Server configuration:
OS: Ubuntu 16.04.3 LTS
Server: Nginx (recompiled, not via apt)

I want to use a recompiled version of Nginx, which is not available from apt. Thus is there any way I can install Certbot and the Nginx plugin without installing Nginx itself?

When running sudo apt install python-certbot-nginx it shows:
The following NEW packages will be installed:
nginx nginx-common nginx-core python-certbot-nginx python-pyparsing

I want to install it without nginx nginx-common nginx-core, just python-certbot-nginx python-pyparsing.

Hi @sheepymeh,

You can do that downloading the needed packages and after that permorfing a manual install, forcing them. Do it at your own risk, I don’t recommend this method at all:

mkdir /tmp/python-certbot-nginx
chmod 777 /tmp/python-certbot-nginx/
cd /tmp/python-certbot-nginx/
sudo apt-get download python-certbot-nginx python-pyparsing
sudo dpkg --force-all -i *.deb

As I said, I never would use this method because it can damage/broke some other packages, as an alternative, you could use certbot-auto instead of the certbot package provided by Ubuntu. certbot-auto includes the nginx plugin and it won’t try to install nginx package.

Here the instructions to install certbot-auto:

Also, if you install certbot-auto, maybe you would like to remove the certbot package installed in your system. Before performing any delete action, remember to backup you /etc/letsencrypt/ dir

As root:

tar zcvf backup_etc-letsencrypt_2017-Oct-22.tar.gz /etc/letsencrypt/

Good luck,

@sahsanu, thanks for your response. Is there any difference in the functionality of Certbot and Certbot Auto, like compromises or differnces in config files?

@sheepymeh, no, there are no differences, it should work with your existing conf files. Indeed the advantage using certbot-auto is that you will always have the last version, it auto-upgrades itself, so, give it a try :wink:

The only difference to be aware of is that the Debian certbot package creates a cronjob to automatically renew your certificates for you.

certbot-auto does not automatically do this for you, so you must manually create a cronjob that executes /path/to/certbot-auto -q renew yourself. This command will only renew certificates that are 30 days or less from expiration, so we recommend you run it twice daily so you have 60 chances to fix problems or wait out issues on Let’s Encrypt’s side.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.