Back to all templates
Mailcow logo

Mailcow

Infrastructure4096MB+ RAM

Full-featured mail server with webmail

emailmail-serverwebmail

Deploy Mailcow in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select Mailcow

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Step-by-step deployment guide

Deploy Mailcow on a VPS with Server Compass

Use the Mailcow template in Server Compass to deploy the official mailcow-dockerized stack with the web UI, SOGo webmail, SMTP, IMAP, antispam, MariaDB, Redis, and Unbound resolver services on a VPS.

About 8 minutesBrowser verified
1
Step 1

Open the server Apps tab

Select the tutorial-vps VPS, open the Apps tab, and start a new app deployment. Keep sensitive server details hidden before capturing or sharing screenshots.

Server Compass Apps tab before creating a Mailcow app
2
Step 2

Choose an app template

Click New App and choose the template deployment path so Server Compass can load the built-in catalog.

Choosing to deploy an app from a Server Compass template
3
Step 3

Search for Mailcow

Use the template picker search to find Mailcow in the Server Compass template catalog.

Searching for Mailcow in the Server Compass template picker
4
Step 4

Select the Mailcow template

Choose the Mailcow template. Server Compass prepares the official mailcow-dockerized stack, high tutorial ports, persistent volumes, generated database credentials, and DNS resolver settings.

Mailcow template selected in Server Compass
5
Step 5

Review the Mailcow settings

Confirm the app name and service settings. In this run, the app was named mailcow-demo; the admin UI was exposed on host port 4809.

Reviewing Mailcow project settings and compose service
6
Step 6

Deploy Mailcow

Review the generated compose settings, confirm the Mailcow service set and high tutorial ports, then click Deploy.

Reviewing Mailcow before deployment
7
Step 7

Watch the deployment progress

Keep the deployment modal open while Server Compass uploads the compose file, pulls the Mailcow images, starts the containers, and verifies the stack.

Server Compass deploying the Mailcow template on the VPS
8
Step 8

Confirm Mailcow is running

After deployment finishes, return to the Apps tab and confirm the Mailcow app is marked Running.

Mailcow template running in the Server Compass Apps tab
9
Step 9

Open the Mailcow web UI

Open the public web URL and confirm Mailcow loads. For a real mail server, sign in with the initial administrator account, change its password, and configure DNS before using the instance.

Mailcow admin UI loaded in a browser

After Mailcow Opens

  • Sign in with Mailcow's initial administrator account and change the default password immediately.
  • Configure MX, SPF, DKIM, DMARC, and reverse DNS before using the server for real mail.
  • Replace `mail.example.test` with a real mail hostname and configure TLS before production use.
  • Restrict admin access with firewall rules or a trusted reverse proxy before exposing it broadly.

Verified Result

The Mailcow web interface loaded successfully in Chromium at http://167.233.138.53:4809/.

Mailcow deployment questions

What does the Mailcow template deploy?

It deploys the official mailcow-dockerized stack with nginx, PHP-FPM, SOGo webmail, Dovecot, Postfix, Rspamd, MariaDB, Redis, and Unbound DNS resolver services.

Which port did the tutorial use?

The tutorial used host port 4809, mapped to the Mailcow nginx web service on the configured HTTP port.

Is the tutorial ready for real mail delivery?

No. The tutorial verifies that Mailcow deploys and serves the admin UI. Real mail delivery still requires a real domain, DNS records, reverse DNS, TLS, and an initial admin user.

Should this become a blog post?

No. The deployment guide should live on the Mailcow template detail page and be linked from the reusable template deployment docs page.

Terminal Deployment

Mailcow CLI Deployment

Deploy Mailcow the traditional way with SSH and Docker Compose.

1

Open a Terminal Connection

Start by opening a terminal window and connecting to your VPS via SSH.

terminal
# Connect to your VPS
ssh root@your-server-ip

# Or with a specific SSH key
ssh -i ~/.ssh/your-key root@your-server-ip

First time? Docker required! Install it with: curl -fsSL https://get.docker.com | sh

2

Create Application Directory

Create a dedicated space for your application deployment.

terminal
# Create and navigate to project directory
mkdir -p ~/apps/mailcow
cd ~/apps/mailcow
3

Create Deployment Configuration

Create a docker-compose.yml file with the following configuration:

docker-compose.yml
services:
  nginx:
    image: ghcr.io/mailcow/nginx:1.03
    ports:
      - "443:443"
      - "80:80"
    restart: unless-stopped
    depends_on:
      - php-fpm

  php-fpm:
    image: ghcr.io/mailcow/phpfpm:1.92
    environment:
      - DBNAME=mailcow
      - DBUSER=mailcow
      - DBPASS=<your-db-password>
    restart: unless-stopped
    depends_on:
      - mysql
      - redis

  mysql:
    image: mariadb:11
    environment:
      - MARIADB_ROOT_PASSWORD=<your-db-root-password>
      - MARIADB_DATABASE=mailcow
      - MARIADB_USER=mailcow
      - MARIADB_PASSWORD=<your-db-password>
    volumes:
      - mysql_data:/var/lib/mysql
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    restart: unless-stopped

  dovecot:
    image: ghcr.io/mailcow/dovecot:1.30
    restart: unless-stopped

  postfix:
    image: ghcr.io/mailcow/postfix:1.77
    ports:
      - "25:25"
      - "465:465"
      - "587:587"
    restart: unless-stopped

volumes:
  mysql_data:
Deployment Settings
PORTHTTPS port(default: 443)
HTTP_PORTHTTP port(default: 80)
DB_PASSWORDDB password
DB_ROOT_PASSWORDRoot password
4

Launch Your Application

Deploy the stack and monitor the startup process.

terminal
# Spin up containers
docker compose up -d

# Verify deployment
docker compose ps

# Check logs for errors
docker compose logs -f
5

Enable External Access

Set up firewall rules to permit incoming connections.

terminal
# Allow the application port through firewall
sudo ufw allow 443/tcp
sudo ufw reload

# Access your app at:
# http://your-server-ip:443
Skip the Terminal

Skip the command line. Deploy visually.

Server Compass makes deploying Mailcow effortless. Visual setup, one-click deploy, done.

  • Visual config editor
  • Instant deployment
  • Automatic HTTPS
  • Smooth updates
  • Live monitoring
  • Quick rollbacks
Download Server Compass$29 one-time • Lifetime license

After Deployment

After deploying Mailcow with Server Compass, complete these steps to finish setup

1

Configure DNS records

2

Add domains

3

Create mailboxes

Need help? Check out our documentation for detailed guides.

Mailcow FAQ

Common questions about self-hosting Mailcow

How do I deploy Mailcow with Server Compass?

Simply download Server Compass, connect to your VPS, and select Mailcow from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.

What are the system requirements for Mailcow?

Mailcow requires a minimum of 4096MB RAM. We recommend a VPS with at least 8192MB RAM for optimal performance. Any modern Linux server with Docker support will work.

Can I migrate my existing Mailcow data?

Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard Mailcow backup and restore procedures.

How do I update Mailcow to the latest version?

Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest Mailcow image will be pulled and deployed with zero downtime.

Is Mailcow free to self-host?

Mailcow is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.

Ready to Self-Host Mailcow?

Download Server Compass and deploy Mailcow to your VPS in under 3 minutes. No Docker expertise required.

Download Server Compass