Gmail account with custom domain using Cloudflare and Mailgun (free)

Noval Agung Prayogo
4 min readMar 8
Photo by Faizur Rehman on Unsplash

Having an email with is important to level up your brand. You can use a paid service such as Google Workspace to achieve that. There is also another alternative solution, a free one, and I’ll talk about it here.

In this post, I’ll share my experience configuring a personal Gmail account, to make it able to receive and reply to any emails like usual, but using a custom domain.

And it costs $0, great right?!

Handling inbound mail

Say that my domain is managed via Cloudflare, and I use their email routing feature to re-route any incoming email that was originally directed to, to

Btw, if you are using another domain provider, you can follow Jeremy Gale’s guide in the following link:

To enable the mail routing, navigate to your Cloudflare domain page, go to EmailEmail Routing, then toggle on the functionality.

Next, create your desired custom email address (in this post I’ll be using, select Send to an email as the action, and set as the destination.

Cloudflare Email Routing

Thats it! now test it by sending one or two mail(s) to Cloudflare shall handle the rerouting process and eventually, you will receive it at

Ok, let's move forward to the next step, which is configuring the outbound.

Handling outbound mail

At this point, even though you are able to retrieve any emails through on your, you will not be able to reply to them using the custom domain email.

Noval Agung Prayogo

💻 CTO @ KangarooHealth (Stanford StartX) / ⚒️ Top 3% StackOverflow user / 🎓 Udemy instructor, FOSS contributor