Sign inSign up

11notes/caddy

By 11notes

Updated 4 months ago

Run caddy rootless and distroless.

Buildkit cache
Image
2

10K+

11notes/caddy repository overview

banner

CADDY

size5pxpulls5px5pxswiss_made

Run caddy rootless and distroless.

INTRODUCTION 📢

Caddy is a web server written in Go, known for its simplicity and automatic HTTPS features. It acts as a powerful and flexible reverse proxy, handling various protocols like HTTP, HTTPS, WebSockets, gRPC, and FastCGI.

SYNOPSIS 📖

What can I do with this? This image will run caddy rootless and distroless, for maximum security. This image will by default use the JSON format. If you don’t want that but you want to use the Caddyfile format, simply check the compose.yml for the command and make sure your Caddyfile contains at least these settings for the storage and health check to work:

{
	storage file_system /caddy/var
}
127.0.0.1:3000 {
  respond / 200
}

UNIQUE VALUE PROPOSITION 💶

Why should I run this image and not the other image(s) that already exist? Good question! Because ...

  • ... this image runs rootless as 1000:1000
  • ... this image has no shell since it is distroless
  • ... this image has a health check
  • ... this image runs read-only
  • ... this image is automatically scanned for CVEs before and after publishing
  • ... this image is created via a secure and pinned CI/CD process
  • ... this image verifies all external payloads
  • ... this image is very small

If you value security, simplicity and optimizations to the extreme, then this image might be for you.

COMPARISON 🏁

Below you find a comparison between this image and the most used or original one.

imagesize on diskinit default asdistrolesssupported architectures
11notes/caddy35MB1000:1000amd64, arm64, armv7
caddy62MB0:0amd64, amd64, amd64, arm64v8, armv6, armv7, ppc64le, riscv64, s390x

DEFAULT CONFIG 📑

{
	"apps": {
		"http": {
			"servers": {
        "health": {
					"listen": ["127.0.0.1:3000"],
					"routes": [
						{
							"handle": [{
								"handler": "static_response",
								"status_code": 200
							}]
						}
					]
				},
				"demo": {
					"listen": [":80"],
					"routes": [
						{
							"handle": [{
								"handler": "static_response",
								"body": "11notes/caddy"
							}]
						}
					]
				}
			}
		}
	},
  "storage":{
    "module": "file_system",
    "root": "/caddy/var"
  }
}

VOLUMES 📁

  • /caddy/etc - Directory of your default.json config
  • /caddy/var - Directory of all dynamic data

COMPOSE ✂️

name: "proxy"

x-lockdown: &lockdown
  # prevents write access to the image itself
  read_only: true
  # prevents any process within the container to gain more privileges
  security_opt:
    - "no-new-privileges=true"

services:
  caddy:
    image: "11notes/caddy:2.11.4"
    # use Caddyfile instead of json
    # command: ["run", "--config", "/caddy/etc/Caddyfile"]
    <<: *lockdown
    environment:
      TZ: "Europe/Zurich"
    ports:
      - "80:80/tcp"
      - "443:443/tcp"
    volumes:
      - "caddy.etc:/caddy/etc"
      - "caddy.var:/caddy/var"
      # optional volume (can be tmpfs instead) to store backups of your config
      - "caddy.backup:/caddy/backup"
    networks:
      frontend:
    sysctls:
      # allow rootless container to access port 80 and higher
      net.ipv4.ip_unprivileged_port_start: 80
    restart: "always"

volumes:
  caddy.etc:
  caddy.var:
  caddy.backup:

networks:
  frontend:

To find out how you can change the default UID/GID of this container image, consult the RTFM.

DEFAULT SETTINGS 🗃️

ParameterValueDescription
userdockeruser name
uid1000user identifier
gid1000group identifier
home/caddyhome directory of user docker

ENVIRONMENT 📝

ParameterValueDefault
TZTime Zone
DEBUGWill activate debug option for container image and app (if available)
XDG_CONFIG_HOMEDirectory where to store backups of your config/caddy/backup

MAIN TAGS 🏷️

These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.

There is no latest tag, what am I supposed to do about updates?

It is my opinion that the :latest tag is a bad habbit and should not be used at all. Many developers introduce breaking changes in new releases. This would messed up everything for people who use :latest. If you don’t want to change the tag to the latest semver, simply use the short versions of semver. Instead of using :2.11.4 you can use :2 or :2.11. Since on each new version these tags are updated to the latest version of the software, using them is identical to using :latest but at least fixed to a major or minor version. Which in theory should not introduce breaking changes.

If you still insist on having the bleeding edge release of this app, simply use the :rolling tag, but be warned! You will get the latest version of the app instantly, regardless of breaking changes or security issues or what so ever. You do this at your own risk!

REGISTRIES ☁️

docker pull 11notes/caddy:2.11.4
docker pull ghcr.io/11notes/caddy:2.11.4
docker pull quay.io/11notes/caddy:2.11.4

UNRAID VERSION 🟠

This image supports unraid by default. Simply add -unraid to any tag and the image will run as 99:100 instead of 1000:1000.

NOBODY VERSION 👻

This image supports nobody by default. Simply add -nobody to any tag and the image will run as 65534:65534 instead of 1000:1000.

SOURCE 💾

PARENT IMAGE 🏛️

This image is not based on another image but uses scratch as the starting layer. The image consists of the following distroless layers that were added:

BUILT WITH 🧰

GENERAL TIPS 📌

  • Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints
  • Use Let’s Encrypt DNS-01 challenge to obtain valid SSL certificates for your services

CAUTION ⚠️

  • Don’t forget to add the 127.0.0.1:3000 listen directive to your config with a HTTP 200 status code for the default health check or create your own!
  • The default.json config has a server listening on HTTP, don’t do that. Normally redirect HTTP to HTTPS. There are exceptions1 for HTTP use.

ElevenNotes™️

This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the releases for breaking changes. If you have any problems with using this image simply raise an issue, thanks. If you have a question or inputs please create a new discussion instead of an issue. You can find all my other repositories on github.

created 03.06.2026, 11:39:33 (CET)

Footnotes

  1. Some OTA or other services only work via HTTP (unencrypted) since adding all the Root CA would not fit into their limited memory.

Tag summary

Content type

Image

Digest

sha256:1d7827cc0

Size

32.7 MB

Last updated

4 months ago

docker pull 11notes/caddy:2.11.4