Bichon 2.2.0
Overview
Bichon is an open source email archiving server written in Rust. It connects to your mailboxes over IMAP (password or OAuth2 sign-in) and keeps a compressed copy of every message and attachment. Its web interface offers full-text search across subjects, bodies, participants and attachments, plus filters, conversation threads, contacts and a dashboard.
You can also import EML, MBOX, Thunderbird and PST files, export to MBOX, and restore messages back to an IMAP server. Bichon is an archiver, not a mail client, so it never sends mail. Several users can share one server, each with roles and per-account permissions.
This guide covers launching the Bichon 2.2.0 on Ubuntu 24.04 AMI from SecureAnyCloud on Amazon EC2. It is one version of the SecureAnyCloud file sharing and sync listing on AWS Marketplace. Pick it as the software version when you subscribe and launch.
What you get:
- HTTPS from the first boot. nginx serves Bichon on port 443 with a certificate generated on your instance's first boot. Port 80 redirects to HTTPS, and requests for a host name that the instance does not serve are dropped.
- No default password, ever. Upstream Bichon creates an administrator with a published default password the first time it starts. On this image, first boot starts Bichon on a private loopback port, changes that administrator's password to a random one unique to your instance, checks that the default no longer works, and only then publishes the site. The password is in
/root/bichon-credentials.txt(root only). - An encryption key unique to your instance. Bichon encrypts the IMAP passwords and OAuth tokens that it stores with a key generated at first boot (
/etc/bichon/encrypt.key). The image ships with no key, no database and no certificate. - Bichon stays on localhost. The server listens on 127.0.0.1:15630 only, as an unprivileged
bichonaccount that can write nothing but its own archive. It is blocked at the kernel level from reaching the EC2 instance metadata service. It keeps normal outbound access, because it has to reach your mail servers. - Hardened web front. nginx sets the client address itself (a forged
X-Forwarded-Forheader is ignored), strips cross-origin (CORS) headers, and keeps query strings, which can carry an API token, out of its access log. It also refuses cross-site requests to the two pages that make Bichon contact another server. - Fully patched Ubuntu 24.04 LTS at build time, with unattended security upgrades switched on.
- Bichon 2.2.0 (
bichon-server,bichon-cliandbichon-adminin/usr/local/bin, the official release binaries, AGPL-3.0, community edition), nginx, Ubuntu 24.04 LTS, cloud-init and the AWS Systems Manager agent. The license and the exact source link are in/usr/share/doc/sac/bichon/. - Default user
ubuntu, architecture x86_64, and recommended instance type m5.large.
Prerequisites
- An AWS account subscribed to the listing, an EC2 key pair, and a VPC subnet with a route to the internet. Bichon must reach your IMAP servers on port 993 or 143.
- A security group that allows TCP 22 (SSH), TCP 443 (the web interface) and TCP 80 (redirects to HTTPS) from your own networks only.
Launch the instance
In the AWS Marketplace listing, choose Continue to Subscribe, then Continue to Configuration. Pick Bichon 2.2.0 on Ubuntu 24.04 as the software version, choose your Region, and select Launch through EC2.
Choose m5.large, your key pair, a security group as described above, and a subnet. The AMI comes with an 8 GiB root volume, and the archive lives on it (/var/lib/bichon). Raise the root volume under Configure storage to fit the mail you plan to keep. As a rough guide, allow the size of the mailboxes you archive plus a third for the search index.
To launch with the AWS CLI instead, replace the values in angle brackets. This command sets the root volume to 100 GiB:
aws ec2 run-instances --region <region> --image-id <ami-id-from-the-listing> \
--instance-type m5.large --key-name <your-key-pair> \
--security-group-ids <your-security-group> --subnet-id <your-subnet> \
--metadata-options HttpTokens=required,HttpEndpoint=enabled \
--block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=100,VolumeType=gp3}' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=bichon}]'Connect to your instance
Version SSH user
Bichon 2.2.0 on Ubuntu 24.04 ubuntu
ssh -i <your-key.pem> ubuntu@<public-ip>Check the services
First boot generates the certificate, the encryption key and the administrator password, then publishes the site. It takes about ten seconds. Confirm that the services are active:
systemctl is-active bichon-firstboot bichon nginxactive active activeOnly SSH (22) and nginx (80, 443) listen on the network. Bichon (15630) listens on loopback, and the two port 53 listeners are Ubuntu's local DNS resolver. Verify the listeners:
sudo ss -lntp | awk 'NR>1 {print $4}' | sort -u0.0.0.0:22 0.0.0.0:443 0.0.0.0:80 127.0.0.1:15630 127.0.0.53%lo:53 127.0.0.54:53 [::]:22 [::]:443 [::]:80Query the status endpoint to read the Bichon version:
curl -sk https://127.0.0.1/api/status | python3 -c 'import json,sys; print(json.load(sys.stdin)["version"])'2.2.0If nginx serves nothing, first boot has not finished, or it failed, in which case the site is never published. Check systemctl status bichon-firstboot and journalctl -u bichon-firstboot.
Get your URL and password
Read the credentials file:
sudo cat /root/bichon-credentials.txtThe file is readable by root only. It holds the address and this instance's administrator sign-in:
# Bichon on Ubuntu 24.04 (sac AWS Marketplace image) - this instance's administrator sign-in. # Generated on this instance at first boot; unique to it and not known to sac or the Bichon project. ... BICHON_URL=https://ec2-203-0-113-10.compute-1.amazonaws.com/ bichon.admin.username=admin bichon.admin.password=<BICHON_ADMIN_PASSWORD>Confirm the sign-in from the instance itself. The helper signs in through nginx, checks that a wrong password and the upstream default are refused, and prints BICHON_ROUNDTRIP_OK:
sudo /usr/local/sbin/bichon-verify.sh | tail -1BICHON_ROUNDTRIP_OKSign in
Open the BICHON_URL address in your browser. The certificate is self-signed until you install your own (Step 9), so the browser asks you to accept it once. Sign in as admin with the password from Step 4.
Once mail arrives, the dashboard shows your accounts, message and attachment counts, storage use and the busiest senders.
Change the administrator password now. Open Settings, then Profile, and set a password of your own. The password in /root/bichon-credentials.txt stops working after that, so delete the file once you have stored the new password safely.
Bichon limits sign-in attempts per client address. After 10 attempts, it accepts one more every 10 minutes and answers "Too many login attempts" in between. If you lock yourself out while testing, wait, or sign in from another address.
Archive a mailbox
Open Accounts in the left bar and choose IMAP account.
Enter the email address. Bichon looks up the IMAP server settings for well-known providers automatically, such as Gmail and Outlook. Then choose the sign-in method:
- Password. Enter your IMAP password, or an app password where the provider requires one (Gmail and iCloud with two-step verification, for example).
- OAuth2. First create an OAuth2 configuration in Bichon, with the client ID from your Google Cloud or Microsoft Entra application. Register
https://<your-host>/oauth2/callbackas its redirect address. The host is theBICHON_URLname, so set your own name first (Step 9) if you want a stable address.
Pick the folders to archive and save. Bichon downloads the existing mail in the background and then keeps fetching new messages. Progress shows on the account and on the dashboard.
Local accounts hold mail that you import from files instead of from a server. Use Import to load EML, MBOX, Thunderbird or PST files from your computer, up to about 2 GB per upload through the browser.
Search your archive
Open Search to find messages by text, sender, recipient, date, folder, tag or attachment. Open a message to read it with its attachments, or download the original .eml. Use Export to produce MBOX files, and Restore to copy messages back to an IMAP account.
For scripts and integrations, create an API token in Bichon and call the REST API with Authorization: Bearer <token>. The interactive API reference is at https://<your-host>/api-docs/scalar.
Add users
Open Users (the people icon in the left bar) to create accounts for colleagues. Bichon has built-in roles and per-mail-account access, so you decide who can see which archives. Each user signs in with the password you set and can change it under Profile.
Use your own host name and certificate
Point a DNS record at the instance. An Elastic IP keeps the address across stop and start. Then tell the instance its name:
sudo bichon-set-hostname archive.example.comThis command mints a new self-signed certificate for that name. It also updates the nginx host rule, the cross-site guard, Bichon's public address (used for OAuth2 redirects) and the address in the credentials file, and it keeps the name across reboots.
To use a certificate from a public authority instead, replace /etc/ssl/bichon/bichon.crt (full chain) and /etc/ssl/bichon/bichon.key (mode 0600, owned by root) with your own, and run sudo systemctl reload nginx. Running bichon-set-hostname again later replaces them with a new self-signed pair.
Check persistence and updates
Every service is enabled, so Bichon returns after a reboot or a stop and start, and carries on downloading where it left off. If the public address changes, the next boot re-issues the certificate and the address for the new name, unless you set your own name in Step 9. Unattended security upgrades keep the operating system and nginx patched. Confirm that the services are enabled:
systemctl is-enabled bichon bichon-set-host nginx unattended-upgradesenabled enabled enabled enabledBichon itself is the official release from the project. To move to a newer release later, follow these steps:
- Read the release notes first, because a new release may migrate the archive format.
- Download
bichon-server-<version>-x86_64-unknown-linux-gnu.tar.gzfrom the Bichon releases page and check it against the release'sSHA256SUMS.txt. - Back up first (Step 11).
- Replace the three files in
/usr/local/binand runsudo systemctl restart bichon.
Back up your archive
Everything Bichon keeps is under /var/lib/bichon (metadata, search index and the compressed mail store). Back up /etc/bichon/encrypt.key with it. Without that key, the stored IMAP passwords and OAuth tokens cannot be decrypted. An EBS snapshot of the root volume (or AWS Backup on the instance) captures both. For a file-level copy, stop Bichon briefly:
sudo systemctl stop bichon
sudo tar czf bichon-backup.tar.gz -C / var/lib/bichon etc/bichon/encrypt.key
sudo systemctl start bichonBichon also has its own backup and restore to S3-compatible storage or a local directory, described in the Bichon documentation.
Security notes
- No shared secret ships in the image. No password, database, encryption key or TLS key exists until your instance's first boot generates them. The site is not published until the upstream default administrator password has been replaced and proven dead.
- Fail closed. If first boot cannot complete, nothing is published. nginx has nothing to serve, and Bichon does not start.
- Bichon is confined. It listens on 127.0.0.1 only and runs as an unprivileged account that can write only
/var/lib/bichon. It holds no Linux capabilities, writes no core dumps, and cannot read the TLS key or root's files. It is blocked from the EC2 instance metadata service, as are nginx and the first-boot service. - Cross-site requests are refused for the two pages that make Bichon contact another server (the mail server autoconfiguration lookup and a live mailbox listing), so another website cannot make your browser trigger them. Bichon signs requests with a token rather than a cookie, so other pages cannot act as you either.
- Third-party library advisories. Bichon 2.2.0 bundles rustls 0.23.45 and webpki-roots 1.0.9, which have low and medium severity advisories (RUSTSEC-2026-0346 to 0349, and the emSign root distrust RUSTSEC-2026-0381 to 0383) affecting outbound TLS to your mail servers. No newer Bichon release exists yet, and SecureAnyCloud will publish an updated version when one does. The bundled quick-xml, zip and zstd advisories concern code paths that Bichon does not use.
- Restrict 22/tcp to your management network, and ports 80 and 443 to the networks that use the archive.
Architecture summary
Component Detail
Archiver Bichon 2.2.0 (AGPL-3.0, community edition), bichon.service, 127.0.0.1:15630, account bichon
Web server nginx on 443 (HTTPS, per instance certificate in /etc/ssl/bichon), 80 redirects to HTTPS
Archive /var/lib/bichon (metadata, Tantivy search index, compressed mail store), owner bichon
Encryption key /etc/bichon/encrypt.key, generated at first boot, readable by bichon only
Configuration /etc/bichon/bichon.env (port, bind address, public URL)
Credentials /root/bichon-credentials.txt, mode 0600, root only
First boot bichon-firstboot.service; host name and certificate bichon-set-host.service (every boot)
Tools bichon-cli, bichon-admin, bichon-set-hostname, bichon-verify.sh
Ports 22 SSH, 80 redirect, 443 web interface and REST API
Base image Ubuntu 24.04 LTS, fully patched, unattended security upgrades enabled, IMDSv2 required
Support
SecureAnyCloud images come with 24/7 support. Email sales@secureanycloud.com with your AWS account ID and the instance ID. For questions about Bichon itself, see the Bichon project on GitHub.
Bichon is an open source project of rustmailer. SecureAnyCloud is not affiliated with or endorsed by the Bichon project or rustmailer.
Deploy on AWS
Launch Bichon 2.2.0 on Ubuntu 24.04 on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com