With its intuitive web portal, you can create as many inboxes as you’d like on your server. Mailcow focuses on privacy, to make sure all your data are protected on your servers, and the best security practices are enabled by default forcing all users to use mail services through secure connections (POP3/IMAP/SMTP over TLS, webmail with HTTPS). If you’re looking for a free, open-source mail server for your environment, you may want to take a look at Mailcow. This brief tutorial shows students and new users how to install and configure Mailcow on Ubuntu 18.04 | 16.04 LTS servers. For more about Mailcow, please check its homepage. To get started installing Mailcow, follow the steps below:

Configure Ubuntu Hostname

Before installing Mailcow, make sure to configure the hostname of the mail server. For this tutorial, we’re going to be using the hostname and IP address below: webmail.example.com                    =========== >              192.168.20.2 You can run the commands below to set the server hostname. Also, run the commands below to open the Ubuntu hosts file. Then enter the line as shown below: Save the file and exit.

Add Docker Official Repository

Mailcow requires docker to function. You must install it. Docker has two editions:  The Enterprise Edition (EE) and the Community Edition (CE). For this tutorial, we’re going to be installing the community edition of Docker. If you always want to automatically get the latest version of Docker on Ubuntu, you must add its official repository to the Ubuntu system. To do that, run the commands below to install prerequisite packages. Next, run the commands below to download and install Docker’s official GPG key. The key is used to validate packages installed from Docker’s repository making sure they’re trusted. You should see an output shown below: Now that the official GPG key is installed, run the commands below to add its stable repository to Ubuntu. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. At this point, Docker’s official GPG and repository should be installed on Ubuntu. For those who currently have older versions of Docker, run the commands below to remove them. When you have removed all previous versions of Docker, run the commands below to install the latest and current stable version of Docker. To install a specific version of Docker, run the apt-cache command. Then select the version to install. Now to install a specific version, run the commands below with the version you wish to install If you just want to latest version without specifying the above, run the commands below. The command below will always install the highest possible version. That should install Docker software on Ubuntu. Verify that Docker CE is installed correctly by running the hello-world image, run the commands below: You should see a similar line below: Docker is installed correctly!

Install Docker Compose

On Ubuntu Linux, you can download the Docker Compose binary from the Compose repository release page on GitHub. To install it, run the commands below to download version 1.24.0. As of this writing, this was the current version. To install a different version of Compose, substitute 1.24.0 with the version of Compose you want to use. After downloading it, run the commands below to apply executable permissions to the binary file and create a symbolic link to /usr/binary That should get Docker Compose working. To test, run the commands below: You should see similar output as below: That’s it! To run Docker as a non-root user, add your user account to Docker’s group by running the commands below: Log out and back in, and you should be able to run docker with your standard account.

Install Mailcow

Now that Docker and Docker Compose are installed, run the commands below to get Mailcow installed and configured. First, install Git by running the commands below: After that, change into the /opt directory and get a mail cow-dockerized container. Next, run the script below to download Mailcow’s dependencies. The download process may take a while for some systems. so just relax and wait After the download finishes, you can start your Mailcow server. sudo docker-compose up -d You can now access https://${MAILCOW_HOSTNAME} with the default credentials admin password moohoo. Log in and begin setting up your environment! The database will be initialized right after a connection to MySQL can be established. Congratulations! You have learned how to install and configured Mailcow on Ubuntu 18.04 | 16.04 LTS server