An email client that uses IMAP/POP3 to pull all emails into a self-hosted endpoint.
1.8K
A self-hosted, Gmail-inspired email client. Connect your existing email accounts via POP3, IMAP, and SMTP — read, send, and organise your mail through a familiar web interface, without relying on any third-party cloud service. Your data never leaves your machine.




The easiest way to get started — no build step required. The image is published on Docker Hub at jahuuk/localmail-app.
1. Create a docker-compose.yml
services:
localmail:
image: jahuuk/localmail-app:latest
container_name: localmail
ports:
- "5000:5000"
volumes:
- localmail_data:/app/data ## Create your persistent volume to ensure user settings and emails remain after a restart/redeploy
environment:
- ENCRYPTION_KEY= ## REPLACE_WITH_OUTPUT_OF__openssl_rand_-hex_32
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD= ## REPLACE_WITH_A_STRONG_PASSWORD
restart: unless-stopped
volumes:
localmail_data:
Replace the ENCRYPTION_KEY and ADMIN_PASSWORD values before starting. Generate a key with:
openssl rand -hex 32
2. Start
docker compose up -d
Open http://localhost:5000. Log in with the admin credentials you set above.
3. Update to a new version
docker compose pull
docker compose up -d
Data is stored in a Docker named volume (localmail_data) — fully self-contained inside Docker. All emails, settings, and account passwords survive updates and container restarts automatically.
LocalMail runs on plain HTTP. For secure access put it behind a reverse proxy - and do not make this a public facing app as the admin portal is now fantastically mature as of yet. This is meant for personal/homelab use. I would recommend Caddy for ease of use.
| Variable | Default | Description |
|---|---|---|
PORT | 5000 | HTTP port the server listens on |
ENCRYPTION_KEY | Auto-generated | 64-character hex string used for AES-256 encryption of emails and credentials. Generate with openssl rand -hex 32. Stored in data/.encryption-key if not provided via environment. |
ADMIN_USERNAME | — | Username for the admin account created on first boot. Ignored if users already exist. |
ADMIN_PASSWORD | — | Password for the admin account created on first boot. Ignored if users already exist. |
Everything lives in the data/ directory — no external database required:
data/
users.json # User accounts (bcrypt-hashed passwords)
.encryption-key # Auto-generated key (if ENCRYPTION_KEY env not set)
users/<user-id>/
storage.json # Accounts, labels, settings, email rules, backup config
emails/<email-id>.json # Encrypted email files (AES-256-CBC)
attachments/<email-id>/ # Attachment files per email
Settings → Backup → Download Backup produces a .zip of your entire data/ directory for your user. Restore by uploading that same file from the same panel.
Settings → Backup → Cloud Backup supports Amazon S3, Azure Blob Storage, and Google Cloud Storage. Set a schedule (daily/weekly/monthly) or trigger manually. Backup history and one-click restore are available from the same panel. All cloud credentials are encrypted at rest.
Critical: Always back up your ENCRYPTION_KEY (or data/.encryption-key) separately from your data. Without it, encrypted emails and account passwords cannot be decrypted.
The official image is published at jahuuk/localmail-app.
MIT
Content type
Image
Digest
sha256:71ac98cbe…
Size
117.4 MB
Last updated
5 months ago
docker pull jahuuk/localmail-app