Back to all templates
Mailu logo

Mailu

Infrastructure2048MB+ RAM

Full-featured mail server with webmail

emailmail-serverwebmail

Deploy Mailu in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select Mailu

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Step-by-step deployment guide

Deploy Mailu on a VPS with Server Compass

Use the Mailu template in Server Compass to deploy the Mailu admin UI, webmail, SMTP, IMAP, antispam, Redis, and Unbound resolver stack 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 Mailu 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 Mailu

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

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

Select the Mailu template

Choose the Mailu template. Server Compass fills the generated Mailu stack, high tutorial ports, persistent volumes, and Unbound resolver settings.

Mailu template selected in Server Compass
5
Step 5

Review the Mailu settings

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

Reviewing Mailu project settings and compose service
6
Step 6

Deploy Mailu

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

Reviewing Mailu before deployment
7
Step 7

Watch the deployment progress

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

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

Confirm Mailu is running

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

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

Open the Mailu admin UI

Open the public admin URL and confirm Mailu loads. For a real mail server, create the primary admin user and configure DNS before using the instance.

Mailu admin UI loaded in a browser

After Mailu Opens

  • Create the primary administrator with `docker compose exec admin flask mailu admin POSTMASTER DOMAIN PASSWORD`.
  • Configure MX, SPF, DKIM, DMARC, and reverse DNS before using the server for real mail.
  • Switch `TLS_FLAVOR` from `notls` to `cert` or `letsencrypt` before production use.
  • Restrict admin access with firewall rules or a trusted reverse proxy before exposing it broadly.

Verified Result

The Mailu admin interface loaded successfully in Chromium at http://91.99.15.247:4808/admin/.

Mailu deployment questions

What does the Mailu template deploy?

It deploys the Mailu 2024.06 stack with nginx/front, admin, Dovecot, Postfix, Rspamd, SnappyMail webmail, Redis, and Unbound DNS resolver services.

Which port did the tutorial use?

The tutorial used host port 4808, mapped to the Mailu front service on container port 80.

Is the tutorial ready for real mail delivery?

No. The tutorial verifies that Mailu 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 Mailu template detail page and be linked from the reusable template deployment docs page.

Do It Yourself

Deploy Mailu via Command Line

Prefer the command line? Follow this step-by-step guide to deploy Mailu manually on your VPS.

1

Start a Secure Shell Session

Open your terminal and connect to your server. Replace the IP address with your VPS IP.

terminal
# SSH into your server
ssh root@your-server-ip

# Using a custom SSH key
ssh -i ~/.ssh/id_rsa root@your-server-ip

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

2

Prepare Your Workspace

Set up a clean directory for your application.

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

Set Up Container Configuration

Set up the container stack using this Docker Compose configuration:

docker-compose.yml
services:
  front:
    image: ghcr.io/mailu/nginx:2024.06
    ports:
      - "80:80"
      - "443:443"
      - "25:25"
      - "143:143"
      - "587:587"
    environment:
      - TZ=UTC
    volumes:
      - mailu_certs:/certs
      - mailu_overrides:/overrides
    restart: unless-stopped
    depends_on:
      - admin
      - imap
      - smtp

  admin:
    image: ghcr.io/mailu/admin:2024.06
    environment:
      - SECRET_KEY=<your-secret-key>
      - DOMAIN=<your-domain>
      - HOSTNAMES=<your-hostnames>
      - TZ=UTC
    volumes:
      - mailu_data:/data
      - mailu_dkim:/dkim
    restart: unless-stopped
    depends_on:
      - redis

  imap:
    image: ghcr.io/mailu/dovecot:2024.06
    environment:
      - TZ=UTC
    volumes:
      - mailu_mail:/mail
      - mailu_overrides:/overrides
    restart: unless-stopped

  smtp:
    image: ghcr.io/mailu/postfix:2024.06
    environment:
      - TZ=UTC
    volumes:
      - mailu_overrides:/overrides
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    volumes:
      - mailu_redis:/data
    restart: unless-stopped

volumes:
  mailu_certs:
  mailu_overrides:
  mailu_data:
  mailu_dkim:
  mailu_mail:
  mailu_redis:
Configuration Variables
PORTHTTP port(default: 80)
HTTPS_PORTHTTPS port(default: 443)
SMTP_PORTSMTP port(default: 25)
IMAP_PORTIMAP port(default: 143)
SUBMISSION_PORTSubmission port(default: 587)
DOMAINMail domain
4

Bring Up the Application

Launch your application stack in the background.

terminal
# Start the containers in detached mode
docker compose up -d

# Check if containers are running
docker compose ps

# View logs
docker compose logs -f
5

Configure Firewall

Configure your firewall to permit external connections.

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

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

Prefer a visual interface? Use Server Compass.

Deploy Mailu with a beautiful UI instead. No SSH, no YAML editing, no terminal commands. Just click, configure, and deploy in under 3 minutes.

  • Visual configuration UI
  • One-click deployment
  • Automatic SSL setup
  • Zero-downtime updates
  • Built-in monitoring
  • One-click rollbacks
Download Server Compass$29 one-time • Lifetime license

After Deployment

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

1

Configure DNS records

2

Create admin account

3

Add mail domains

Need help? Check out our documentation for detailed guides.

Mailu FAQ

Common questions about self-hosting Mailu

How do I deploy Mailu with Server Compass?

Simply download Server Compass, connect to your VPS, and select Mailu 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 Mailu?

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

Can I migrate my existing Mailu data?

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

How do I update Mailu to the latest version?

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

Is Mailu free to self-host?

Mailu 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 Mailu?

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

Download Server Compass