DEV Community

JOHN MWACHARO
JOHN MWACHARO

Posted on

How to Host Your Website on DigitalOcean and Use Google Workspace for Email

Description:
Learn how to host your website on DigitalOcean while using Google Workspace for professional email. Step-by-step guide for startups and businesses that want reliable hosting and secure email.

Why Choose DigitalOcean and Google Workspace?

For growing businesses and startups, having a reliable website and professional email is crucial. DigitalOcean hosting offers fast, affordable cloud servers, while Google Workspace email setup gives you the power of Gmail with your own domain (e.g., hello@mygreatstartup.com).

By combining the two, you get:

A scalable website hosted on DigitalOcean.

A trusted email solution via Google Workspace.

Improved deliverability with SPF, DKIM, and DMARC.

Step 1: Point Your Domain to DigitalOcean

After creating your droplet (server) in DigitalOcean, connect your domain (e.g., mygreatstartup.com).

Log into your registrar (GoDaddy, Namecheap, or others).

Update the nameservers:

ns1.digitalocean.com

ns2.digitalocean.com

ns3.digitalocean.com

In DigitalOcean → Networking → Domains:

Add an A record: @ → your droplet’s IP.

Add a CNAME record: www → @.

✅ Your website will now load from DigitalOcean hosting.

Step 2: Add Google Workspace MX Records

To use Gmail with your custom domain, add Google Workspace MX records in your DNS:

Host Type Priority Value
@ MX 1 ASPMX.L.GOOGLE.COM.
@ MX 5 ALT1.ASPMX.L.GOOGLE.COM.
@ MX 5 ALT2.ASPMX.L.GOOGLE.COM.
@ MX 10 ALT3.ASPMX.L.GOOGLE.COM.
@ MX 10 ALT4.ASPMX.L.GOOGLE.COM.

📧 Now emails like info@mygreatstartup.com will route directly to Gmail.

Step 3: Secure Your Email with SPF, DKIM, and DMARC

To prevent emails from being marked as spam, configure these authentication methods:

SPF Record (TXT):

@ TXT "v=spf1 include:_spf.google.com ~all"

DKIM Record:
Generated in Google Admin Console → Gmail → Authenticate Email. Add the TXT record to DNS.

DMARC Record (TXT):

_dmarc TXT "v=DMARC1; p=quarantine; rua=mailto:admin@mygreatstartup.com"

🔒 These records confirm your emails are safe and trusted.

Step 4: Verify Your Domain in Google Workspace

Google will ask you to prove ownership of your domain.

Add the TXT record provided (something like google-site-verification=xxxx).

Confirm in the Google Admin Console.

Step 5: Test Your Setup

Visit mygreatstartup.com → it should display your website hosted on DigitalOcean.

Send and receive emails from you@mygreatstartup.com using Gmail.

Use MXToolbox
to check MX, SPF, DKIM, and DMARC records.

Final Thoughts

Setting up DigitalOcean hosting with Google Workspace email is one of the best business email configurations you can make.

Your website stays fast, reliable, and scalable.

Your email looks professional (no more @gmail.com for business!).

Your messages are authenticated to avoid spam filters.

Whether you’re launching a startup or upgrading your company’s digital presence, this setup gives you the best of both worlds: powerful cloud hosting + professional business email.

👉 Ready to scale? Start with DigitalOcean hosting and secure your communication with Google Workspace email today.

Top comments (0)