Skip to content

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
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM python:3.11-slim
# Install dependencies
RUN apt-get update && apt-get install -y \
git \
postgresql-client \
libpq-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Clone Inboxen
WORKDIR /app
RUN git clone https://github.com/Inboxen/Inboxen.git .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install gunicorn psycopg2-binary
# Set environment variables
ENV DJANGO_SETTINGS_MODULE=inboxen.settings
ENV PYTHONUNBUFFERED=1
# Database configuration
ENV DATABASE_URL=${DATABASE_URL}
ENV SECRET_KEY=${SECRET_KEY}
# Create directories
RUN mkdir -p /app/static /app/media
# Collect static files
RUN python manage.py collectstatic --noinput || true
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8000/ || exit 1
# Run with Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "inboxen.wsgi:application"]

Environment Variables Reference

VariableRequiredDefaultDescription
SECRET_KEYYes-Django secret key for security
DATABASE_URLYes-PostgreSQL connection URL
ALLOWED_HOSTSYes-Comma-separated list of allowed hostnames
DEBUGNoFalseEnable debug mode (not for production)
EMAIL_DOMAINYes-Domain for email addresses
SITE_NAMENoInboxenDisplay name for the site

Deploying Inboxen on Klutch.sh

Once your repository is prepared, follow these steps to deploy Inboxen:

    Generate Your Secret Key

    Generate a secure Django secret key:

    Terminal window
    python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"

    Or use:

    Terminal window
    openssl rand -hex 50

    Set Up PostgreSQL

    Inboxen requires PostgreSQL. You can:

    • Deploy a PostgreSQL app on Klutch.sh
    • Use a managed database service
    • Use an existing PostgreSQL server

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile settings.py .dockerignore
    git commit -m "Initial Inboxen deployment configuration"
    git remote add origin https://github.com/yourusername/inboxen-deploy.git
    git push -u origin main

    Create 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:

    • Select HTTP as the traffic type
    • Set the internal port to 8000

    Set Environment Variables

    In the environment variables section, add:

    VariableValue
    SECRET_KEYYour generated secret key
    DATABASE_URLpostgres://user:pass@host/dbname
    ALLOWED_HOSTSyour-app-name.klutch.sh,yourdomain.com
    EMAIL_DOMAINYour email domain

    Attach Persistent Volumes

    Add the following volume for data:

    Mount PathRecommended SizePurpose
    /app/media10 GBUser uploads and attachments

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Inboxen container
    • Provision an HTTPS certificate

    Initialize the Database

    After deployment, run migrations through the Klutch.sh console or exec:

    Terminal window
    python manage.py migrate
    python manage.py createsuperuser

    Configure Mail Reception

    Set up your mail server to deliver incoming mail to Inboxen. This typically involves:

    1. Configuring MX records for your domain
    2. Setting up a mail server (Postfix) to receive mail
    3. Configuring delivery to Inboxen’s LMTP interface

Using Inboxen

Creating Addresses

  1. Log into your Inboxen account
  2. Click “New Inbox” or equivalent
  3. Inboxen generates a random address or lets you choose
  4. 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

  1. View the unified inbox for all messages
  2. Or select a specific address to see its mail
  3. Read, archive, or delete messages

Email Infrastructure Notes

Full Email Stack

Inboxen handles the web interface and message storage, but you need:

  1. MX Records: DNS configuration pointing to your mail server
  2. MTA (Postfix/etc.): To receive incoming SMTP connections
  3. Spam Filtering: Optional but recommended
  4. 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

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.