1# Docker23Official Docker image is available from Docker Hub.45It expects configuration file to be available at /data/maddy.conf.67If /data is a Docker volume, then default configuration will be placed there8automatically. If it is used, then MADDY_HOSTNAME, MADDY_DOMAIN environment9variables control the host name and primary domain for the server. TLS10certificate should be placed in /data/tls/fullchain.pem, private key in11/data/tls/privkey.pem1213DKIM keys are generated in /data/dkim_keys directory.1415## Image tags1617- `latest` - A latest stable release. May contain breaking changes.18- `X.Y` - A specific feature branch, it is recommended to use these tags to19 receive bugfixes without the risk of feature-related regressions or breaking20 changes.21- `X.Y.Z` - A specific stable release2223## Ports2425All standard ports, as described in maddy docs.2627- `25` - SMTP inbound port.28- `465`, `587` - SMTP Submission ports29- `993`, `143` - IMAP4 ports3031## Volumes3233`/data` - maddy state directory. Databases, queues, etc are stored here. You34might want to mount a named volume there. The main configuration file is stored35here too (`/data/maddy.conf`).3637## Management utility3839To run management commands, create a temporary container with the same40/data directory and put the command after the image name, like this:4142```43docker run --rm -it -v maddydata:/data foxcpp/maddy:0.7 creds create foxcpp@maddy.test44docker run --rm -it -v maddydata:/data foxcpp/maddy:0.7 imap-acct create foxcpp@maddy.test45```4647Use the same image version as the running server. Things may break badly48otherwise.4950Note that, if you modify messages using maddy subcommands while the server is running -51you must ensure that /tmp from the server is accessible for the management52command. One way to it is to run it using `docker exec` instead of `docker run`:53```54docker exec -it container_name_here maddy creds create foxcpp@maddy.test55```5657## Build Tags5859Some Maddy features (such as automatic certificate management via ACME with [a non-default libdns provider](../reference/tls-acme/#dns-providers)) require build tags to be passed to Maddy's `build.sh`, as this is run in the Dockerfile you must compile your own Docker image. Build tags can be set via the docker build argument `ADDITIONAL_BUILD_TAGS` e.g. `docker build --build-arg ADDITIONAL_BUILD_TAGS="libdns_acmedns libdns_route53" -t yourorgname/maddy:yourtagname .`.606162## TL;DR6364```65docker volume create maddydata66docker run \67 --name maddy \68 -e MADDY_HOSTNAME=mx.maddy.test \69 -e MADDY_DOMAIN=maddy.test \70 -v maddydata:/data \71 -p 25:25 \72 -p 143:143 \73 -p 465:465 \74 -p 587:587 \75 -p 993:993 \76 foxcpp/maddy:0.777```7879It will fail on first startup. Copy TLS certificate to /data/tls/fullchain.pem80and key to /data/tls/privkey.pem. Run the server again. Finish DNS configuration81(DKIM keys, etc) as described in [tutorials/setting-up/](../tutorials/setting-up/).