Let’s get started with setting up Maillayer on your server.

If you prefer a video guide, watch the tutorial below:

YouTube Video


Step 1: Create a Virtual Private Server (VPS)

In this guide, we'll use DigitalOcean, but the process is nearly the same for any VPS provider. Start by creating a Droplet on DigitalOcean:

Create Droplet

Once your droplet is created, you'll get its public IPv4 address. Now use a terminal to connect to your server:

ssh root@your.server.ip

Replace your.server.ip with the actual IP address, press enter, and enter your password when prompted.


Step 2: Install Coolify

Coolify is a self-hosted deployment platform (similar to Heroku). It’s the easiest way to manage your deployments via a browser-based UI.

Run the following command on your server to install Coolify:

curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

Once installed, you’ll see a message confirming success:

Coolify installed

You can now access the Coolify dashboard via:

http://your.server.ip:8000

The first time you open it, you’ll be prompted to create a root account.

It should now look similar to a cPanel dashboard:

Coolify UI


Step 3: Create a Project in Coolify

  1. Click the Add button to create a new project.
  2. Follow the flow:
    • Create ProjectProduction
    • Add New Resource
    • Select Private Repository (with GitHub App)
    • Click Add GitHub App
    • Click Continue
    • Click Register Now
    • Install the GitHub App
    • Select the forked Maillayer repo and click Save

Go back to your project → click Add New Resource again → select Private Repository (with GitHub App).

Now you’ll see the GitHub App you just installed. Choose it, then select your Maillayer repository and click Load Repository.

In the next step, choose Docker as the build pack and click Continue:

Docker Config


Step 4: Configure Custom Domain

On the project config page, before deploying, set your custom domain.

⚠️ Do not click the Deploy button yet!

Use your domain with https format. For example:

https://mail.yourdomain.com

Click Save.

Config Domain


Step 5: Add MongoDB and Redis

  1. In your project dashboard, click Add New Resource.
  2. Search or scroll to MongoDB, click on it, then hit Start.
  3. Once running, copy the Mongo URL (internal) – you’ll need this later.

MongoDB

Repeat the same for Redis:

  • Search for Redis
  • Click Start
  • Copy the Redis URL (internal) for later use

Step 6: Add Environment Variables

  1. Go to your project
  2. Click the Application tab
  3. Go to Environment Variables
  4. Switch to Developer View
  5. Paste the following environment variables with your actual values:
# Application
NODE_ENV=production
BASE_URL=https://mail.yourdomain.com
NEXTAUTH_SECRET=your-secret-key-here-min-32-chars
TRACKING_SECRET=your-secure-tracking-secret
MONGODB_URI=your-mongo-internal-url
REDIS_URL=your-redis-internal-url

Click Save All Environment Variables.


Final Step: Deploy Maillayer 🎉

Now everything is set. Go ahead and click the Deploy button!

⏳ It might take 3–5 minutes to complete the deployment. Sit back and enjoy a cup of coffee ☕️.

Once deployed, open your domain (e.g. https://mail.yourdomain.com) — you’ll be prompted to create your admin account.

You’re now ready to start using Maillayer!

Domain Verification

To send email campaing, you have to verify domain on AWS. Follow this link to get AWS credientials.


👉 Next: Applying for Production Access