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 →Free & open source · macOS & Linux
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/localimapCopy mail from
Using
Email providers delete inactive accounts, lock you out, and change their terms. A copy on your own disk can't be taken away.
Keep a complete, offline, searchable copy of Gmail, iCloud or Outlook mail that no provider can delete, lock or lose.
Back up Gmail locally →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 →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 →LocalIMAP is the destination. Your mail client does the copying, so it works with every provider, even those that need app passwords or OAuth.
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.
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.
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.
Standard IMAP4rev1 with IDLE push, MOVE, UIDPLUS, SPECIAL-USE and more. Apple Mail, Thunderbird, Outlook, mutt: if it speaks IMAP, it works.
Every message is a file in the open Maildir format. Read it with other tools, copy it anywhere, back it up with Time Machine.
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 keyboard-driven terminal UI to start and stop the server, add accounts, watch connections, change ports and make backups.
Back up any account to localimap-<account>-<timestamp>-back.zip with a progress bar, and restore it on any computer.
Keep "personal", "work" and "old-university" apart, each with its own login and folder tree.
A 5,000-message folder syncs its headers in about 25 ms. Copies thousands of messages per second. Tiny memory use.
Starts at login through launchd, systemd or brew services. Quitting the dashboard never stops your server.
Exports and "On My Mac" folders work, until you want to read, search or move that mail again.
| Feature | LocalIMAP | .mbox / .pst export | Mail app local folders | Cloud backup service |
|---|---|---|---|---|
| Readable in your mail client | yes | no: import first | only that app | usually web only |
| Keeps folders, flags and dates | yes | partly | yes | yes |
| Move it to a new provider later | drag & drop | import tools | hard | export first |
| Mail stays on your computer | yes | yes | yes | no |
| Open file format | Maildir | mbox / pst | proprietary | varies |
| Cost | free | free | free | monthly fee |
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.
# 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.zipmacOS (Apple Silicon or Intel) and Linux (x86_64 or ARM64). Version 0.1.0.
macOS and Linux. Updates with brew upgrade.
brew install nikitaycs50/localimap/localimap brew services start localimapDownload the archive for your platform, unpack it and put localimap on your PATH.
Needs Rust 1.80 or newer.
cargo install --git https://github.com/nikitaycs50/localimap$ 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 clientMake a complete, browsable offline copy of your Gmail or Google Workspace mailbox on your Mac or Linux PC, with labels, read state and dates intact.
Read the guide →Move years of email from Gmail, iCloud, Outlook, Yahoo or any IMAP provider to a new one, using a local staging server as a safety net.
Read the guide →Closing a work, school or old personal address? Keep every message readable in your mail client forever, as plain files you own.
Read the guide →Step-by-step settings for adding LocalIMAP to Apple Mail, Thunderbird, Outlook for Mac and any other IMAP mail client.
Read the guide →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.
Yes. LocalIMAP is free and open source under the MIT license. There is no account to create, no subscription and no telemetry.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Free, open source, and running on your computer in about a minute.
brew install nikitaycs50/localimap/localimap