Setting Up a Self Hosted Email Server

This process actually started in July of this year, but just completed this month. First I took a crack at docker-mailserver, but after I couldn't get that to work I shifted the approach to use mailcow.


It was a long time coming. I am one to want to self-host everything, and having an email with a custom url looks both professional (and cool). Additionally, I am trying to slowly separate myself from google services; my main email is gmail.

Setting up a new server

After some preliminary research, I discovered that email servers use a lot of RAM, so I set up a new VPS.

the new VPS name

Then I went through the setup process for docker-mailserver and roundcube mail client.

sudo docker run -e ROUNDCUBEMAIL_DEFAULT_HOST=[]( \
-e ROUNDCUBEMAIL_DB_NAME=roundcubemail \
-p 6906:80 -d roundcube/roundcubemail:latest-fpm-alpine

Unfortunately, I couldn't get it working, so I gave up for a month or two.


I looked at some other solutions and settled on mailcow.

Mailcow was super simple to set up. It was a quick look through the configuration file, opening some ports (I had already done that for the other solution), and running a docker-compose command.

Then I had to do some minor setup in the application like DKIM configuration and security.

What the mailcow dashboard looks like

Mailcow by default comes with a webmail program called SOGo, which is kind of like RoundCube. I do think I prefer roundcube. I will either replace SOGo with RoundCube or remove webmail entirely.

The SOGo interface

I would definitely recommend mailcow for a self-hosted email solution. I would say it is easier to use than docker-mailserver, and it also gets regular updates and support.

Email me @