Skip to content
Ditchly
Menu

Last checked November 30, 2026

mailcow migration from Gmail

We earn commissions when you shop through the links below.

mailcow migration from Gmail uses imapsync. Labels, filters, Drive, and Calendar stay behind. Set up mailcow and test one mailbox before you change MX.

How long: A weekend for one domain if Docker and DNS are familiar. Longer if outbound mail is new to you.

Take it out

  1. Step 1

    Turn IMAP on and keep a second copy

    In Gmail, open Settings, then See all settings, then Forwarding and POP/IMAP, and enable IMAP. Google Takeout can export the mailbox as a second copy. Keep that export until you have read the new inbox. Do not delete the Google account on day one.

  2. Step 2

    Write down filters, send-as addresses, and aliases

    Filters, send-as addresses, and forwarding rules are not part of the IMAP copy. Screenshot the list before you change DNS. Gmail labels and the Primary and Social tabs will not become mailcow folders.

  3. Step 3

    Decide what stays in Google

    Drive, Docs, and Meet are not this move. SOGo, which ships with mailcow, has mail, calendars, and contacts. Export a calendar you still need before you treat the Google account as read-only.

Put it in

  1. Step 1

    Install mailcow and create one mailbox

    Follow the current install for mailcow: dockerized on a Linux host you control. Set the hostname, create the domain, and create the mailbox. Confirm you can send and receive on a test address before the real domain's MX changes. https://docs.mailcow.email/

  2. Step 2

    Add a Gmail sync source

    mailcow copies mail with imapsync. In the admin UI open E-Mail Configuration, then Sync jobs, and add a source. The Gmail preset fills the server. Many Gmail accounts need an app password, which means IMAP is on and the Google account can create one. An admin can instead use the Google OAuth2 preset. The steps are on mailcow's sync-job page. https://docs.mailcow.email/post_installation/firststeps-sync_jobs_migration/

  3. Step 3

    Run the job twice, then move MX

    Create the sync job into the new mailbox, leave it active, and read the result in SOGo. Run it again just before the DNS cut so mail that arrived during the rehearsal is included. Change MX, SPF, DKIM, and DMARC only after that second look. mailcow generates the DKIM key. New mail then arrives on your server.

Need a server? DigitalOcean is one simple option. Railway is another.

We are a DigitalOcean affiliate.

We may earn from this Railway link.

What you lose

  • Labels, filters, and the tabs

    Expect IMAP folders and a Junk folder, not the Gmail sidebar. Rspamd handles spam and can learn when you move mail into or out of Junk. It will not copy Gmail's category tabs.

  • Drive, Calendar, and the phone apps

    Those stay in Google. Phones use IMAP or ActiveSync against mailcow. There is no Gmail app pointed at this server. Workspace Business Starter is $7 USD per user a month on the annual plan, or $8.40 on the flexible plan, as of November 30, 2026. https://support.google.com/a/answer/1247360?hl=en

  • Who should not switch

    Stay on Gmail if you still need Drive, Docs, and Meet as one login, or if nobody can run Docker and watch DNS. A new server has no reputation. Some mail will land in other people's spam until SPF, DKIM, and DMARC are in place. Leave Gmail up, and run the sync once more, for a couple of weeks.

A mailcow migration is a mailbox copy plus a DNS cut. It is not a copy of a Google account. Read the test mailbox before you change MX.

https://ditchly.co/migrate/gmail-to-mailcow