1. The problem I’m having:
Seems like cloudlflare dns module is not being installed with xcaddy with im trying to receive wildcard certificate from cloudflare.
2. Error messages and/or full log output:
Jan 26 15:32:00 caddy caddy[310]: LOGNAME=caddy
Jan 26 15:32:00 caddy caddy[310]: USER=caddy
Jan 26 15:32:00 caddy caddy[310]: INVOCATION_ID=12b7d863c0f74b5fb4ab8613dd09eb19
Jan 26 15:32:00 caddy caddy[310]: JOURNAL_STREAM=8:7738992
Jan 26 15:32:00 caddy caddy[310]: SYSTEMD_EXEC_PID=310
Jan 26 15:32:00 caddy caddy[310]: {"level":"info","ts":1737901920.9207475,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
Jan 26 15:32:00 caddy caddy[310]: Error: adapting config using caddyfile: parsing caddyfile tokens for 'acme_dns': getting module named 'dns.providers.cloudflare': module not registered: dns.providers.cl>
Jan 26 15:32:00 caddy systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Jan 26 15:32:00 caddy systemd[1]: caddy.service: Failed with result 'exit-code'.
Jan 26 15:32:00 caddy systemd[1]: Failed to start caddy.service - Caddy.
3. Caddy version:
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=
4. How I installed and ran Caddy:
a. System environment:
Debian 12
Proxmox LXC - Bare metal
1cpu 1gb ram 4gb disk
installed using this
b. Command:
As a service
d. My complete Caddy config:
*.redacted.com:443 {
tls {
dns cloudflare redacted
}
@food2 host food2.redacted.com
handle @food2 {
encode zstd gzip
reverse_proxy 192.168.1.23:9925
}
}
5. Links to relevant resources:
caddy list-modules shows that its cloudflare module is not installed.
root@caddy:/opt# caddy list-modules
admin.api.load
admin.api.metrics
admin.api.pki
admin.api.reverse_proxy
caddy.adapters.caddyfile
caddy.config_loaders.http
caddy.filesystems
caddy.listeners.http_redirect
caddy.listeners.proxy_protocol
caddy.listeners.tls
caddy.logging.cores.mock
caddy.logging.encoders.append
caddy.logging.encoders.console
caddy.logging.encoders.filter
caddy.logging.encoders.filter.cookie
caddy.logging.encoders.filter.delete
caddy.logging.encoders.filter.hash
caddy.logging.encoders.filter.ip_mask
caddy.logging.encoders.filter.query
caddy.logging.encoders.filter.regexp
caddy.logging.encoders.filter.rename
caddy.logging.encoders.filter.replace
caddy.logging.encoders.json
caddy.logging.writers.discard
caddy.logging.writers.file
caddy.logging.writers.net
caddy.logging.writers.stderr
caddy.logging.writers.stdout
caddy.storage.file_system
events
http
http.authentication.hashes.bcrypt
http.authentication.providers.http_basic
http.encoders.gzip
http.encoders.zstd
http.handlers.acme_server
http.handlers.authentication
http.handlers.copy_response
http.handlers.copy_response_headers
http.handlers.encode
http.handlers.error
http.handlers.file_server
http.handlers.headers
http.handlers.intercept
http.handlers.invoke
http.handlers.log_append
http.handlers.map
http.handlers.metrics
http.handlers.push
http.handlers.request_body
http.handlers.reverse_proxy
http.handlers.rewrite
http.handlers.static_response
http.handlers.subroute
http.handlers.templates
http.handlers.tracing
http.handlers.vars
http.ip_sources.static
http.matchers.client_ip
http.matchers.expression
http.matchers.file
http.matchers.header
http.matchers.header_regexp
http.matchers.host
http.matchers.method
http.matchers.not
http.matchers.path
http.matchers.path_regexp
http.matchers.protocol
http.matchers.query
http.matchers.remote_ip
http.matchers.tls
http.matchers.vars
http.matchers.vars_regexp
http.precompressed.br
http.precompressed.gzip
http.precompressed.zstd
http.reverse_proxy.selection_policies.client_ip_hash
http.reverse_proxy.selection_policies.cookie
http.reverse_proxy.selection_policies.first
http.reverse_proxy.selection_policies.header
http.reverse_proxy.selection_policies.ip_hash
http.reverse_proxy.selection_policies.least_conn
http.reverse_proxy.selection_policies.query
http.reverse_proxy.selection_policies.random
http.reverse_proxy.selection_policies.random_choose
http.reverse_proxy.selection_policies.round_robin
http.reverse_proxy.selection_policies.uri_hash
http.reverse_proxy.selection_policies.weighted_round_robin
http.reverse_proxy.transport.fastcgi
http.reverse_proxy.transport.http
http.reverse_proxy.upstreams.a
http.reverse_proxy.upstreams.multi
http.reverse_proxy.upstreams.srv
pki
tls
tls.ca_pool.source.file
tls.ca_pool.source.http
tls.ca_pool.source.inline
tls.ca_pool.source.pki_intermediate
tls.ca_pool.source.pki_root
tls.ca_pool.source.storage
tls.certificates.automate
tls.certificates.load_files
tls.certificates.load_folders
tls.certificates.load_pem
tls.certificates.load_storage
tls.client_auth.verifier.leaf
tls.get_certificate.http
tls.get_certificate.tailscale
tls.handshake_match.local_ip
tls.handshake_match.remote_ip
tls.handshake_match.sni
tls.handshake_match.sni_regexp
tls.issuance.acme
tls.issuance.internal
tls.issuance.zerossl
tls.leaf_cert_loader.file
tls.leaf_cert_loader.folder
tls.leaf_cert_loader.pem
tls.leaf_cert_loader.storage
tls.permission.http
tls.stek.distributed
tls.stek.standard
Standard modules: 124
Non-standard modules: 0
Unknown modules: 0
xcaddy module install
root@caddy:~# xcaddy build --with github.com/caddy-dns/cloudflare
2025/01/26 16:34:38 [INFO] absolute output file path: /root/caddy
2025/01/26 16:34:38 [INFO] Temporary folder: /tmp/buildenv_2025-01-26-1634.473662680
2025/01/26 16:34:38 [INFO] Writing main module: /tmp/buildenv_2025-01-26-1634.473662680/main.go
package main
import (
caddycmd "github.com/caddyserver/caddy/v2/cmd"
// plug in Caddy modules here
_ "github.com/caddyserver/caddy/v2/modules/standard"
_ "github.com/caddy-dns/cloudflare"
)
func main() {
caddycmd.Main()
}
2025/01/26 16:34:38 [INFO] Initializing Go module
2025/01/26 16:34:38 [INFO] exec (timeout=0s): /usr/local/bin/go mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
go mod tidy
2025/01/26 16:34:38 [INFO] Pinning versions
2025/01/26 16:34:38 [INFO] exec (timeout=0s): /usr/local/bin/go get -v github.com/caddyserver/caddy/v2
go: added github.com/beorn7/perks v1.0.1
go: added github.com/caddyserver/caddy/v2 v2.9.1
go: added github.com/caddyserver/certmagic v0.21.6
go: added github.com/caddyserver/zerossl v0.1.3
go: added github.com/cespare/xxhash/v2 v2.3.0
go: added github.com/francoispqt/gojay v1.2.13
go: added github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
go: added github.com/google/pprof v0.0.0-20231212022811-ec68065c825e
go: added github.com/google/uuid v1.6.0
go: added github.com/klauspost/cpuid/v2 v2.2.9
go: added github.com/libdns/libdns v0.2.2
go: added github.com/mholt/acmez/v3 v3.0.0
go: added github.com/miekg/dns v1.1.62
go: added github.com/onsi/ginkgo/v2 v2.13.2
go: added github.com/prometheus/client_golang v1.19.1
go: added github.com/prometheus/client_model v0.5.0
go: added github.com/prometheus/common v0.48.0
go: added github.com/prometheus/procfs v0.12.0
go: added github.com/quic-go/qpack v0.5.1
go: added github.com/quic-go/quic-go v0.48.2
go: added github.com/zeebo/blake3 v0.2.4
go: added go.uber.org/mock v0.4.0
go: added go.uber.org/multierr v1.11.0
go: added go.uber.org/zap v1.27.0
go: added go.uber.org/zap/exp v0.3.0
go: added golang.org/x/crypto v0.31.0
go: added golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
go: added golang.org/x/mod v0.18.0
go: added golang.org/x/net v0.33.0
go: added golang.org/x/sync v0.10.0
go: added golang.org/x/sys v0.28.0
go: added golang.org/x/term v0.27.0
go: added golang.org/x/text v0.21.0
go: added golang.org/x/time v0.7.0
go: added golang.org/x/tools v0.22.0
go: added google.golang.org/protobuf v1.35.1
2025/01/26 16:34:40 [INFO] exec (timeout=0s): /usr/local/bin/go get -v github.com/caddy-dns/cloudflare github.com/caddyserver/caddy/v2
go: downloading github.com/caddy-dns/cloudflare v0.0.0-20240703190432-89f16b99c18e
go: downloading github.com/libdns/cloudflare v0.1.2-0.20240604123710-0549667a10ab
go: added github.com/caddy-dns/cloudflare v0.0.0-20240703190432-89f16b99c18e
go: added github.com/libdns/cloudflare v0.1.2-0.20240604123710-0549667a10ab
2025/01/26 16:34:42 [INFO] exec (timeout=0s): /usr/local/bin/go get -v
2025/01/26 16:34:53 [INFO] Build environment ready
2025/01/26 16:34:53 [INFO] Building Caddy
2025/01/26 16:34:53 [INFO] exec (timeout=0s): /usr/local/bin/go mod tidy -e
2025/01/26 16:34:53 [INFO] exec (timeout=0s): /usr/local/bin/go build -o /root/caddy -ldflags -w -s -trimpath -tags nobadger,nomysql,nopgx
2025/01/26 16:34:56 [INFO] Build complete: ./caddy
2025/01/26 16:34:56 [INFO] Cleaning up temporary folder: /tmp/buildenv_2025-01-26-1634.473662680
././caddy version
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=
´´´