this guide assumes you're not using host networking for your caddy container. if you are, you can use sharkey's provided caddy documentation
i don't know if this is the best way to do things, but it worked for me (thankies to Aylam for helping me figure all this out <3). also, as of writing i haven't tested doing this from scratch so i may have missed something or made a typo but this should work
insert this block into your Caddyfile, and change sharkey.example to your instance domain. this is almost the same as the Caddyfile block suggested in the sharkey docs, except with the name of sharkey's web container instead of localhost
sharkey.example {
reverse_proxy sharkey-web-1:3000
}
create a docker network that caddy and sharkey will share:
$ docker network create caddy-sharkey --ipv6
then, navigate to and edit your caddy's compose file. to illustrate the required changes, this below is caddy's example compose as of writing (2026/2/14)
services:
caddy:
image: caddy:<version>
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./conf:/etc/caddy
- ./site:/srv
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config:
add caddy-sharkey to the compose's networks, as well as the caddy service's networks. using the example compose, these changes would look like this:
services:
caddy:
image: caddy:<version>
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./conf:/etc/caddy
- ./site:/srv
- caddy_data:/data
- caddy_config:/config
networks:
- caddy-sharkey
volumes:
caddy_data:
caddy_config:
networks:
caddy-sharkey:
external: true
restart caddy so these changes take effect:
$ docker compose stop && docker compose up -d
now, navigate to and edit sharkey's compose file. i won't include the entire example sharkey compose file here due to length, but here are the relevant sections:
services:
web:
[...]
ports:
- "3000:3000"
networks:
- shonk
[...]
networks:
shonk:
comment out the ports, and add caddy-sharkey to the compose's networks, as well as the sharkey web service's networks. the sections above should now look like this:
services:
web:
[...]
# ports:
# - "3000:3000"
networks:
- shonk
- caddy-sharkey
[...]
networks:
shonk:
caddy-sharkey:
external: true
restart sharkey so these changes take effect:
$ docker compose stop && docker compose up -d
your caddy container should now be successfully reverse-proxying your sharkey container!