How to Setup Your Own Mailserver with Mailcow

How to Setup Your Own Mailserver with Mailcow

Mailcow is an open-source email server solution, designed for Docker, that simplifies the setup of email services on Linux. It integrates essential components like a mail transfer agent, a webmail client, and security features into one system, making it ideal for those who seek a straightforward and robust email server. Let us start with How to Setup Your Own Mailserver with Mailcow!

Why Choose Mailcow for Email Server on Linux

Mailcow’s open-source framework ensures regular updates and security enhancements. Its Docker compatibility eases installation and management across different Linux distributions. The platform is user-friendly, featuring a web-based interface for easy configuration and maintenance. This combination of accessibility, security, and ease of use makes Mailcow a prime choice for setting up a reliable email server on Linux.

Understanding Mailcow


of Mailcow

Mailcow stands out as a comprehensive email server solution, offering a blend of features that cater to both novice users and seasoned system administrators. Understanding these features and their advantages is key to appreciating what makes Mailcow a preferred choice for email server deployment.

  • Integrated Suite of Tools: Mailcow bundles an array of essential email services and tools. This includes a mail transfer agent (MTA), an IMAP/POP3 server, a webmail client, and anti-spam and anti-virus mechanisms. This integration simplifies the management of email services, providing a one-stop solution for all email needs.
  • User-Friendly Interface: The software comes with SOGo, a web-based interface that simplifies the management of email accounts, domains, and server settings. This interface is intuitive and accessible, making it easy for users of all skill levels to manage their email server effectively.
  • Security and Privacy: Mailcow places a high emphasis on security. It includes built-in features like SSL/TLS encryption, spam filtering, and virus scanning, ensuring that your email communications are secure and private. Regular updates by the open-source community also mean that the server remains protected against the latest security vulnerabilities.

Advantages of Mailcow

  • Docker Compatibility: Docker containerization allows for easy deployment and scalability. By running Mailcow within Docker containers, it ensures a consistent and isolated environment, reducing conflicts with other system components and simplifying updates and maintenance.
  • Customization and Flexibility: While Mailcow works out of the box with sensible defaults, it also offers extensive customization options. Administrators can tweak various settings to tailor the server according to specific requirements, providing flexibility that is often needed in complex setups.
  • Active Community Support: Being open-source, Mailcow benefits from a vibrant community of developers and users. This community contributes to continuous improvements, offers support, and develops additional features and plugins, enhancing the overall functionality of Mailcow.
  • Cost-Effective: As a free and open-source solution, Mailcow presents a cost-effective alternative to commercial email servers, without compromising on features or performance. This makes it particularly appealing for small to medium-sized businesses and individual users.

In summary, Mailcow’s combination of an integrated suite of tools, user-friendly management interface, robust security features, Docker compatibility, customization options, active community support, and cost-effectiveness makes it a powerful and versatile choice for anyone looking to deploy an email server on Linux.

Mailcow Requirements

Before diving into the installation of Mailcow, it is crucial to understand and prepare the necessary hardware and software components, as well as to set up your Linux server correctly. This chapter will guide you through these prerequisites to ensure a smooth and successful Mailcow deployment.

Hardware Requirements

  • Processor: A minimum of a dual-core CPU is recommended for basic Mailcow functionality. For higher email traffic, a quad-core CPU or better is advisable.
  • Memory: At least 2 GB of RAM is required. For optimal performance, especially in environments with multiple users or high email volumes, 4 GB or more is preferred.
  • Storage: A minimum of 20 GB of storage space is necessary. However, considering email data and backups, 50 GB or more is recommended for long-term usage.
  • Network: A stable internet connection with a static IP address is ideal for seamless email server operation.

Software Requirements

  • Linux Distribution: Mailcow is compatible with most modern Linux distributions. Debian and Ubuntu are commonly recommended due to their widespread use and compatibility.
  • Docker and Docker Compose: Since Mailcow runs within Docker containers, ensure that Docker and Docker Compose are available on your Linux distribution.
  • SSL/TLS Certificate: For secure email communication, an SSL/TLS certificate is necessary. You can obtain this from a certificate authority (CA) or use Let Us Encrypt for a free certificate.

Installing Mailcow

This chapter provides a detailed guide on installing Mailcow on Debian 11, including DNS settings. It is important to follow these steps carefully to ensure a successful installation.

Full Step-by-Step Installation Guide on Debian 11

Preparing the System

Update System Packages:

sudo apt update 
sudo apt upgrade

Install Required Dependencies:

sudo apt install curl git

Installing Docker and Docker Compose

Install Docker:

curl -fsSL -o 
sudo sh

Install Docker Compose:

sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 
sudo chmod +x /usr/local/bin/docker-compose 

Configuring DNS Settings

Before installing Mailcow, configure DNS settings for your domain. The full and detailed DNS Setup can be found in Mailcow’s Official Documentation.

  • Set an A Record: Point your domain (e.g., to the server’s IP address.
  • MX Record: Set an MX record for your domain pointing to your Mailcow server (e.g.,
  • SPF Record: Create an SPF record to prevent email spoofing (e.g., v=spf1 mx ~all).
  • DKIM and DMARC: These will be configured post-installation within Mailcow.

Installing Mailcow

Clone the Mailcow Repository:

git clone 
cd mailcow-dockerized

Generate Configuration File:


When prompted, enter your domain (e.g.,

Start Mailcow:

sudo docker-compose up -d

Verifying the Installation

Check if all containers are running:

sudo docker-compose ps 

Initial Configuration Settings

After the installation, you need to perform initial configuration:

Access Mailcow UI: Open a web browser and go to You will be greeted by the Mailcow UI.

Log in to Admin Panel:

Default credentials are usually admin for username and moohoo for password.

Change Admin Password:

Go to ‘Configuration’ -> ‘Mail setup’ and change the admin password.

Configure DKIM and DMARC:

In Mailcow UI, navigate to ‘Configuration’ -> ‘ARC/DKIM keys’.

Generate a new key and add the displayed DKIM record to your DNS settings.

For DMARC, add a DMARC TXT record in your DNS settings (e.g., v=DMARC1; p=none; rua=mailto:[email protected]).

Create Mailboxes:

Use the Mailcow UI to create user mailboxes as needed.

Test Email Functionality:

Send and receive test emails to ensure everything is working correctly.

Configuring Mailcow

Once Mailcow is installed, the next step is to configure it for your specific needs. This chapter focuses on setting up domains and mailboxes, which are crucial for personalizing and operationalizing your email server.

Setting Up Domains

To begin sending and receiving emails, you need to add your domain(s) to Mailcow. Here is how to do it:

Access Mailcow UI: Navigate to your Mailcow UI by entering in your web browser.

Log in: Use your admin credentials to log in.

Navigate to Domain Section:

In the Mailcow UI, go to the ‘Configuration’ tab.

Under ‘Mail setup’, select ‘Domains’.

Add a New Domain:

Click on ‘Add domain’.

Enter your domain name (e.g.,

Configure additional settings like Quota, Backup MX, and Active status as per your requirements.

Save Changes: Click ‘Add domain’ to save the configuration.

Verify the Domain:

Ensure that your DNS settings are correctly pointing to your Mailcow server (as configured in the previous chapter).

Mailcow might perform some checks to verify domain ownership.

Setting Up Mailboxes

After adding your domain, the next step is to create mailboxes for individual users or purposes.

Navigate to Mailbox Section:

Under the ‘Mail setup’ tab, select ‘Mailboxes’.

Create a New Mailbox:

Click on ‘Add mailbox’.

Fill in the required details:

Local Part: The part of the email before the @ (e.g., user for [email protected]).

Domain: Select the domain you added earlier.

Password: Set a strong password for the mailbox.

Full Name: The name of the user or purpose of the mailbox.

Quota: Set the storage limit for the mailbox.

Save the Mailbox: Click ‘Add mailbox’ to create the mailbox.

Repeat for Additional Mailboxes: Follow the same steps to create more mailboxes as needed.

Accessing Mailboxes:

Users can access their mailboxes through the webmail interface or by configuring their email client with the newly created email credentials.


It is important to test the new mailboxes by sending and receiving emails to ensure everything is functioning correctly.

With these steps, you have successfully configured domains and mailboxes in Mailcow. This configuration is the heart of your email server, allowing you and others to start using it for daily email communication. Remember to periodically review and update these settings as your needs evolve.


Recap of Setting Up Mailcow

We have covered a comprehensive journey in setting up Mailcow as an email server on a Linux platform, specifically Debian 11. This guide has taken you through various critical stages:

  • Understanding Mailcow: We began by exploring the features and advantages of Mailcow, highlighting its user-friendly interface, robust security measures, and Docker compatibility.
  • Prerequisites: We then delved into the prerequisites, including the required hardware and software, and essential steps for preparing your Linux server for Mailcow installation.
  • Installing Mailcow: The step-by-step guide provided detailed instructions on installing Mailcow on Debian 11, including DNS configuration and initial setup.
  • Configuring Mailcow: We discussed how to add domains and create mailboxes, which are key to operationalizing your Mailcow email server.

Best Practices

As you continue to manage and use your Mailcow server, keep in mind the following best practices to ensure its optimal performance and security:

  • Regular Updates: Stay on top of updates for Mailcow, Docker, and your Linux distribution to ensure you have the latest features and security patches.
  • Backup Regularly: Implement a regular backup strategy for your Mailcow server. This includes both the email data and the Mailcow configuration.
  • Monitor Server Performance: Keep an eye on server resources like CPU, memory, and disk usage. Adjust your hardware resources as your email volume and user base grow.
  • Secure Access: Use strong, unique passwords for all accounts. Consider implementing two-factor authentication (2FA) for added security.
  • Stay Informed: Join the Mailcow community or forums. Staying connected with other users and developers can provide valuable insights and timely support.
  • Review Email Logs: Regularly check email logs for any unusual activity or errors. This can help in early detection of issues or potential security breaches.
  • Educate Users: If you have users on your server, educate them about best email practices, like identifying phishing attempts and managing spam.
  • Plan for Scalability: As your needs change, be prepared to scale your Mailcow setup. This might involve adding more storage, optimizing Docker configurations, or even migrating to a more powerful server.

By following these steps and best practices, you have equipped yourself with the knowledge to successfully manage a Mailcow email server. This setup not only provides you with control over your email communication but also offers a robust, secure, and flexible platform tailored to your specific needs.

See Also: Experience Our for Free VPS Hosting: Enjoy a 30-Day Trial with Risk-Free Servers


Bare Metal Dedicated Servers

A single tenant, physical server allowing you full access to its resources

Read More

Cloud VPS

The cheapest way to get your own independent computing instance.
Read More

Cloud VDS

Virtualized server platform hosted on enterprise-grade physical servers

Read More

10 Gbps Unmetered Servers

Zomev offers high bandwidth dedicated servers up to 20Gbps.

Read More


Receive the latest news, updates and offers. You can unsubscribe at any time.


Receive the latest news, updates and offers. You can unsubscribe at any time.

zomiv footer logo


Support Hours: 24x7x365
Sale Office Hours: M-F, 7AM-5PM EST

We accept the following:

download (6)



© Copyright 2024, All Rights Reserved by DataCamp Int Limited.

Zomev is a trading name of DataCamp Int Limited. Registered Office: 71-75 Shelton Street, Covent Garden,
London, United Kingdom, WC2H 9JQ.Registered Number 15527709. Registered in England and Wales.



Receive the latest news, and offers. You can unsubscribe at any time.

This is a staging enviroment

Please tell us more about yourself.

Complete the form below and one of our experts will contact you within 24 hours or less. For immediate assistance contact us.

In order to finalize your application, please read and accept our Terms and Conditions*.


Complete the form below and one of our experts will contact you within 24 hours or less. For immediate assistance contact us.

We promise not to sell, trade or use your email for spam. View our Privacy Policy.