mailcow
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).
Setup
-
Set up persistent storage for Docker:
- Format the device, e.g. in a VM with a host-managed LV:
mkfs.ext4 -L docker /dev/vda
-
Add the mount to
/etc/fstab
:/dev/vda /var/lib/docker ext4 rw,relatime 0 2
-
Create the mountpoint
/var/lib/docker
and mount the partition (just domount -a
)
- Format the device, e.g. in a VM with a host-managed LV:
-
Install Docker and Docker Compose (
apk add docker docker-compose
) - Enable and start Docker:
rc-update add docker && rc-service docker start
- Install
bash
,grep
,sed
,less
,coreutils
andcurl
- Clone https://github.com/mailcow/mailcow-dockerized into
/var/lib/docker
-
Run
generate_config.sh
and make the following modifications tomailcow.conf
:- Add
mail.netsoc.tcd.ie
toADDITIONAL_SERVER_NAMES
- Disable LetsEncrypt certificates (
SKIP_LETS_ENCRYPT=y
)
- Add
-
Run
docker-compose up -d
to boot mailcow - Replace
data/assets/ssl/cert.pem
anddata/assets/ssl/key.pem
with the*.netsoc.tcd.ie
certificate. Make sure to restart mailcow following this. -
Add the following to
data/conf/unbound/unbound.conf
:forward-zone: name: "." forward-addr: 10.69.0.1
Run
docker-compose restart unbound-mailcow
to restart Unbound when done.
Upgrading
mailcow provides an update script, see here for details.
Last update: 2021-08-29