Back

[SOLVED] Custom Domain for user project

  • 0
  • Self Hosted
BloodThermic
29 May, 2023, 03:33

I am using a non standard port for appwrite, but I am unable to find documentation on how to use non standard ports in appwrite for custom domains.

TL;DR
Issue: Unable to set custom domain with non-standard ports in Appwrite. Solution: 1. Update the values in the `.env` file to point to the main Appwrite domain. 2. Ensure the ports for http and https are known. 3. Add the custom domain in the Project settings inside the Appwrite console. 4. Add a `CNAME` record in the DNS for the custom domain, pointing to the main Appwrite domain. 5. Use an `A` record with the server IP for the main Appwrite domain. 6. If unable to create a `CNAME` with an IP, provide a screenshot for
Binyamin
29 May, 2023, 03:34

It looks like that when you're setting custom ports for your main Appwrite domain (in Traefik) then this ports will also affect any custom domain pointing to your server.

Binyamin
29 May, 2023, 03:34

How have you set a different ports?

BloodThermic
29 May, 2023, 03:37

I set ports 80 to 3080 cant rememeber https port

Binyamin
29 May, 2023, 03:37

But where you set that?

BloodThermic
29 May, 2023, 03:37

in the appwrite setup

BloodThermic
29 May, 2023, 03:38

when it ask you for your ports

Binyamin
29 May, 2023, 03:38

Good

Binyamin
29 May, 2023, 03:38

So you can find both of them in your Appwrite docker-compose.yml file

BloodThermic
29 May, 2023, 03:40

How do I set the domain to the port

BloodThermic
29 May, 2023, 03:40

srv record?

BloodThermic
29 May, 2023, 03:42

3080 and 3084 is the ports

Binyamin
29 May, 2023, 03:43

Okay you need to have the main domain set in your .env in these value

TypeScript
_APP_DOMAIN=localhost
_APP_DOMAIN_TARGET=localhost
Binyamin
29 May, 2023, 03:43

Is this set?

BloodThermic
29 May, 2023, 03:44

do I need to set it to the whole domain like. appwrite.phelps.fit or just phelps.fit

Binyamin
29 May, 2023, 03:44

No, the main Appwrite domain.

Binyamin
29 May, 2023, 03:44

I'll summarize it. I've just tested it on my server and it worked great

BloodThermic
29 May, 2023, 03:44

Ok awesome

Binyamin
29 May, 2023, 03:47

A. Make sure these values point to your main appwrite domain.

TypeScript
_APP_DOMAIN=appwrite.phelps.fit
_APP_DOMAIN_TARGET=appwrite.phelps.fit

If they didn't, then after updating them refresh docker by running docker compose up -d

B. Get to know both ports for http and https

C. Add custom domain in your Project setting inside Appwrite cosole.

D. Add CNAME value in your dns for the new custom domain. like so

TypeScript
  type     name     content
  CNAME    new      appwrite.phelps.fit

Then you should be able to access your new custom domain using the same port you're accessing the main one.

BloodThermic
29 May, 2023, 04:03

I am unable to do a cname with an ip cloudflare is not allowing me

Binyamin
29 May, 2023, 04:04

CNAME is not an IP is a domain (hostname). Can you share a screenshot?

BloodThermic
29 May, 2023, 04:05
Binyamin
29 May, 2023, 04:05

Gotcha

BloodThermic
29 May, 2023, 04:06

I can create an a record but cant verify with appwrite

Binyamin
29 May, 2023, 04:06

The CNAME is only for the custom domain. For your main domain appwrite.phelps.fit use A record with the server IP

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