Skip to content


This page assumes that you have a an existing Alpine Linux node inside a virtual machine (not strictly necessary but a mail server should really run in its own VM).


  1. Set up persistent storage for Docker:

    1. Format the device, e.g. in a VM with a host-managed LV: mkfs.ext4 -L docker /dev/vda
    2. Add the mount to /etc/fstab:

      /dev/vda    /var/lib/docker ext4    rw,relatime 0 2
    3. Create the mountpoint /var/lib/docker and mount the partition (just do mount -a)

  2. Install Docker and Docker Compose (apk add docker docker-compose)

  3. Enable and start Docker: rc-update add docker && rc-service docker start
  4. Install bash, grep, sed, less, coreutils and curl
  5. Clone into /var/lib/docker
  6. Run and make the following modifications to mailcow.conf:

    • Disable LetsEncrypt certificates (SKIP_LETS_ENCRYPT=y)
  7. Run docker-compose up -d to boot mailcow

  8. Replace data/assets/ssl/cert.pem and data/assets/ssl/key.pem with the * certificate. Make sure to restart mailcow following this.
  9. Add the following to data/conf/unbound/unbound.conf:

    name: "."

    Run docker-compose restart unbound-mailcow to restart Unbound when done.


mailcow provides an update script, see here for details.

Last update: 2021-08-29