Docker Mail Server

As simple as install docker component on your server.
Previously I've used laa/dockermail but after switched to more simple docker container with docker-compose

Let's go:
https://github.com/tomav/docker-mailserver

Install docker on your server;
And install docker-compose after;

Create new folder for your mailserver configuration
mkdir -p ~/config/mail

Create docker-compose.yml inside created folder
touch ~/config/mail/docker-compose.yml

Put configuration inside it with your favorite text editor.

version: '2'

services:  
  mail:
    image: tvial/docker-mailserver
    hostname: mail
    container_name: mail
    ports:
    - "25:25"
    - "143:143"
    - "587:587"
    - "993:993"
    volumes:
    - maildata:/var/mail
    - ./config:/tmp/docker-mailserver
    - /etc/letsencrypt:/etc/letsencrypt
    environment:
      SSL_TYPE: letsencrypt
    logging:
      options:
        max-size: "10m"
    restart: always
volumes:  
  maildata:
    driver: local

But using mail server without webmail isn't very comfort, so I adding rainloop to my config.

  rainloop:
    image: solidnerd/rainloop
    container_name: mail_rainloop
    ports:
      - "9001:80"
    volumes:
      - rainloop:/var/www/rainloop/data
    logging:
      options:
        max-size: "10m"
    restart: always
    cpuset: "1"
volumes:  
  rainloop:
    driver: local

Full configuration will look:

version: '2'

services:  
  mail:
    image: tvial/docker-mailserver
    hostname: mail
    container_name: mail
    ports:
    - "25:25"
    - "143:143"
    - "587:587"
    - "993:993"
    volumes:
    - maildata:/var/mail
    - ./config:/tmp/docker-mailserver
    - /etc/letsencrypt:/etc/letsencrypt
    environment:
      SSL_TYPE: letsencrypt
    logging:
      options:
        max-size: "10m"
    restart: always
  rainloop:
    image: solidnerd/rainloop
    container_name: mail_rainloop
    ports:
      - "9001:80"
    volumes:
      - rainloop:/var/www/rainloop/data
    logging:
      options:
        max-size: "10m"
    restart: always
    cpuset: "1"
volumes:  
  maildata:
    driver: local
  rainloop:
    driver: local

Now go to your folder and run containers

cd ~/config/mail  
docker-compose up -d  

Now you can open webmail on
http://your-server:9001/