Caddy with duckdns not working

1. The problem I’m having:

I have a problem of not able to access my jellyfin server with caddy and duckdns outside home network.

I installed jellyfin (docker), using port 8096 (http) and 8920 (https). I created some domains in duckdns and points towards my router’s public ip address (81.111.226.115). I have forwardded 8123, 80, 443, 8096, 8920, etc in router to my home server ip addresses.
Now, the pradeeshserver.duckdns.org is working within home network but not from outside

These are the steps:

  1. Register a domain in duckdns.org. say myjellyfin.duckdns.org points to my public ip
  2. Install jellyfin docker and run it. (8096 and 8920 for http/s respectively) localhost:port works fine
  3. Install Caddy. create Caddyfile with this content:
pradeeshserver.duckdns.org
reverse_proxy 127.0.0.1:8096
  1. using browser, jellyfin clients, check if https://pradeeshserver.duckdns.org works. It works, in internal/home network
  2. Disconnected mobile from home network and tried to open https://pradeeshserver.duckdns.org. It doesnt work.

2. Error messages and/or full log output:

Page does not open in external network.

3. Caddy version:

v2.7.5

4. How I installed and ran Caddy:

I installed caddy with apt package manager. I installed xcaddy using binary and used

xcaddy build --with github.com/caddy-dns/duckdns

to install duckdns module

I ran caddy using

sudo caddy start --config ./Caddyfile

Caddyfile location is correct

a. System environment:

b. Command:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

c. Service/unit/compose file:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

d. My complete Caddy config:

pradeeshserver.duckdns.org
reverse_proxy 127.0.0.1:8096

5. Links to relevant resources:

You should not be using caddy start to run Caddy.

Use the systemd service instead:

Also, follow these instructions to swap out the apt repo binary with your custom one:

When going to http://pradeeshserver.duckdns.org/ I’m seeing Caddy’s default startup page. This tells me that Caddy is running on your server, but with the default configuration. Make sure you edit /etc/caddy/Caddyfile.

Did both. Running caddy start and using systemctl both works similar.

I found something in this. I initially had port forwarded 80 and 443 with TCP. When I enabled both TCP and UDP, it sort of works outside my home network. But not guarenteed. It works sometimes, then it doesn’t.

pradeeshserver.duckdns.org no longer has a valid IP address. You must have changed something.

Anyway, the problem is that using caddy start will run Caddy as the wrong user, and will not automatically start when your server reboots.

Like I said, make sure you’re using the systemd service. Show your service’s logs if you’re still having trouble.

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