maddy Docker & Self-Hosted Deployment

GitHub

๏ธ Composable all-in-one mail server.

6,111 stars Go Go 72 files ยท ~49,108 tokens #dkim#dmarc#email#imap#mail#smtp#spf
1. Pull Image (DOCKERHUB) docker pull foxcpp/maddy:latest
2. Docker Run (1-Click Launch) docker run -d --name maddy -p 25:25 --restart always foxcpp/maddy:latest
3. Podman Run podman run -d --name maddy -p 25:25 --restart always foxcpp/maddy:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/foxcpp/maddy:latest
5. ORAS Pull (OCI Artifact) oras pull foxcpp/maddy:latest
Dockerfile
FROM golang:1.26-alpine AS build-env

ARG ADDITIONAL_BUILD_TAGS=""

RUN set -ex && \
    apk upgrade --no-cache --available && \
    apk add --no-cache build-base

WORKDIR /maddy

COPY go.mod go.sum ./
RUN go mod download

COPY . ./
RUN mkdir -p /pkg/data && \
    cp maddy.conf.docker /pkg/data/maddy.conf && \
    ./build.sh --builddir /tmp --destdir /pkg/ --tags "docker ${ADDITIONAL_BUILD_TAGS}" build install

FROM alpine:3.21.2
LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.source=https://github.com/foxcpp/maddy

RUN set -ex && \
    apk upgrade --no-cache --available && \
    apk --no-cache add ca-certificates
COPY --from=build-env /pkg/data/maddy.conf /data/maddy.conf
COPY --from=build-env /pkg/usr/local/bin/maddy /bin/

EXPOSE 25 143 993 587 465
VOLUME ["/data"]
ENTRYPOINT ["/bin/maddy", "-config", "/data/maddy.conf"]
CMD ["run"]