Deploying Inboxen
Introduction
Inboxen is a privacy-focused disposable email service that allows users to create unlimited unique email addresses on the fly. Instead of giving out your real email address to every website, newsletter, or service, you can create a new Inboxen address for each purpose - making it easy to identify who sold your data when spam arrives, and even easier to shut down compromised addresses.
Built with Python and Django, Inboxen provides a clean web interface for managing your addresses and reading incoming mail. Unlike temporary email services that delete addresses after minutes or hours, Inboxen addresses persist until you choose to delete them, making them suitable for ongoing use with services that require email verification.
Key highlights of Inboxen:
- Unlimited Addresses: Create as many email addresses as you need
- Persistent Inboxes: Addresses remain active until you delete them
- Privacy Protection: Keep your real email address private
- Spam Identification: Know exactly which service leaked your address
- Web Interface: Read and manage email through a clean web UI
- Search: Find messages across all your addresses
- Unified Inbox: View all incoming mail in one place
- Address Tagging: Organize addresses by purpose or category
- Open Source: AGPLv3 licensed, self-hostable
- No Tracking: No ads, no selling of user data
- Libravatar Support: User avatars through Libravatar
This guide walks through deploying Inboxen on Klutch.sh using Docker, setting up your own privacy-protecting email service.
Why Deploy Inboxen on Klutch.sh
Deploying Inboxen on Klutch.sh provides several advantages for private email management:
Complete Control: Host your own disposable email service without trusting third parties with your communications.
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Inboxen without complex mail server configuration.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure access to your email interface.
Persistent Storage: Attach persistent volumes for your email database and messages.
GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.
Custom Domains: Use your own domain for personalized email addresses.
Prerequisites
Before deploying Inboxen on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Inboxen configuration
- Basic familiarity with Docker and containerization concepts
- A PostgreSQL database (can be deployed separately)
- A domain with MX records configured for receiving email
- Understanding of email infrastructure (MX records, SMTP)
Understanding Inboxen Architecture
Inboxen consists of several components:
Django Web Application: The web interface for managing addresses and reading mail.
Celery Workers: Background task processing for email handling.
PostgreSQL Database: Stores users, addresses, and message metadata.
Email Reception: Requires mail server integration (Postfix, etc.) to receive incoming mail.
Important Considerations
Email Reception: Inboxen is designed to receive email, not send it. It needs to integrate with a mail transfer agent (MTA) like Postfix that handles the actual email reception and passes messages to Inboxen.
DNS Configuration: Proper MX records must point to your mail server for email delivery to work.
Spam Filtering: Consider implementing spam filtering (SpamAssassin, rspamd) in front of Inboxen.
Preparing Your Repository
To deploy Inboxen on Klutch.sh, create a GitHub repository containing your Dockerfile and configuration.
Repository Structure
inboxen-deploy/├── Dockerfile├── settings.py└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM python:3.11-slim
# Install dependenciesRUN apt-get update && apt-get install -y \ git \ postgresql-client \ libpq-dev \ gcc \ && rm -rf /var/lib/apt/lists/*
# Clone InboxenWORKDIR /appRUN git clone https://github.com/Inboxen/Inboxen.git .
# Install Python dependenciesRUN pip install --no-cache-dir -r requirements.txtRUN pip install gunicorn psycopg2-binary
# Set environment variablesENV DJANGO_SETTINGS_MODULE=inboxen.settingsENV PYTHONUNBUFFERED=1
# Database configurationENV DATABASE_URL=${DATABASE_URL}ENV SECRET_KEY=${SECRET_KEY}
# Create directoriesRUN mkdir -p /app/static /app/media
# Collect static filesRUN python manage.py collectstatic --noinput || true
# Expose portEXPOSE 8000
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8000/ || exit 1
# Run with GunicornCMD ["gunicorn", "--bind", "0.0.0.0:8000", "inboxen.wsgi:application"]Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
SECRET_KEY | Yes | - | Django secret key for security |
DATABASE_URL | Yes | - | PostgreSQL connection URL |
ALLOWED_HOSTS | Yes | - | Comma-separated list of allowed hostnames |
DEBUG | No | False | Enable debug mode (not for production) |
EMAIL_DOMAIN | Yes | - | Domain for email addresses |
SITE_NAME | No | Inboxen | Display name for the site |
Deploying Inboxen on Klutch.sh
Once your repository is prepared, follow these steps to deploy Inboxen:
- Deploy a PostgreSQL app on Klutch.sh
- Use a managed database service
- Use an existing PostgreSQL server
- Select HTTP as the traffic type
- Set the internal port to 8000
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Inboxen container
- Provision an HTTPS certificate
- Configuring MX records for your domain
- Setting up a mail server (Postfix) to receive mail
- Configuring delivery to Inboxen’s LMTP interface
Generate Your Secret Key
Generate a secure Django secret key:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"Or use:
openssl rand -hex 50Set Up PostgreSQL
Inboxen requires PostgreSQL. You can:
Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile settings.py .dockerignoregit commit -m "Initial Inboxen deployment configuration"git remote add origin https://github.com/yourusername/inboxen-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “inboxen” or “private-email”.
Create a New App
Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Inboxen Dockerfile.
Configure HTTP Traffic
Inboxen serves its web interface over HTTP. In the deployment settings:
Set Environment Variables
In the environment variables section, add:
| Variable | Value |
|---|---|
SECRET_KEY | Your generated secret key |
DATABASE_URL | postgres://user:pass@host/dbname |
ALLOWED_HOSTS | your-app-name.klutch.sh,yourdomain.com |
EMAIL_DOMAIN | Your email domain |
Attach Persistent Volumes
Add the following volume for data:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/app/media | 10 GB | User uploads and attachments |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Initialize the Database
After deployment, run migrations through the Klutch.sh console or exec:
python manage.py migratepython manage.py createsuperuserConfigure Mail Reception
Set up your mail server to deliver incoming mail to Inboxen. This typically involves:
Using Inboxen
Creating Addresses
- Log into your Inboxen account
- Click “New Inbox” or equivalent
- Inboxen generates a random address or lets you choose
- Use this address wherever you need an email
Managing Addresses
- Tag addresses to organize by purpose
- Disable addresses to stop receiving mail
- Delete addresses when no longer needed
- Search across all inboxes
Reading Mail
- View the unified inbox for all messages
- Or select a specific address to see its mail
- Read, archive, or delete messages
Email Infrastructure Notes
Full Email Stack
Inboxen handles the web interface and message storage, but you need:
- MX Records: DNS configuration pointing to your mail server
- MTA (Postfix/etc.): To receive incoming SMTP connections
- Spam Filtering: Optional but recommended
- Inboxen: Final delivery and user interface
Simplified Setup
For testing or small-scale use, consider:
- Using a separate mail server that forwards to Inboxen
- Email hosting services with forwarding capabilities
- Integrated solutions that combine MTA and application
Troubleshooting Common Issues
No Email Arriving
Symptoms: Addresses created but no mail received.
Solutions:
- Verify MX records are correctly configured
- Check mail server logs for delivery issues
- Ensure mail server is configured to deliver to Inboxen
Database Errors
Symptoms: Application errors related to database.
Solutions:
- Verify DATABASE_URL is correct
- Run migrations if not already done
- Check PostgreSQL server accessibility
Static Files Not Loading
Symptoms: CSS and JavaScript not rendering.
Solutions:
- Run collectstatic
- Verify static file serving configuration
- Check for filesystem permissions
Additional Resources
- Inboxen GitHub Repository
- Inboxen Public Instance
- Django Documentation
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying Inboxen on Klutch.sh gives you control over your own disposable email service, protecting your privacy when signing up for online services. While it requires additional mail infrastructure for email reception, the result is a powerful tool for managing your online identity and tracking which services share your information.
For the web interface component, Klutch.sh provides simplified deployment and management. For complete email functionality, integrate with a properly configured mail server infrastructure.