Question

How to point my Next.js static page deployed on the App Platform to my root domain?

Hello,

I have deployed a static site on the App Platform and I have it’s provided link https://clownfish-something.ondigitalocean.app/ Also, I have added my domain to digital ocean. My question is - how do I point my root domain project.com to my deployed static site? I can not add A record because it needs an existing droplet or custom IP and I only have the provided link above or if I try to use it in the CNAME record, I can not leave the Hostname field empty so that it would target the root of my domain.

Thank you!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
July 5, 2024

Hey!

You would need to first start by going to https://cloud.digitalocean.com/apps, click on your app, and click on the Settings tab. Then, click the Edit link to the right of Domains, and the Add Domain button.

On the Add Domain form, enter your custom domain name at the top of the form in the text area under Domain or Subdomain Name, then click to proceed.

Next, you would have two options of doing this:

Using the DigitalOcean nameservers

If you decide to use DigitalOcean’s name servers, copy and paste DigitalOcean’s name servers (ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com) to your domain’s registrar name server records. See our Community tutorial on how to delegate your domain to DigitalOcean’s name servers from popular registrars.

DNS changes can take up to 72 hours to propagate across the internet. You can check the progress of the transfer in App Platform’s dashboard.

This should automatically configure the DNS for you so you don’t have to manually add any DNS records.

Using Cloudflare

Alternatively, for pointing your root domain to an App Platform app, you cannot use a CNAME record. Instead, you need to use an ALIAS or ANAME record, Cloudflare offers this type of DNS record.

What you could do in this case is to sign up for Cloudflare, add your domain name there, change your domain’s nameservers to the Cloudflare ones, and then in Cloudflare add the CNAME record for your main domain to point to the CNAME name provided by DigitalOcean.

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more