Deploying SimpleLogin
Introduction
SimpleLogin is an open-source email alias service that allows you to create unlimited email aliases to protect your real email address. When you sign up for services, make purchases, or share your email online, SimpleLogin provides a unique alias that forwards to your actual inbox while keeping your real address private.
Acquired by Proton (the company behind ProtonMail), SimpleLogin has become a cornerstone of email privacy. The self-hosted version gives you complete control over your email aliases, making it perfect for privacy-conscious individuals and organizations.
Key features of SimpleLogin include:
- Unlimited Aliases: Create as many email aliases as you need
- Reply Anonymously: Respond to emails without revealing your real address
- Custom Domains: Use your own domain for professional-looking aliases
- Browser Extensions: Quick alias creation from Chrome, Firefox, and Safari
- Mobile Apps: iOS and Android apps for on-the-go alias management
- PGP Encryption: Optional encryption for forwarded emails
- Directory Support: Catch-all addresses with subdomain routing
- API Access: Programmatic alias management for developers
- Password Manager Integration: Works with Bitwarden, 1Password, and others
- Spam Protection: Block or disable aliases that receive spam
- Analytics: Track alias usage and block suspicious activity
- Open Source: Full transparency with the ability to self-host
This guide walks through deploying SimpleLogin on Klutch.sh using Docker.
Why Deploy SimpleLogin on Klutch.sh
Deploying SimpleLogin on Klutch.sh provides several advantages:
Complete Privacy Control: Your email aliases and forwarding data remain on your infrastructure.
Simplified Deployment: Klutch.sh handles container builds and deployments automatically.
HTTPS by Default: Automatic SSL certificates for secure alias management.
Persistent Storage: Your aliases and settings survive restarts and redeployments.
Custom Domains: Use your own domains for alias creation.
Scalable Resources: Handle growing alias usage as your needs expand.
Always-On Availability: Your email forwarding works 24/7.
Prerequisites
Before deploying SimpleLogin on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- A PostgreSQL database
- A custom domain with DNS access
- SMTP credentials for sending email
- Basic familiarity with Docker and DNS configuration
- Understanding of email server requirements (MX records, SPF, DKIM)
Important Considerations
SimpleLogin requires significant infrastructure for full functionality:
Email Ports: Full email functionality requires ports 25, 465, and 587 DNS Records: Proper MX, SPF, DKIM, and DMARC records are essential IP Reputation: Email delivery depends on your sending IP’s reputation Complexity: Self-hosted email services require ongoing maintenance
Deploying SimpleLogin on Klutch.sh
Create a GitHub Repository
Create a new GitHub repository for your SimpleLogin deployment.
Create Your Dockerfile
Create a Dockerfile for the web application:
FROM simplelogin/app:latest
ENV FLASK_ENV=productionENV URL=${URL}ENV EMAIL_DOMAIN=${EMAIL_DOMAIN}ENV SUPPORT_EMAIL=${SUPPORT_EMAIL}ENV ADMIN_EMAIL=${ADMIN_EMAIL}ENV EMAIL_SERVERS_WITH_PRIORITY=${EMAIL_SERVERS_WITH_PRIORITY}ENV DKIM_PRIVATE_KEY_PATH=/dkim.keyENV DB_URI=${DB_URI}ENV FLASK_SECRET=${FLASK_SECRET}ENV POSTFIX_SERVER=${POSTFIX_SERVER}ENV DISABLE_REGISTRATION=${DISABLE_REGISTRATION:-false}
EXPOSE 7777
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7777", "app:app"]Push Your Repository to GitHub
Commit and push your Dockerfile.
Configure DNS Records
Set up the required DNS records for your domain:
| Record Type | Name | Value |
|---|---|---|
| MX | @ | Your mail server (priority 10) |
| TXT | @ | v=spf1 include:your-server -all |
| TXT | _dmarc | v=DMARC1; p=quarantine |
| TXT | dkim._domainkey | Your DKIM public key |
| A | app | Your Klutch.sh app IP |
Create a PostgreSQL Database
Set up a PostgreSQL database for SimpleLogin.
Generate Required Keys
Generate a Flask secret key and DKIM key pair for email signing.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project.
Create a New App
Create a new app and connect your GitHub repository.
Configure Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
URL | https://app.yourdomain.com |
EMAIL_DOMAIN | yourdomain.com |
SUPPORT_EMAIL | support@yourdomain.com |
ADMIN_EMAIL | admin@yourdomain.com |
DB_URI | postgresql://user:pass@host/db |
FLASK_SECRET | Your generated secret key |
POSTFIX_SERVER | Your Postfix server address |
Configure HTTP Settings
Set the traffic type to HTTP and configure the internal port to 7777.
Attach Persistent Storage
Add persistent volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data | 5 GB | Application data |
/dkim.key | N/A | DKIM private key (mount as file) |
Deploy Your Application
Click Deploy to start the build process.
Run Database Migrations
After deployment, run database migrations to initialize the schema.
Create Admin Account
Set up your administrator account through the web interface or CLI.
Post-Deployment Configuration
After deploying SimpleLogin:
- Verify DNS: Ensure all DNS records are properly configured
- Test Email Flow: Send test emails to verify forwarding works
- Configure Aliases: Create your first email aliases
- Set Up Browser Extension: Install the SimpleLogin extension for quick alias creation
- Enable 2FA: Secure your admin account with two-factor authentication
Using SimpleLogin
Once deployed, you can:
- Create aliases through the web interface
- Use browser extensions for one-click alias creation
- Manage aliases via the API
- Reply to emails anonymously through the reverse alias feature
- Block or delete aliases that receive spam
Additional Resources
- SimpleLogin GitHub Repository
- SimpleLogin Documentation
- SimpleLogin Official Website
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying SimpleLogin on Klutch.sh gives you a powerful email privacy tool with complete control over your data. While self-hosting an email alias service requires careful configuration of DNS and email infrastructure, the result is a privacy-first solution that protects your real email address across the internet.
For those not ready for the complexity of full self-hosting, SimpleLogin also offers a hosted service with generous free tiers and affordable premium options.