Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

The shell says certbot is not found after you followed an old tutorial

Errorcertbot: command not found

Short answer

Command not found means no certbot program is on your PATH. Certbot's own docs recommend installing it as a snap on systemd distributions. Old guides used certbot-auto, which is deprecated and has to be removed. Install the snap with the classic flag, then open a new shell and run certbot --version.

  • Applies to Certbot 4.x, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check whether any certbot exists, and which package system owns it.

    command -v certbot || echo "no certbot on PATH"
    snap list certbot 2>/dev/null
    ls /usr/local/bin/certbot-auto 2>/dev/null
  2. 2Match what you see, then jump to its fix

    1. 1command -v prints nothing and snap list shows no certbotCertbot is not installedFix
    2. 2/usr/local/bin/certbot-auto exists, or cron still calls certbot-autoAn old tutorial installed certbot-auto, which has been deprecatedFix

What does the error look like?

  • certbot: command not found
  • sudo: certbot: command not found

Cause 1 of 2

Certbot is not installed

1Check

Snap is the recommended install for most modern Linux distributions that use systemd. Third-party packages are maintained outside Certbot and often fall behind on LTS distributions.

snap version

2Fix

Install the snap (classic confinement), then run it by name.

sudo snap install certbot --classic

3Verify

Open a new shell and print the version.

certbot --version

Confirmed by snapcraft.io

Did this fix it?

Cause 2 of 2

An old tutorial installed certbot-auto, which has been deprecated

1Check

The Certbot docs list certbot-auto as deprecated and give removal steps: delete its cron entry or timer, the script, and the /opt/eff.org installation.

grep -rn certbot-auto /etc/crontab /etc/cron.d 2>/dev/null

2Fix

Remove certbot-auto as documented, then install the snap as above.

sudo sed -i '/certbot-auto/d' /etc/crontab
sudo rm /usr/local/bin/certbot-auto
sudo rm -rf /opt/eff.org

3Verify

The old script is gone and the new command is found.

ls /usr/local/bin/certbot-auto 2>&1
command -v certbot

Confirmed by eff-certbot.readthedocs.io

Did this fix it?

How do I stop it coming back?

  • Follow the instructions at certbot.eff.org for your server software instead of an old tutorial.
  • Check certbot certificates after installing to see what is already issued.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Servers

dnf cannot install MySQL on Amazon Linux 2023

dnf cannot find a mysql-server package on Amazon Linux 2023

Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.