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:
- Check system requirements
- Install Node.js 20
- Set up MongoDB and Redis
- Install PM2 and Caddy
- Download and configure Maillayer
- 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:
- Open
http://YOUR_SERVER_IPin your browser - Enter your license key to activate Maillayer
- Create your admin account
- Configure your domain via the app dashboard
- 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
| Path | Description |
|---|---|
/opt/maillayer | Application files |
/opt/maillayer/.env | Environment variables |
/opt/maillayer/logs | Application logs |
/opt/maillayer/backups | Backup files |
/etc/caddy/Caddyfile | Caddy 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:
| Provider | Spec | Cost |
|---|---|---|
| Hetzner | CX21 (2GB) | €4.85/month |
| DigitalOcean | Basic (2GB) | $12/month |
| Vultr | Cloud (2GB) | $10/month |
| Linode | Nanode (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:
- Check logs:
maillayer logs - Check status:
maillayer status - Visit our GitHub Issues
