Skip to content

Commit bf8b929

Browse files
authored
Merge pull request #66 from danielepintore/docs-add-cloudflare-origin-certs
docs: add instructions on how to use cloudflare origin certificates
2 parents f865b00 + 3c24d63 commit bf8b929

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

apps/docs/content/docs/core/domains/cloudflare.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ To switch between modes, follow these steps:
3939
Follow the steps in the same order to prevent any issues.
4040
</Callout>
4141

42+
You can create a certificate for your origin server using two methods:
43+
- Using Let's Encrypt to generate a certificate for your origin server.
44+
- Using Cloudflare's Origin CA to generate a certificate for your origin server.
45+
4246
We assume that you have enabled the `Full (Strict)` mode in the previous step, is super important to follow the steps in the same order to prevent any issues.
4347

48+
### Using Let's Encrypt
4449
1. Go to cloudflare dashboard and then click on `Account Home` -> Select the Domain.
4550
2. On the left side, click `DNS`.
4651
3. Click on `Records`.
@@ -62,6 +67,35 @@ We assume that you have enabled the `Full (Strict)` mode in the previous step, i
6267
19. Wait a few seconds and refresh the application.
6368
20. You should see the application running on the domain you just created.
6469

70+
### Using Cloudflare's Origin CA
71+
1. Go to cloudflare dashboard and then click on `Account Home` -> Select the Domain.
72+
2. On the left side, click `SSL/TLS`.
73+
3. Click on `Origin Server`.
74+
4. Click on `Create Certificate`.
75+
5. Select `Generate private key and CSR with Cloudflare`.
76+
6. Choose the list of hostnames you want the certificate to cover eg. `api.dokploy.com`.
77+
7. Choose the validity period eg. `15 years`.
78+
8. Click `Create`.
79+
9. Using the PEM format, copy the `Origin Certificate` and `Private Key` in the respective fields in the dokploy new certificate panel (Certificates > Add Certificate).
80+
10. Go to `Domains` section in your application.
81+
11. Click `Create Domain`.
82+
12. In the `Host` field, enter the domain name eg. `api.dokploy.com`. (Make sure that the domain is already pointing to your server IP in Cloudflare DNS settings and the **hostname matches the one in the certificate**).
83+
13. In the `Path` field, enter the path eg. `/`.
84+
14. In the `Container Port` field, enter the port where your application is running eg. `3000`.
85+
15. In the `HTTPS` field enable `ON`.
86+
16. In the `Certificate` field select `None`.
87+
17. Click `Create`.
88+
89+
Using Cloudflare's Origin CA, you are sure that the certificate will be valid for the next 15 years, or the duration you selected, and you don't have to worry about failed renewals.
90+
91+
<Callout type="info">
92+
You can also create a certificate for wildcards domains eg. `*.dokploy.com` and use it for multiple subdomains.
93+
</Callout>
94+
95+
<Callout type="warn">
96+
**Important**: With a free Cloudflare account, this methods work only for the main domain and subdomains, not for sub-subdomains. Eg. `api.dokploy.com` works but `staging.api.dokploy.com` does not work.
97+
</Callout>
98+
6599

66100

67101
## Assign a Domain Flexible

0 commit comments

Comments
 (0)