Skip to content
Back

Setup custom domain on selfhosted behind cloudflared

  • 0
  • 4
  • Self Hosted
13 Jun, 2026, 13:37

Hello everyone, can anyone help me to setup a custom domain on a selfhosted appwrite instance thats running behind cloudflare tunnels? Current setup: Appwrite running on backend.domain1.com, for another project I would like to add custom domain backend.domain2.com.

-) I have tried adding a CNAME to domain2 with forward to domain1 but then the cert generation fails. -) I have tried adding a cloudflare tunnel to point at the port of the appwrite instance but I cannot log in. -) I have tried setting up /.well-known/acme-challenge/* as a tunnel rule while keeping a simple cname to forward to but it also doesnt work.

Am I missing something or how can I make this work? I would like to use appwrite for both domains in parallel. so be accessible via backend.domain1.com and backend.domain2.com.

TL;DR
To set up a custom domain on a self-hosted server behind Cloudflared: - If using Traefik, default certificate method requires both HTTP and HTTPS to be reachable externally. - Consider using a DNS certificate instead for a different approach.
14 Jun, 2026, 12:24

make sure cloudflare proxy (orange toggle) is off for the cname flattening to work

14 Jun, 2026, 13:09

if your using traefik :

  • the default cert method is HTTP, which need HTTP + HTTPS reachable from the outside
  • try using a dns cert instead (what i'm doing)
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more