Community Knowledge Base

Installation and Upgrade (Docker)

SmarterMail comes as a single docker file that contains everything necessary to run the product and get it set up on your server, regardless of the Edition that you intend to use. The features available are based on the license used during the activation process; if no license is entered, the Free Version will be installed.

This guide will help you get started with running SmarterMail using Docker Compose.

Prerequisites

  • Docker installed on your system.
  • Docker Compose installed.

Docker Compose File

First, create a docker-compose.yml using the information below. NOTE: you will want to replace or edit the following lines:

  • <fill in web port> - Here you'll add or edit the port numbers you want to make available to SmarterMail.
  • <Path on host> - These are the appropriate paths on your host system for storing data and system files.
  • TZ - This should be updated to your desired server timezone. A full list of time zones can be found at Wikipedia's List of tz database time zones
version: '3.8'

services:
  smartermail:
    image: smartertools/smartermail:latest
    container_name: smartermail
    environment:
      - TZ=America/Phoenix
    ports:
      - "<fill in web port>:80"
      - "<fill in web port>:443"
      - "<fill in web port>:443/udp"
      - "25:25"
      - "110:110"
      - "143:143"
      - "465:465"
      - "587:587"
      - "993:993"
      - "995:995"
      - "5222:5222"
    volumes:
      - <Path on host>:/app/Data
      - <Path on host>:/app/SystemData
    restart: unless-stopped

Firewall Configuration

Before starting the container, ensure the necessary firewall ports are open. If you have any custom ports configured, these should be added as well.

sudo ufw allow 80,443/tcp comment 'SmarterMail: Web-tcp'
sudo ufw allow 443/udp comment 'SmarterMail: Web-udp'
sudo ufw allow 25,465,587 comment 'SmarterMail: SMTP'
sudo ufw allow 143,993 comment 'SmarterMail: IMAP'
sudo ufw allow 110,995 comment 'SmarterMail: POP3'
sudo ufw allow 5222 comment 'SmarterMail: XMPP'

Starting SmarterMail

To start SmarterMail, use the following commands:

docker-compose up -d

You can access the webmail interface using the port(s) specified in your docker-compose.yml file. You'll use the webmail interface for configuring SmarterMail. (E.g., adding domains, configuring antispam, etc.)

Updating SmarterMail

In order to upgrade SmarterMail to the most recent release, use the following commands:

docker-compose down 
docker-compose pull 
docker-compose up -d 
docker image prune -af

Useful Commands

Below is a list of commands that may be useful when managing your SmarterMail container.

  • Get the container IP: docker inspect --format '{{ .NetworkSettings.IPAddress }}' smartermail
  • View container logs: docker logs smartermail
  • Access the container's shell: docker exec -it smartermail /bin/bash

Installing SmarterMail without Docker Compose

Below is an example command to run SmarterMail directly.

You will wantot replace the following to match your particular installation, just as you would change them when creating your docker-compose.yml file:

  • <fill in web port> - the port numbers you want to make available to SmarterMail.
  • <Path on host> - The appropriate paths on your host system for storing data and system files.
  • TZ - Your desired server timezone. A full list of time zones can be found at Wikipedia's List of tz database time zones
    docker run -d --name smartermail -e TZ=America/Phoenix -p 80:80 -p 443:443 -p 443:443/udp -p 25:25 -p 110:110 -p 143:143 -p 465:465 -p 587:587 -p 993:993 -p 995:995 -p 5222:5222 -v /path/to/data:/app/Data -v /path/to/systemdata:/app/SystemData smartertools/smartermail:latest