Free & open source · macOS & Linux

Your own IMAP server, right on your computer.

Back up and migrate email by dragging folders in the mail client you already use. Gmail, iCloud, Outlook or any other provider: your mail ends up as plain files on your disk, and never touches anyone else's cloud.

brew install nikitaycs50/localimap/localimap
  • MIT licensed
  • Written in Rust
  • No account, no cloud
  • Maildir files you own

Copy mail from

  • Gmail
  • Google Workspace
  • iCloud Mail
  • Outlook.com
  • Microsoft 365
  • Yahoo Mail
  • Fastmail
  • Any IMAP

Using

  • Apple Mail
  • Thunderbird
  • Outlook for Mac
  • Evolution
  • Mailspring
  • mutt

One small server, three big jobs

Email providers delete inactive accounts, lock you out, and change their terms. A copy on your own disk can't be taken away.

Back up your email

Keep a complete, offline, searchable copy of Gmail, iCloud or Outlook mail that no provider can delete, lock or lose.

Back up Gmail locally →

Migrate between providers

Use LocalIMAP as a staging area: copy everything off the old provider first, then onto the new one, with a safety net in between.

Migrate your email →

Archive old accounts

Leaving a job, school or an old address? Keep every message readable in your mail client forever, long after the account is gone.

Archive an old account →

How it works

LocalIMAP is the destination. Your mail client does the copying, so it works with every provider, even those that need app passwords or OAuth.

  1. 1

    Install and start LocalIMAP

    One Homebrew command. Open the dashboard with "localimap", press a to create an account and s to start the server. It keeps running in the background, and can start at login.

  2. 2

    Add it to your mail client

    Add a new IMAP account in Apple Mail, Thunderbird or Outlook: server 127.0.0.1, port 1143, your LocalIMAP user name and password. Press 7 in the dashboard for exact click-by-click steps.

  3. 3

    Drag folders into it

    Drag folders from Gmail, iCloud, Outlook.com or any other account onto LocalIMAP in the sidebar. Subfolders, read and flagged state and dates come along. Done: your mail now lives on your computer.

Everything a mail archive needs. Nothing it doesn't.

Works with any mail client

Standard IMAP4rev1 with IDLE push, MOVE, UIDPLUS, SPECIAL-USE and more. Apple Mail, Thunderbird, Outlook, mutt: if it speaks IMAP, it works.

Plain files, no lock-in

Every message is a file in the open Maildir format. Read it with other tools, copy it anywhere, back it up with Time Machine.

Private by default

Listens on 127.0.0.1 only. No cloud, no account, no telemetry. Optional TLS when you want to reach it from your network.

A dashboard you will enjoy

A keyboard-driven terminal UI to start and stop the server, add accounts, watch connections, change ports and make backups.

One-key ZIP backups

Back up any account to localimap-<account>-<timestamp>-back.zip with a progress bar, and restore it on any computer.

Multiple accounts

Keep "personal", "work" and "old-university" apart, each with its own login and folder tree.

Fast, written in Rust

A 5,000-message folder syncs its headers in about 25 ms. Copies thousands of messages per second. Tiny memory use.

Runs in the background

Starts at login through launchd, systemd or brew services. Quitting the dashboard never stops your server.

LocalIMAP vs. other ways to keep your mail

Exports and "On My Mac" folders work, until you want to read, search or move that mail again.

FeatureLocalIMAP.mbox / .pst exportMail app local foldersCloud backup service
Readable in your mail clientyesno: import firstonly that appusually web only
Keeps folders, flags and datesyespartlyyesyes
Move it to a new provider laterdrag & dropimport toolshardexport first
Mail stays on your computeryesyesyesno
Open file formatMaildirmbox / pstproprietaryvaries
Costfreefreefreemonthly fee

Backups of your backup, in one key

LocalIMAP writes one ZIP archive per account, with a live progress bar, message count and time remaining. Archives contain standard Maildir files plus a manifest with folders, flags and dates, so they stay readable without LocalIMAP.

  • Press b on the dashboard, or run one command
  • Restore on the same or another computer
  • Restores skip messages that already exist, so they're safe to repeat
  • Schedule it with cron or launchd for nightly backups
# back up every account
$ localimap backup
  ███████████████████████░░░░░░░  78%  37604/48213 msgs  4.8 GB/6.2 GB  Archive/2019

# the result
~/LocalIMAP Backups/localimap-personal-20261202093015-back.zip

# restore anywhere
$ localimap restore localimap-personal-20261202093015-back.zip

Install in a minute

macOS (Apple Silicon or Intel) and Linux (x86_64 or ARM64). Version 0.1.0.

Homebrew recommended

macOS and Linux. Updates with brew upgrade.

brew install nikitaycs50/localimap/localimap
brew services start localimap

From source

Needs Rust 1.80 or newer.

cargo install --git https://github.com/nikitaycs50/localimap

Then

$ localimap                     # open the dashboard: a = add account, s = start, 7 = setup guide
$ localimap account add personal  # or do it from the command line
$ localimap start
$ localimap setup personal        # prints the settings for your mail client

Frequently asked questions

What is LocalIMAP?

LocalIMAP is a small IMAP mail server that runs on your own Mac or Linux computer. You add it to Apple Mail, Thunderbird, Outlook or any other mail client like a normal email account, then drag folders from Gmail, iCloud, Outlook.com or any other provider into it to keep a complete offline copy or to stage a migration.

Is LocalIMAP free?

Yes. LocalIMAP is free and open source under the MIT license. There is no account to create, no subscription and no telemetry.

Does LocalIMAP download my mail from Gmail or iCloud by itself?

No. Your mail client does the copying when you drag folders into the LocalIMAP account. That works with every provider, including ones that require app passwords or OAuth sign-in, and LocalIMAP never needs your provider password.

Which email providers can I back up or migrate?

Any account your mail client can open: Gmail and Google Workspace, iCloud Mail, Outlook.com, Microsoft 365 and Exchange, Yahoo Mail, Fastmail, Zoho, GMX, Proton Mail through Proton Mail Bridge, and any standard IMAP server.

Which mail clients work with LocalIMAP?

Any IMAP mail client. Step-by-step instructions are included for Apple Mail, Thunderbird and Outlook for Mac; Evolution, Mailspring, Spark, mutt and others work with the same settings: server 127.0.0.1, port 1143, normal password.

Does my mail leave my computer?

No. By default LocalIMAP only listens on 127.0.0.1, so it is not reachable from the network, and its SMTP server is a sink that never relays mail to the internet. You can optionally open it to your local network with TLS encryption, for example to reach it from a phone.

How is my mail stored?

Every message is a plain file in the standard Maildir format, one folder per mailbox, with a small SQLite index for speed. You can read the files with other tools, back them up with Time Machine, and the index can be rebuilt at any time.

How do I back up LocalIMAP itself?

Run "localimap backup" or press Enter on the Backup tab of the dashboard. LocalIMAP writes one ZIP archive per account named localimap-<account>-YYYYMMDDHHMMSS-back.zip and shows a progress bar. "localimap restore" brings an archive back on any computer and skips messages that already exist.

How is this different from exporting mailboxes to .mbox or .pst files?

An export is a one-time snapshot that you have to import again before you can read it, and it is tied to the program that made it. LocalIMAP keeps your folders live in your mail client: you can browse, search and reply from them, add more mail at any time, and move them to another provider later.

Does LocalIMAP run on Windows?

Not yet. LocalIMAP runs on macOS (Apple Silicon and Intel) and Linux (x86_64 and ARM64). It is written in portable Rust, and Windows support is planned.

Is there a size limit?

Only your disk space. LocalIMAP handles folders with tens of thousands of messages and large attachments; the largest single message it accepts is configurable and defaults to 200 MB.

Another question? Get in touch or open an issue on GitHub.

Own your email archive.

Free, open source, and running on your computer in about a minute.

brew install nikitaycs50/localimap/localimap