Prerequisites

Before you begin, please install Docker if you have not done it already.

Step 1: Pull argosoft/sonusmail container from the docker hub

Execute the following command:

sudo docker pull argosoft/sonusmail

Step 2: Start the container

Execute the following command recommended, for linux

sudo docker run -d --name sonusmail --restart=unless-stopped  -e TZ=America/Toronto -v /var/lib/sonusmail:/app/data/ \
-v /var/log/sonusmail:/app/logs/ -v /var/lib/certs:/app/certs/ -e ADMIN_USERNAME=Admin -e ADMIN_PASSWORD=password -e CERT_PATH=certs/mycertificate.crt \
-e CERT_KEY_PATH=certs/mycertificate.key --network=host argosoft/sonusmail

We recommend using --network=host instead of --network=bridge. In bridge mode, the container cannot see the real external IP addresses of incoming connections, which prevents IP-based filtering features from working correctly.

If you are using Docker on Linux, the host mode is the preferred option as it allows the container to use the host's network stack directly. This way, sonusmail can bind to the necessary ports (25, 587, 110, 143) without any additional port mapping. Make sure that no other services are using these ports on the host machine. The default port for the web interface is 5000 (HTTP) and 5001 (HTTPS). If you wish to change those, you can do so by modifying the Kestrel settings using the environment parameters -e Kestrel__Endpoints__Http__Url=http://:::7050 and -e Kestrel__Endpoints__Https__Url=https://:::7051. It will make the web interface available on ports 7050 (HTTP) and 7051 (HTTPS).

If you are using Docker on Windows or Mac, or if you have specific networking requirements, you may need to use the bridge mode. In that case, make sure to map the necessary ports as shown in the next command.

sudo docker run -d --name sonusmail --restart=unless-stopped  -e TZ=America/Toronto -v /var/lib/sonusmail:/app/data/ \
-v /var/log/sonusmail:/app/logs/ -v /var/lib/certs:/app/certs/ -e ADMIN_USERNAME=Admin -e ADMIN_PASSWORD=password -e CERT_PATH=certs/mycertificate.crt \
-e CERT_KEY_PATH=certs/mycertificate.key -p 25:25 -p 587:587 -p 110:110 -p 143:143 -p 5000:5000 -p 5001:5001 argosoft/sonusmail

Note: Replace /var/lib/sonusmail, /var/log/sonusmail, and /var/lib/certs with your desired host paths for data persistence and certificates.

This command will start sonusmail in a detached mode, with automatic restart unless stopped, and map necessary volumes for data persistence.

Make sure to adjust the volume paths and environment variables as needed for your setup.

Once the container is running, you can access the sonusmail web interface by navigating to http://localhost:5000 in your web browser.

Step 3: Managing the container

To stop the container, use the following command:

sudo docker stop sonusmail

For other operating systems, please refer to the official Docker installation guide for specific instructions.

Contact if you have questions.