mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-03 18:36:22 +00:00
- VOL_PATH always defaults to /data; vscode/opencode VOL_PROJECTS nests it - TZ defaults to America/Vancouver (was UTC in etherpad, ntfy, redis) - compose section order fixed (volumes before environment, command after networks) - all default secrets are the literal ChangeThisPassword (grep-friendly, users must change them); removed a real key from ollama sample.env - sample.env synced with compose: missing vars added with defaults, dead vars removed - invoiceninja_dev/openarchiver_dev: app services had no environment block, wired all sample.env vars through so the stacks actually work - opencode: sample.env OLLAMA_HOST renamed to OLLAMA_HOST_URL to match compose - TZ values unquoted consistently Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mailu
Overview
Mailu is a self-hosted mail server suite providing SMTP, IMAP, POP3, webmail, and antispam/antivirus filtering. This Docker Compose stack deploys the full Mailu system with persistent storage and an external reverse proxy for the admin/webmail UI.
Project Details
- Project Repository: Mailu
- Container Image: GitHub Container Registry
- Compose Example: Mailu Compose Setup
- Documentation: Configuration Reference
- Reverse Proxy Port:
80(admin/webmail viafrontcontainer)
Getting Started
- Copy
sample.envto.envand edit all values (especiallyDOMAIN,HOSTNAMES,SECRET_KEY,TLS_FLAVOR) - Create the required directories under
${VOL_PATH}/mailu/:certs/— TLS certificates (only needed ifTLS_FLAVOR=cert)overrides/— optional service overrides
- Start the stack:
docker compose up -d - Create the initial admin user:
Or use
docker compose exec admin flask mailu admin admin example.com 'password'INITIAL_ADMIN_*env vars in.envfor auto-creation. - Log in at
https://mail.example.com/adminand configure domains, users, and aliases.
Environment Variable Notes
Compose
VOL_PATH– base path for persistent data volumes (default:/data)BIND_ADDRESS4– IPv4 address to bind mail ports (default: empty = all interfaces)MAILU_VERSION– Mailu image tag (default:2024.06)MAILU_RESTART– container restart policy (default:always)MAILU_ORG– container registry org (default:ghcr.io/mailu)MAILU_WEBMAIL– webmail image choice (default:roundcube)
Domain
DOMAIN– primary mail domain (required)HOSTNAMES– comma-separated public hostnames (required; first is primary)POSTMASTER– local part of the postmaster address (required)
Security
SECRET_KEY– random 16+ character string for session encryption (required)TLS_FLAVOR– TLS mode:letsencrypt,cert,notls(default:cert)
Network
SUBNET– Docker network subnet (default:192.168.203.0/24)
Web
WEB_ADMIN– admin interface path (default:/admin)WEB_WEBMAIL– webmail path (default:/webmail)WEB_API– API path (default:/api)SITENAME– site name in admin panelWEBSITE– linked website URL
Initial Admin
INITIAL_ADMIN_ACCOUNT– admin username local partINITIAL_ADMIN_DOMAIN– admin domain (usually same asDOMAIN)INITIAL_ADMIN_PW– admin passwordINITIAL_ADMIN_MODE– creation mode:create,ifmissing,update
Volume Notes
All volumes are rooted at ${VOL_PATH:-/data}/mailu/:
certs/– TLS certificate and key files (cert.pem, key.pem)data/– admin database and configurationdkim/– DKIM signing keysfilter/– Rspamd spam filter statemail/– user mailbox storagemailqueue/– outgoing mail queueoverrides/nginx/– custom nginx config snippetsoverrides/dovecot/– custom Dovecot configoverrides/postfix/– custom Postfix configoverrides/rspamd/– custom Rspamd configoverrides/webmail/– custom webmail configredis/– Redis persistence datawebmail/– webmail plugin data
Network Notes
- Requires the external
proxynetwork for HTTP/HTTPS access via Nginx Proxy Manager (admin, webmail, API). - Mail protocols (SMTP, IMAP, POP3) are published directly on the host via the
frontcontainer. - An internal bridge network connects all Mailu services.
Docker Run
docker run -d \
--name=mailu-redis \
redis:alpine
docker run -d \
--name=mailu-front \
--env-file .env \
-p 25:25 -p 465:465 -p 587:587 \
-p 110:110 -p 995:995 \
-p 143:143 -p 993:993 \
-p 4190:4190 \
-v /data/mailu/certs:/certs \
-v /data/mailu/overrides/nginx:/overrides:ro \
ghcr.io/mailu/nginx:2024.06
Additional Notes / Gotchas
- DNS setup is critical. Ensure MX, A/AAAA, SPF, DKIM, and DMARC records are configured before going live. See Mailu DNS docs.
- Port 25 requires the container to run with
--network hostor proper port publishing. Some ISPs block port 25 — verify before deploying. - TLS certificates must exist in
certs/cert.pemandcerts/key.pemwhenTLS_FLAVOR=cert. - Let's Encrypt requires ports 80 and 443 to be reachable from the internet and DNS records pointing to the server IP.
- Redis runs without authentication by default — keep it on the internal network only.
- The
webmailservice uses a Docker Compose profile (--profile webmail) and is not started by default. - Skip the
antivirusservice to save ~1GB RAM — Mailu works without it.
Dockhand Stack, Deploy from Git
Cookbooks Repository stackname: mailu Compose file path: mailu_dev/compose.yaml Additional env file (optional): mailu_dev/sample.env
Then "Load" mailu_dev/sample.env into the Environmental variables in dockhand
Create the Stack