Newbie needing install help: Caddy2, Docker Compose, DuckDNS and Jellyfin

1. The problem I’m having:

Getting Caddy to work. All the guides assume you know what you’re doing and to me seem like they’re in a different language. That said, I managed to install it, create a Caddyfile and use DUCKDNS. I must be missing something.

2. Error messages and/or full log output:

I tried “$ journalctl -u caddy --no-pager | less +G`” but I’m so new to this that I doubt I’m putting that in the right place. It just returned “—END” with nothing else. The following is from Portainer:

INF ts=1993269853.4631933 msg=using provided configuration config_file=/etc/caddy/Caddyfile config_adapter=caddyfile

Error: adapting config using caddyfile: parsing caddyfile tokens for 'tls': /etc/caddy/Caddyfile:9 - Error during parsing: getting module named 'dns.providers.duckdns': module not registered: dns.providers.duckdns, import chain: ['']

3. Caddy version:

I tried to find out. I’m sorry I’m really new to this. But I just installed it a couple of days ago so, I’d assume a very new one.

4. How I installed and ran Caddy:

a. System environment:

Docker>Portainer>Docker Compose (Decent Macbook Hardware)

b. Command:

I use Portainer because its user friendly. For DUCKDNS IP I went to my server command and typed "curl" and used that as my IP. This is all I did. I did not do any kind of SSL stuff because I think Caddy does all that. 

c. Service/unit/compose file:

version: "2.1"


    container_name: jellyfin
      - NET_ADMIN
      - PUID=998
      - PGID=100
      - TZ=Australia/Sydney
      - JELLYFIN_PublishedServerUrl= #optional
      - /media/USB/data/apps/jellyfin:/config
      - /media/USB/data/media/tv:/data/tv
      - /media/USB/data/media/movies:/data/movies
      - 8096:8096
      - 8920:8920 #optional
      - 7359:7359/udp #optional
      - 1900:1900/udp #optional
    restart: unless-stopped
      - caddy

    image: fallenbagel/jellyseerr:latest
    container_name: jellyseerr
      - NET_ADMIN
      - LOG_LEVEL=debug
      - TZ=Australia/Sydney
      - 5055:5055
      - /media/USB/data/apps/jellyseerr:/app/config
    restart: unless-stopped
      - caddy

    image: caddy:latest
    restart: unless-stopped
    container_name: caddy
      - 69:69
      - 443:443
      - /media/USB/data/apps/caddy/Caddyfile:/etc/caddy/Caddyfile
      - /media/USB/data/apps/caddy/data:/data # Optional
      - /media/USB/data/apps/caddy/config:/config # Optional
      - /media/USB/data/apps/caddy/site:/srv
      - caddy

    external: true

d. My complete Caddy config:

    http_port 69
    https_port 443
reverse_proxy localhost:8096

tls {
    dns duckdns 5h893642-c371-MY-DUCK-TOKENc2c1


5. Links to relevant resources:

Tutorials I’ve been trying to follow and mixing up:

I used a Port forwarding checker online and it looks like I’ve successfully opened ports 443 and 69.
(I changed those numbers because default 80 seemed to be in use)

You need to make a custom build of Caddy to use plugins such as the duckdns DNS module.

See the docs on Docker Hub which explains how to write a Dockerfile to build Caddy with any plugins you need.

Ok damn I see this now.

It can be added by using xcaddy or our download page .

Does this mean I can’t use docker compose? Does “xcaddy build --with” do all I need? Does it install a plugin, recreate the whole container or does it just create a build that I need to install?

Is there a newbie guide I can follow? I’m sure the documentation must seem very simple, but for someone like me I got stumped at:

root@omv:~# go build
-bash: go: command not found

Issue could be anything…

You can, you just need to point docker compose to your Dockerfile using build: instead of image:. See the docker compose docs.

Again, see the section titled “Adding custom Caddy modules” on Docker Hub

Edit. I’ve resolved that issue. I’m one step further and will report back when I investigate further.

Got it working finally. Somethings I went through in case it helps anyone:

I was having DNS issues which gave me all the first errors.
Creating the custom build was a nightmare because I kept getting errors about this quic-go thing. Tried installing several different versions of Go. The second latest one was the one that worked. 1.20 I think.
Once you’ve finished using Xcaddy, that’s not the file you need to use for docker. You need to first turn that into a container (or something). ChatGPT was able to walk me through this step.

Eventually the build will be in some docker folder where it keeps all its images. So you don’t need to really point it to that file since it’ll know where to look. I used dockercompose like this:

    image: custom-caddy:latest
    restart: unless-stopped
    container_name: caddy

I tried using “build” instead each step of the way, and it never seemed to work. Its a shame there’s no user friendly tutorial or video explaining all this. The documentation is all gibberish to beginners. ChatGPT was very annoying but eventually got me there.

We state the minimum Go versions we support. You need at least 1.20 or ideally the current latest 1.21.

If you used the builder Docker image like I suggested by writing a Dockerfile, you wouldn’t have had that problem because it ships with the latest Go version we support.

There’s thousands of guides and tutorials online about using a Dockerfile with Docker Compose. It’s an extremely basic task, and the information is there.

Even though I did lots of research, ended up getting everything sorted, I still have no idea what you mean by this. You said I should use a “build” command instead of “image”. But first, like you suggested, I needed to use Xcaddy which gave me errors because I installed the latest Go. I wouldn’t have started by installing an old version of Go. Anyways, I eventually found out that the older versions wouldn’t work but that I needed at least 1.20.
Then for the “build” command, I tried adding that to my compose and linking to where the file was. I looked up tutorials but everything was incredibly complicated and not exactly what I was doing.

There’s thousands of guides and tutorials online about using a Dockerfile with Docker Compose. It’s an extremely basic task, and the information is there.

I didn’t even know Xcaddy creates ‘dockerfiles’ (or maybe it doesn’t I still don’t know). I didn’t even know what to Google or if I was Googling the right thing. There’s also plenty of tutorials and guides on how to learn code and to program everything myself without Caddy.

While I really appreciate Caddy and think its great, it would’ve probably been faster for me to use NginX because there are a million tutorials on that and I’d just follow it step by step. Its like learning to use a manual transmission car with an instructor vs an automatic car with nothing but complex mechanic books.

I’m just giving the feedback of my experience that I’m sure many others are having. I’m truly very grateful for your help and couldn’t have done it without it.

From the docs on Docker Hub which I linked twice:

Not the build command, the build: option in your docker-compose config. See the docker-compose docs: Compose Build Specification | Docker Docs

No, you don’t need to use xcaddy directly, because that’s encapsulated in the Dockerfile.

It does not. xcaddy is just a build tool. A Dockerfile is a file that describes how to build a docker image from a set of commands.

Go read an explainer about Docker and its various parts, this is out of scope, it’s your responsibility to learn the tools at your disposal.

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