Bring Fern Docs to your custom domain.
You can use:
- A custom domain, such as
example.com
- A subdomain on your custom domain, such as
docs.example.com
- A subpath on your custom domain, such as
example.com/docs
Steps
Step 1: Open docs.yml
Open the docs.yml
file, which lives in the fern/
folder of your Fern Docs repository.
No Fern Docs repository yet? Use our Fern Docs Quickstart with OpenAPI or Fern Docs Quickstart with Fern Definition to set up your starter site, then return to this page.
Step 2: Configure the url
The subdomain of the url
under instances
must match your custom domain. If you want to use a custom domain of example.com
, the subdomain must be example
, as shown below:
Leave the .docs.buildwithfern.com
part of the url
unchanged.
If you intend to use a subpath with your custom domain, such as example.com/docs
, append that subpath to the end of the url
:
Step 3: Configure the custom-domain
Below the url
, add a custom-domain
key as shown in the examples below.
docs
for the subdomain and subpath specified in custom-domain
, but you can use any word you like, such as reference
or learn
.Step 4: Update the Fern Docs site
If you created your Fern Docs site using one of our Docs Quickstarts, push the changes you made to your GitHub repository. This runs a GitHub Action to update the site with your new configuration.
If you need to update your Fern Docs site manually, run fern generate --docs
.
Step 5: Create DNS records to point at Fern Docs
This feature is available on the Fern Docs Starter plan and above. Reach out to sales@buildwithfern.com to set up your subscription and obtain DNS records information for your domain registrar.