Install a new module in Caddy 2

1. Caddy version (caddy version):

v2.4.3

2. How I run Caddy:

I installed it like following

echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" \
    | sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
sudo apt update -y
sudo apt install caddy -y

a. System environment:

Debian 10

b. Command:

service caddy start

3. The problem I’m having:

I used to use SSL like this

abc.com {
 tls ssl@abc.com
 root * /home/admin/website
 file_server
}

It works well, and now I need to use Cloudflare, but it doesn’t work.

abc.com {
 tls {
  dns cloudflare api_token
 }
 root * /home/admin/website
 file_server
}

I googled and tried to use

curl http://getcaddy.com | bash -s personal tls.dns.cloudflare

And restarted Caddy service, but it still doesn’t work. I think I may have installed this module in the wrong way.

How do I install a new module when caddy is already installed? I found this answer https://caddy.community/t/install-non-standard-modules-to-existing-running-caddy/12802.

Is the solution still the same? Thank you so much.

getcaddy.com does not exist anymore. That’s for Caddy v1.

Please refer to the docs:

Also, I recommend using the apt repo from Cloudsmith now, as per the docs. We’re transitioning away from the fury.io repo.

To continue getting updates to the support files from the apt repo, when using a custom build of Caddy, please follow these instructions:

1 Like

Thank you for the reply. It seems that I have to reinstall caddy, thank you so much.

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