The fastest way to get Maillayer running. One command installs everything you need—Node.js, MongoDB, Redis, Caddy, and Maillayer itself.

Note: You'll need a Maillayer license key to activate your installation. Get your license if you haven't already.

Why One-Command Install?

  • Literally one command
  • Works on any fresh VPS
  • Installs all dependencies automatically
  • Production-ready in under 5 minutes
  • Domain and SSL configured via dashboard

Requirements

  • A fresh VPS with Ubuntu 20.04+ or Debian 11+
  • Minimum 2GB RAM (4GB recommended)
  • SSH access to your server
  • Ports 80 and 443 available

Quick Start

SSH into your server and run:

curl -fsSL https://get.maillayer.com/install.sh | sudo bash

That's it. The installer will:

  1. Check system requirements
  2. Install Node.js 20
  3. Set up MongoDB and Redis
  4. Install PM2 and Caddy
  5. Download and configure Maillayer
  6. Start all services

What the Installer Does

[1/9] Checking requirements...
[2/9] Installing system dependencies...
[3/9] Installing Node.js...
[4/9] Installing databases...
[5/9] Installing PM2 and Caddy...
[6/9] Downloading Maillayer...
[7/9] Configuring Maillayer...
[8/9] Starting services...
[9/9] Finalizing...

✓ Maillayer installed successfully!

Access Maillayer at: http://YOUR_SERVER_IP

Post-Installation

After installation completes:

  1. Open http://YOUR_SERVER_IP in your browser
  2. Enter your license key to activate Maillayer
  3. Create your admin account
  4. Configure your domain via the app dashboard
  5. Start sending emails!

Managing Your Installation

The installer creates the maillayer CLI command:

# Check service status
maillayer status

# View logs
maillayer logs

# Restart services
maillayer restart

# Update to latest version
maillayer update

# Create a backup
maillayer backup

# Restore from backup
maillayer restore backup-file.tar.gz

# Show installation info
maillayer info

# Edit configuration
maillayer config

# Uninstall
maillayer uninstall

File Locations

PathDescription
/opt/maillayerApplication files
/opt/maillayer/.envEnvironment variables
/opt/maillayer/logsApplication logs
/opt/maillayer/backupsBackup files
/etc/caddy/CaddyfileCaddy configuration

Updating

Update to the latest version:

maillayer update

This will:

  • Stop services
  • Backup current version
  • Download new version
  • Reinstall dependencies
  • Restart services

Backup & Restore

Create a backup:

maillayer backup

Backups include MongoDB data and configuration files, saved to /opt/maillayer/backups/.

Restore from backup:

maillayer restore backup-2024-01-15.tar.gz

Estimated Costs

You just need a VPS:

ProviderSpecCost
HetznerCX21 (2GB)€4.85/month
DigitalOceanBasic (2GB)$12/month
VultrCloud (2GB)$10/month
LinodeNanode (2GB)$12/month

Troubleshooting

Installation fails with permission error

  • Make sure you're using sudo
  • Run: curl -fsSL https://get.maillayer.com/install.sh | sudo bash

Port 80/443 already in use

  • Stop existing web servers: sudo systemctl stop nginx apache2
  • Check what's using the port: sudo lsof -i :80

Services not starting

maillayer status
maillayer logs

Out of memory during installation

  • Use a VPS with at least 2GB RAM
  • Or add swap space:
    sudo fallocate -l 2G /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    

What Gets Installed

The installer sets up:

  • Node.js 20 - JavaScript runtime
  • MongoDB 7.0 - Database
  • Redis - Caching and sessions
  • PM2 - Process manager
  • Caddy - Web server with automatic HTTPS

All services are configured to start on boot.

Uninstalling

To completely remove Maillayer:

maillayer uninstall

This will:

  • Stop and remove PM2 processes
  • Optionally remove all data
  • Remove the maillayer command

Note: MongoDB, Redis, Node.js, and Caddy remain installed.

Security Notes

  • The installer generates secure random secrets automatically
  • MongoDB and Redis only listen on localhost
  • Caddy handles SSL automatically when you configure a domain
  • Environment file permissions are set to 600

Getting Help

If you encounter issues:

  1. Check logs: maillayer logs
  2. Check status: maillayer status
  3. Visit our GitHub Issues