Environment:
- Docker host running Ubuntu Server 22.04 LTS
- iredmail Docker image
Configurations:
1. Follow this instruction and create the necessary folders and a default config file.
Sample script:
cd YOUR_DIRECTORY
mkdir iredmail
cd iredmail
mkdir -p data/{backup-mysql,clamav,custom,imapsieve_copy,mailboxes,mlmmj,mlmmj-archive,mysql,sa_rules,ssl,postfix_queue}
nano iredmail-docker.conf
# Paste the following content into iredmail-docker.conf
HOSTNAME=<YOUR_HOSTNAME>
FIRST_MAIL_DOMAIN=<YOUR_DOMAIN>
FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=<YOUR_ADMIN_PASSWORD>
MLMMJADMIN_API_TOKEN=$(openssl rand -base64 32)
ROUNDCUBE_DES_KEY=$(openssl rand -base64 24)
MYSQL_ROOT_PASSWORD=<YOUR_MYSQL_ROOT_PASSWORD>
2. Start the iredmail container:
docker run -dit \
--name YOUR_CONTAINER_NAME \
--env-file iredmail-docker.conf \
--network YOUR_DOCKER_NETWORK \
--hostname YOUR_HOSTNAME \
--ip IP_ADDRESS --restart=unless-stopped \
-v YOUR_DATA_DIRECTORY/iredmail/data/backup-mysql:/var/vmail/backup/mysql \
-v YOUR_DATA_DIRECTORY/iredmail/data/mailboxes:/var/vmail/vmail1 \
-v YOUR_DATA_DIRECTORY/iredmail/data/mlmmj:/var/vmail/mlmmj \
-v YOUR_DATA_DIRECTORY/iredmail/data/mlmmj-archive:/var/vmail/mlmmj-archive \
-v YOUR_DATA_DIRECTORY/iredmail/data/imapsieve_copy:/var/vmail/imapsieve_copy \
-v YOUR_DATA_DIRECTORY/iredmail/data/custom:/opt/iredmail/custom \
-v YOUR_DATA_DIRECTORY/iredmail/data/ssl:/opt/iredmail/ssl \
-v YOUR_DATA_DIRECTORY/iredmail/data/mysql:/var/lib/mysql \
-v YOUR_DATA_DIRECTORY/iredmail/data/clamav:/var/lib/clamav \
-v YOUR_DATA_DIRECTORY/iredmail/data/sa_rules:/var/lib/spamassassin \
-v YOUR_DATA_DIRECTORY/iredmail/data/postfix_queue:/var/spool/postfix \
iredmail/mariadb:nightly
Troubleshooting:
- The container’s first-time startup will take some time, if the server is not responding after the container’s been started, wait for a few a minutes and try again.
- There is no “latest” tag for the
iredmail/mariadb
image, you’ll need to use eitherdocker pull iredmail/mariadb:nightly
ordocker pull iredmail/mariadb:stable
instead. - Default admin login:
- username: postmaster@<YOUR_DOMAIN>
- password: your password specified in iredmail-docker.conf file.
FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=<YOUR_ADMIN_PASSWORD>