Custom Domain

Serve your docs from your own domain instead of the default DocStar link. A custom domain gives readers a branded, trusted URL, keeps your docs consistent with your website, and is required for search engines to index your docs.

#

Choose a method

You want Example Method
Docs on a subdomain docs.yourdomain.com CNAME
Docs under a path on your main site yourdomain.com/help Cloudflare Worker (your domain must use Cloudflare)
#

Key rules

The Domain tab checks these rules when you click Save:

  • Domain Name is only the domain, such as docs.yourdomain.com. Don't include a path like yourdomain.com/api.
  • Path starts with / and is one segment, such as /help, /docs or /api. Don't write the full domain, and don't use nested paths like /api/help.
  • You can't set a path without a domain.
  • You can't combine a subdomain with a path. api.yourdomain.com + /doc is not allowed. Use a subdomain alone, or your main domain with a path.
  • You can't use docstar.io or any of its subdomains.
#

Method 1: CNAME (subdomain)

Step 1: Add the domain in DocStar

  1. Open the collection and click Settings in the left sidebar.
  2. Open the Domain tab.
  3. In Domain Name, enter your full subdomain, for example help.yourdomain.com.
  4. Leave Path empty.
  5. Click Save.

Step 2: Add a CNAME record at your DNS provider

Create a new DNS record. In Cloudflare, go to DNS > Records > Add record.

Type Name Target
CNAME help (your subdomain) cname.docstar.io

Add record.webp

DNS changes can take a few minutes to a few hours to take effect. Then open https://help.yourdomain.com to check.

#

Method 2: Cloudflare Worker (path)

Step 1: Add the domain and path in DocStar

  1. Go to Settings > Domain.
  2. In Domain Name, enter your main domain, for example yourdomain.com.
  3. In Path, enter the path, for example /help.
  4. Click Save.

Step 2: Copy the Worker code

Once both fields are filled in, the tab shows "Click here to get the cloudflare Worker code". Click View Code, then copy the code from Code Preview. Your domain, path and collection ID are already filled in.

Step 3: Create the Worker in Cloudflare

  1. In Cloudflare, go to Workers & Pages > Create application and create a new Worker.
  2. Open the Worker and click Quick Edit (or Edit code).
  3. Replace the default code with the code you copied from DocStar.
  4. Click Deploy.

editWorkerCode.png

Step 4: Add a Worker route

  1. Go to Workers & Pages > Worker Routes for your domain and add a route.
  2. Enter your path pattern, for example yourdomain.com/help*.
  3. Select the Worker you created and save.

worker.png

Open https://yourdomain.com/help to check.

#

After setup

  • The live URL in Settings > Publish Collection switches to your domain.
  • Your docs no longer show the default DocStar URL.
  • Search engines can index your docs. On a CNAME subdomain, sitemap.xml, robots.txt and llms.txt are served at the domain root. See SEO, Sitemap and llms.txt.
  • The collection must be published for the domain to show your docs. See Publish Pages.

To stop using the domain, clear Domain Name and Path and click Save, then remove the DNS record or Worker route.