How to install a full mail server with Mailcow
Updated 10/16/2026
Mailcow packages everything you need for email (Postfix, Dovecot, Rspamd, webmail) into Docker containers, with a simple admin interface.
Requirements
- A server with at least 6 GB RAM.
- Docker installed, see getting started with Docker.
- A subdomain, for example
mail.example.com, with an A record.
1. Download Mailcow
cd /opt
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
./generate_config.sh
When prompted, enter the hostname: mail.example.com.
2. Start
docker compose pull
docker compose up -d
3. Configure DNS
Mailcow shows you in the interface exactly which records to add: MX, SPF, DKIM, DMARC. See also the SPF, DKIM and DMARC guide.
4. Reverse DNS
Request the PTR for the server IP to point to mail.example.com, see reverse DNS.
5. Enter the panel
Go to https://mail.example.com, create the domains and mailboxes. Do not forget a backup for the Docker volumes.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to filter spam with Rspamd
Rspamd is a modern, fast spam filter. Here is how to use it to keep your inbox clean.
Updated 10/16/2026EmailHow to send email from your app over SMTP
Configure your app to send transactional emails (confirmations, password resets) over SMTP.
Updated 10/16/2026EmailHow to secure a mail server
A misconfigured mail server becomes a spam source. Here are the essential security rules.
Updated 10/16/2026