You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/docs/pages/getting-started/setting-up-your-domain.mdx
+70-47Lines changed: 70 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,10 @@ title: Bring your custom domain
3
3
description: Learn how to set up your Fern-generated documentation site to use a custom subdomain or subpath.
4
4
---
5
5
6
-
Bring Fern Docs to your custom domain.
7
-
8
-
You can use:
9
-
- A subdomain on your custom domain, such as `docs.example.com`
10
-
- A subpath on your custom domain, such as `example.com/docs`
11
-
- A root domain, such as `example.com`
6
+
Bring Fern Docs to your custom domain. You can use:
7
+
- A subdomain on your custom domain, such as `docs.mydomain.com`
8
+
- A subpath on your custom domain, such as `mydomain.com/docs`
9
+
- A root domain, such as `mydomain.com`
12
10
13
11
<Info>
14
12
Once you've set up your domain, use the [Fern Dashboard](https://dashboard.buildwithfern.com/) to manage site settings.
@@ -17,60 +15,70 @@ You can use:
17
15
<AccordionGroup>
18
16
<Accordiontitle="Subdomain">
19
17
20
-
To host your documentation on a subdomain, i.e.`docs.mydomain.com`, you need to create a CNAME record in your DNS settings.
18
+
To host your documentation on a subdomain like`docs.mydomain.com`, you need to create a CNAME record in your DNS settings.
21
19
22
20
<Steps>
23
21
24
22
### Update the domain in `docs.yml`
25
23
26
-
```yaml
24
+
Add your `custom-domain` and merge your changes into `main`. [Here's an example](https://github.com/octoml/fern-config/blob/389b67679953856ba0716537981a6d749635556f/fern/docs.yml#L1-L3).
25
+
26
+
```yaml docs.yml
27
27
instances:
28
28
- url: example.docs.buildwithfern.com
29
29
custom-domain: docs.mydomain.com
30
30
```
31
31
32
-
Merge your changes into `main`. [Here's an example](https://github.com/octoml/fern-config/blob/389b67679953856ba0716537981a6d749635556f/fern/docs.yml#L1-L3 ).
32
+
### Contact Fern
33
33
34
+
Contact Fern via your dedicated Slack channel or [email](mailto:[email protected]) to receive:
35
+
- A unique CNAME value for your site
36
+
- A TXT record to verify your domain
34
37
35
-
### Create a CNAME record
38
+
### Create DNS records
36
39
37
-
1. Log in to your domain registrar's dashboard.
38
-
2. Navigate to the DNS settings for your domain.
39
-
3. Add a new CNAME record with the following details:
40
-
- **Type**: `CNAME`
41
-
- **Name**: `docs` (or any subdomain you want to use)
42
-
- **Value**: `cname.vercel-dns.com.`
43
-
44
-
<Warning title="Cloudflare Users">
45
-
If you are using Cloudflare, you should ensure the record is not proxied.
46
-
</Warning>
40
+
Log in to your domain registrar's dashboard and navigate to the DNS settings for your domain. Add the following records:
47
41
48
-
### Reach out to us
42
+
<CodeBlock title="CNAME Record (Subdomain)">
43
+
```
44
+
Type Name Value
45
+
CNAME docs [unique CNAME value provided by Fern]
46
+
```
47
+
</CodeBlock>
48
+
49
+
<CodeBlocktitle="TXT Record (Domain Verification)">
50
+
```
51
+
Type Name Value
52
+
TXT @ [TXT record value provided by Fern]
53
+
```
54
+
</CodeBlock>
49
55
50
-
Once you've completed the steps above, reach out via your dedicated Slack channel or [email](mailto:[email protected]).
56
+
Replace `docs` with any subdomain you want to use.
51
57
52
-
You may need to create a TXT record to verify your domain. If you do, we'll provide you with the record to add.
58
+
<Warningtitle="Cloudflare users">
59
+
If you are using Cloudflare, you should ensure the record isn't proxied.
60
+
</Warning>
53
61
54
62
### Verify the setup
55
63
56
-
Once we've completed the setup on our end, you should be able to access your documentation at `docs.mydomain.com`. SSL will be automatically provisioned for your domain, but it may take a few minutes to propagate globally.
64
+
Once Fern has completed your setup, you'll be able to access your documentation at `docs.mydomain.com`. SSL will be automatically provisioned for your domain, but it may take a few minutes to propagate globally.
57
65
58
-
<Tip>It's helpful to check that you can access your new docs site from a mobile device or incognito browser.</Tip>
66
+
<Tip>Check that you can access your new docs site from a mobile device or incognito browser.</Tip>
59
67
60
68
</Steps>
61
69
</Accordion>
62
70
63
71
<Accordiontitle="Subpath">
64
72
65
-
To host your documentation on a subpath, i.e. `mydomain.com/docs`, you need to edit your `docs.yml` configuration and then get provider-specific instructions for setting up the subpath. Common providers include Cloudflare, AWS Route53 and Cloudfront, Netlify, and Vercel.
73
+
To host your documentation on a subpath like`mydomain.com/docs`, you need to edit your `docs.yml` configuration and then get provider-specific instructions for setting up the subpath. Common providers include Cloudflare, AWS Route53 and Cloudfront, Netlify, and Vercel.
66
74
67
75
<Steps>
68
76
69
77
### Configure the `url` in `docs.yml`
70
78
71
79
Append that subpath to the end of the `url`. This example use `docs` for the subpath, but you can use any word you like, such as `reference` or `developer`.
72
80
73
-
<CodeBlock title="docs.yml example for subpath">
81
+
<CodeBlocktitle="docs.yml">
74
82
```yaml
75
83
instances:
76
84
- url: example.docs.buildwithfern.com/docs
@@ -79,74 +87,89 @@ instances:
79
87
80
88
### Configure the `custom-domain`
81
89
82
-
Below the `url`, add a `custom-domain` key as shown in the examples below.
90
+
Below the `url`, add a `custom-domain` key:
83
91
84
-
<CodeBlock title="Custom subpath">
85
-
```yaml
86
-
instances:
92
+
<CodeBlock title="docs.yml">
93
+
```yaml
94
+
instances:
87
95
- url: example.docs.buildwithfern.com/docs
88
-
custom-domain: example.com/docs
96
+
custom-domain: mydomain.com/docs
89
97
```
90
98
</CodeBlock>
91
99
92
100
[Here's an example.](https://github.com/fern-api/fern/blob/7d8631c6119787a8aaccb4ba49837e73c985db28/fern/docs.yml#L1-L3)
93
101
94
-
### Update the Fern Docs site
102
+
### Contact Fern
95
103
96
-
If you created your Fern Docs site using one of our [Docs Quickstarts](/learn/docs/getting-started/quickstart), push the changes you made to your GitHub repository. This runs a GitHub Action to update the site with your new configuration.
104
+
Contact Fern via your dedicated Slack channel or [email](mailto:[email protected]) to set up your custom subpath.
97
105
98
-
If you need to update your Fern Docs site manually, run `fern generate --docs`.
106
+
### Verify the setup
99
107
100
-
### Reach out to us
108
+
Once Fern has completed your setup, you'll be able to access your documentation at `mydomain.com/docs`. It may take a few minutes for DNS changes to propagate globally.
101
109
102
-
Reach out to [email protected] to get the configuration for setting up your custom subpath.
110
+
<Tip>Check that you can access your new docs site from a mobile device or incognito browser.</Tip>
103
111
104
112
</Steps>
105
113
</Accordion>
106
114
<Accordion title = "Root domain">
107
115
108
-
To host your documentation on a root domain, i.e. `mydomain.com`, you need to edit your `docs.yml` configuration and then get provider-specific instructions for setting up the domain. Common providers include Cloudflare, AWS Route53 and Cloudfront, Netlify, and Vercel.
116
+
To host your documentation on a root domain like `mydomain.com`, you need to edit your `docs.yml` configuration and then get provider-specific instructions for setting up the domain. Common providers include Cloudflare, AWS Route53 and Cloudfront, Netlify, and Vercel.
109
117
110
118
<Steps>
111
119
112
120
### Configure the `url` in `docs.yml`
113
121
114
-
<CodeBlock title="Root domain">
122
+
<CodeBlock title="docs.yml">
115
123
```yaml
116
124
instances:
117
125
- url: example.docs.buildwithfern.com
118
-
custom-domain: www.example.com
126
+
custom-domain: www.mydomain.com
119
127
```
120
128
</CodeBlock>
121
129
122
130
[Here's an example.](https://github.com/dannysheridan/katiedanny/blob/2fcf5769e2994af29e31d00904e04788b188a18b/fern/docs.yml#L3-L5)
123
131
132
+
### Contact Fern
133
+
134
+
Contact Fern via your dedicated Slack channel or [email](mailto:[email protected]) to receive:
135
+
- A unique CNAME value for your site
136
+
- A TXT record to verify your domain
137
+
124
138
### Configure your DNS settings
125
139
126
-
You'll need two DNS records configured for your root domain.
140
+
You'll need the following DNS records configured for your root domain.
127
141
128
-
<CodeBlock title="WWW DNS Record">
142
+
<CodeBlock title="CNAME Record (WWW Subdomain)">
129
143
```
130
144
Type Name Value
131
-
CNAME www cname.vercel-dns.com.
145
+
CNAME www [unique CNAME value provided by Fern]
132
146
```
133
147
</CodeBlock>
134
148
135
-
<CodeBlock title="Apex Domain DNS Record">
149
+
<CodeBlock title="A Record (Apex Domain)">
136
150
```
137
151
Type Name Value
138
152
A @ 76.76.21.21
139
153
```
140
154
</CodeBlock>
141
155
156
+
<CodeBlock title="TXT Record (Domain Verification)">
157
+
```
158
+
Type Name Value
159
+
TXT @ [TXT record value provided by Fern]
160
+
```
161
+
</CodeBlock>
162
+
142
163
This redirects `mydomain.com` to `www.mydomain.com`.
143
164
144
-
Contact Fern Support after adding these records and we will provision a SSL certificate.
165
+
After you add these records, Fern will provision a SSL certificate.
145
166
146
167
### Verify the setup
147
168
148
-
Once we've completed the setup re-generate your docs by running `fern generate --docs`. Within two minutes, you should be able to access your documentation at `mydomain.com`.
169
+
Once Fern has completed your setup, you'll be able to access your documentation at `mydomain.com`. SSL will be automatically provisioned for your domain, but it may take a few minutes to propagate globally.
170
+
171
+
<Tip>Check that you can access your new docs site from a mobile device or incognito browser.</Tip>
0 commit comments