Up and Running a Mail Server in 5 Minutes

//DivByZero//
2 min readJun 12, 2024

--

I think creating and maintaining a mail server is one of the worst things that every single IT person wants to do. However, today I’m going to show you how you can make a mail server with an Administration GUI and a Mail Client in less than 5 minutes (or 2 minutes 😒).

Whenever you try to spin up a mail server, there are lots of things that you will encounter. If you work with Windows Server, you need to create an Active Directory, an Exchange Server, and spend many hours configuring the Exchange Server. If you work with Linux servers, you should be familiar with some software like Postfix, Dovecot, etc.

After all that, you have to set up your DNS servers to work with DKIM, SPF, etc.

That’s where the Mail Cow Moo’s in!

So, Mail Cow is a Dockerized mail server solution that contains:

  1. ACME : Auto SSL Certificates
  2. ClamAV: Antivirus
  3. DoveCot: IMAP/POP Server
  4. MariaDB : Database Server
  5. Memcached: Cache Server
  6. Netfilter: Something Like Fail2Ban
  7. Nginx: Web Server
  8. Olefy: Antivirus
  9. PHP
  10. PostFix: Mail Transfer Agent
  11. Redis: In Memory Storage
  12. Rspamd: Spam Filter
  13. SOGo: Mail Client Interface
  14. Solr : Search Engine
  15. Unbound : DNS Server
  16. WatchDog : Monitoring

All you need to run your own hosted mail server is a Public IP Address and a Domain Name

On your server (I use Ubuntu 22) first you should install docker
curl https://get.docker.com | sh
Then you should clone the MailCow’s repo:

cd /opt
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
./generate_config.sh
docker compose up -d

That’s all! Your mail server is ready (almost). Now you can log in to your administration panel using the domain you provided at the config generation step. The default credentials are admin:moohoo .

Under the “Email” menu, go to “Configuration” and add a new domain. After that, if you click on the “DNS” button, all required/optional DNS records will show up. You need to add those records to your DNS server.

Now your mail server installation is complete, and you can create mailboxes/aliases.

you can now use the SOGo via Apps > WebMail and use your email!.

Here is the Official Documentations of the MailCow project:

https://docs.mailcow.email/getstarted/prerequisite-system/

--

--