---
title: "Deploy Bichon Email Archiver"
description: "Archive and full-text search your IMAP email (Gmail, Outlook) in a web UI"
category: "Storage"
url: https://railway.com/deploy/bichon-email-archiver
---

# Deploy Bichon Email Archiver

Archive and full-text search your IMAP email (Gmail, Outlook) in a web UI

**[Deploy Bichon Email Archiver on Railway](https://railway.com/template/bichon-email-archiver)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/bichon-email-archiver/manifest.json

- **Creator:** Auromations
- **Category:** Storage
- **Total deploys:** 1

## Template content

### bichon https://raw.githubusercontent.com/rustmailer/bichon/2.2.0/web/public/assets/favicon.svg

- **Image:** rustmailer/bichon:2.2.0
- **Start command:** `/bin/sh -c "echo IyEvYmluL3NoCiMgQmljaG9uIHNlZWRzIGFkbWluIC8gYWRtaW5AYmljaG9uIG9uIGZpcnN0IHN0YXJ0LiBBcHBseSBCSUNIT05fQURNSU5fUEFTU1dPUkQgb24gYQojIGxvb3BiYWNrLW9ubHkgc2VydmVyIGZpcnN0LCBzbyB0aGUgcHVibGljIGxpc3RlbmVyIG5ldmVyIHNlcnZlcyB0aGUgc2VlZGVkIHBhc3N3b3JkLgpzZXQgLXUKU1JWPS9vcHQvYmljaG9uL2JpY2hvbi1zZXJ2ZXIKQVBQTElFRD0iJEJJQ0hPTl9ST09UX0RJUi8uYWRtaW4tcGFzc3dvcmQtYXBwbGllZCIKbWtkaXIgLXAgIiRCSUNIT05fUk9PVF9ESVIiCgppZiBbIC1uICIke0JJQ0hPTl9BRE1JTl9QQVNTV09SRDotfSIgXTsgdGhlbgogIEJJQ0hPTl9CSU5EX0lQPTEyNy4wLjAuMSBCSUNIT05fSFRUUF9QT1JUPTE1Njk5ICRTUlYgJiBwaWQ9JCEKICBhcGk9aHR0cDovLzEyNy4wLjAuMToxNTY5OS9hcGkKICBpPTA7IHVudGlsIGN1cmwgLWZzICRhcGkvc3RhdHVzID4vZGV2L251bGw7IGRvIGk9JCgoaSsxKSk7IFsgJGkgLWd0IDEyMCBdICY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cIn0iICRhcGkvdjEvdXNlcnMvMTAwMDAwMDAwMDAwMDAwKQogICAgICBpZiBbICIkY29kZSIgPSAyMDAgXTsgdGhlbiByZW1lbWJlcjsgZWNobyAiYm9vdDogYXBwbGllZCBCSUNIT05fQURNSU5fUEFTU1dPUkQgdG8gYWRtaW4iCiAgICAgIGVsc2UgZWNobyAiYm9vdDogV0FSTklORyBCaWNob24gcmVmdXNlZCBCSUNIT05fQURNSU5fUEFTU1dPUkQgKEhUVFAgJGNvZGUpOyB1c2UgOC0yNTYgY2hhcmFjdGVycyB3aXRob3V0IHF1b3RlcyBvciBiYWNrc2xhc2hlcyI7IGZpCiAgICBlbHNlCiAgICAgIGVjaG8gImJvb3Q6IFdBUk5JTkcgYWRtaW4gcGFzc3dvcmQgd2FzIGNoYW5nZWQgaW4gdGhlIGFwcCAob3IgTUZBIGlzIG9uKTsgQklDSE9OX0FETUlOX1BBU1NXT1JEIG5vdCBhcHBsaWVkIgogICAgZmkKICBmaQogIGtpbGwgJHBpZDsgd2FpdCAkcGlkCmZpCmV4ZWMgJFNSVgo= | base64 -d > /tmp/boot.sh && exec sh /tmp/boot.sh"`
- **Health check:** /api/status
- **Public domain:** Yes

## Documentation

# Deploy and Host Bichon on Railway

[Bichon](https://github.com/rustmailer/bichon) is a lightweight email archiver written in Rust. It downloads your IMAP mailboxes (Gmail, Outlook, Fastmail, any IMAP server) into a private archive with full-text search, attachment browsing, contacts and dashboards in a web UI. It only reads and stores mail. It never sends, forwards or replies.

## About Hosting Bichon

Bichon is a single Rust server with an embedded search index and a compressed blob store, so it needs no database: one container and one volume. This template runs upstream's unmodified `rustmailer/bichon:2.2.0` image with your archive on a Railway volume.

Upstream seeds an admin login of `admin` / `admin@bichon` on first start. On a public URL that default is open to anyone until you change it. This template sets a generated password before the app ever accepts a connection from the internet, so your instance is never reachable with the default login.

## Common Use Cases

- Keep a searchable backup of Gmail, Outlook or a work mailbox before it hits a quota or a retention policy
- Archive several accounts in one place, including old ones you no longer log into
- Import historical mail from MBOX (Gmail Takeout), EML folders, Thunderbird profiles or Outlook PST files
- Give teammates read-only access to selected shared mailboxes with Bichon's roles and per-account permissions

## Dependencies for Bichon Hosting

- A Railway volume for the search index, mail blobs and metadata

### Deployment Dependencies

- Bichon source and docs: https://github.com/rustmailer/bichon
- An IMAP account with a password, an app password, or an OAuth2 app (Gmail and Outlook)

### Implementation Details

**Logging in.** The deploy form asks for nothing. When the deploy is up, open the `bichon` service's **Variables** tab, copy `BICHON_ADMIN_PASSWORD`, and log in at your public URL as `admin` with that password. The default `admin@bichon` password never works on this template.

**Changing the password.** Edit `BICHON_ADMIN_PASSWORD` and redeploy; the new value replaces the old one. Use 8 to 256 characters without quotes or backslashes. You can also change it in the app under Settings, Profile. If you do, the variable is no longer applied (the logs say `admin password was changed in the app`), so use the app from then on.

**Adding mailboxes.** Under Accounts, add an IMAP account. For Gmail and other providers with two-factor login, use an app password. OAuth2 for Gmail or Outlook needs your own OAuth app, configured under Settings, with the redirect URI `https://your.domain/oauth2/callback`. Downloads start right away and continue on a schedule; a large mailbox can take hours on the first pass.

**Variables**

| Variable | What it does |
| --- | --- |
| `BICHON_ADMIN_PASSWORD` | Admin password, generated per deploy. Edit and redeploy to change it |
| `BICHON_ENCRYPT_PASSWORD` | Encrypts stored IMAP passwords and OAuth tokens. Never change it, or saved accounts become unreadable |
| `BICHON_PUBLIC_URL` | Public origin, used for OAuth2 redirects. Change to `https://your.domain` after adding a custom domain |
| `BICHON_LOG_LEVEL` | `trace`, `debug`, `info`, `warn` or `error` |

Any other setting from the [upstream configuration table](https://github.com/rustmailer/bichon#configuration-reference), such as `BICHON_SYNC_CONCURRENCY` or `BICHON_CORS_ORIGINS`, can be added as a variable on the `bichon` service.

**Command-line import and export.** `bichon-cli` (MBOX, PST, Thunderbird import and MBOX export) talks to the server's API, so run it from your own machine against your Railway URL with an API token created in the web UI.

**Troubleshooting**

- *Logs say `Bichon refused BICHON_ADMIN_PASSWORD`*: the value broke Bichon's rules (8 to 256 characters). Set a new value and redeploy; the previous password keeps working until then.
- *Locked out after changing the password in the app*: run `bichon-admin` in the service shell (`railway ssh`) and pick Reset Admin Password. The root directory is `/data/bichon` and the encryption key is `BICHON_ENCRYPT_PASSWORD`.
- *OAuth2 redirect goes to the wrong host*: set `BICHON_PUBLIC_URL` to your current domain and redeploy.

**Scaling and storage.** Search speed and download throughput scale with CPU and memory; upstream recommends 2 GB of RAM for 10 or more accounts. The archive grows with your mail, so watch the volume size and grow it in the service settings. Keep one replica, because the volume belongs to one container.

## Why Deploy Bichon on Railway?

An email archive is only useful if it is always running and reachable from anywhere. Railway keeps Bichon online with HTTPS and a persistent volume, with nothing to operate, and your mail stays in storage you control instead of a third-party archiving service.


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

Open this page in a browser: https://railway.com/deploy/bichon-email-archiver
