Install on Coolify

Deploy Maillayer to Coolify as a Docker Compose resource. Roughly five minutes end-to-end.

Coolify is a self-hosted PaaS that runs Docker workloads on your own server. Maillayer ships as a single image, so the flow is: create a Compose-empty resource, paste the Compose file, set a domain on the service, add two env vars, and deploy.

Before you start
You need a working Coolify install with a server connected (the localhost server is fine for a quick try) and a domain whose A record you can point at the Coolify host. If you haven't set Coolify up yet, follow the Coolify install guide first.

Deploy

  1. Sign in to your Coolify dashboard. Open (or create) a Project, pick an Environment (the default production is fine), then click + Add Resource.

  2. On the New Resource screen, scroll to the Docker Based column and pick Docker Compose Empty.

    Coolify New Resource page with Docker Compose Empty selected
    Step 2 — Pick Docker Compose Empty.
  3. On the Create a new Service page, paste the Compose file into the Docker Compose file editor and click Save:

    services:
      maillayer:
        image: ghcr.io/mddanishyusuf/maillayer-pro:1
        restart: unless-stopped
        ports:
          - "3000:3000"
        volumes:
          - maillayer-data:/app/data
        environment:
          AUTH_SECRET: ${AUTH_SECRET}
          APP_URL: ${APP_URL}
    
    volumes:
      maillayer-data:
  4. Coolify drops you on the Service Stack Configuration page. Scroll to Services, find the maillayer service, and click Settings on the right.

    Service Stack page with the Settings button highlighted on the maillayer service
    Step 4 — Open the service Settings.
  5. Set Domains to your full URL, e.g. https://mail.example.com. Coolify auto-detects port 3000 from the Compose file, so you don't need to specify it.

    At your DNS provider, add an A record for mail.example.com pointing to your Coolify server's IP. Coolify will provision a Let's Encrypt certificate on the first deploy.

    Click Save.

    Service configuration page with Domains set to https://mail.example.com
    Step 5 — Set the domain on the service.
  6. Click Back, then open Environment Variables from the left sidebar and add:

    APP_URL=https://mail.example.com
    AUTH_SECRET=<paste output of: openssl rand -base64 48>

    For AUTH_SECRET, run openssl rand -base64 48 locally and paste the output. Click Save.

  7. Click Deploy in the top right. Watch the logs until the container is healthy, then open your domain and sign up — the first account becomes the owner.

Why AUTH_SECRET matters
AUTH_SECRET decrypts every stored provider credential (SES keys, SendGrid tokens, Stripe webhooks, Firebase service-account JSON…). If you lose it, those credentials become unreadable and you'll need to re-enter them. Keep a copy in a password manager.

Replicas

Stay at 1 replica
SQLite is single-writer and the queue/cron run in-process. Multiple replicas will corrupt the database and run every job N times. Keep Replicas = 1 — don't enable Coolify's horizontal scaling for this service.

Volume management

  • Persistence: the maillayer-data named volume Coolify creates from the Compose file holds the SQLite database, uploaded images, and nightly backups. It survives container restarts and redeploys.
  • Inspect: open the resource in Coolify, go to Terminal, and run ls /app/data. Or SSH to the host and use docker exec -it <container> sh.
  • Backup: Maillayer takes nightly VACUUM backups in /app/data/backups. See Backups for an offsite-copy recipe.