Hi all. I'm having trouble using Appwrite in my remote Linux server. On my local home network, I have a local appwrite server that works very well. However, when I move to a public server to host my services, I have trouble making it publically available. I don't know if there's a problem with firewall cuz I'm not really experienced with firewall. Here's the log
#Can't visit locally hosted Appwrite on local server.
95 messages · Page 1 of 1 (latest)
😄 please help by
Please avoid tagging folks individually as it can be disruptive
Have you done port forwarding in your router?
On what ports are you running Appwrite?
I run the default 80 and 443
My server is public, whoch means I can ssh to it from anywhere
Looks like you didn't have allowed 443 in the firewall?
You mean I have to add 443 with sudo ufw ?
This is recommended, as 443 is for https.
Yeah. I haven’t figured why it doesn’t work on ny public server
Everything works well on my local laptop, which is then being tuned to ngrok for public access
Yes, HTTPS runs on port 443
I added but still can't curl localhost on port 80
What's the output of docker ps?
here is my output
Oh, I didn’t realise you were trying on localhost - no, that shouldn’t require any firewall changes. What exactly happens when you curl localhost:80?
It just hangs forever? That’s strange…
Could you please try running docker compose logs appwrite -n 0 -f, then curl again, and see if anything comes up?
Thanks. Here is the log for docker compose logs appwrite
How did you install Appwrite?
I installed it with docker compose up -d and docker-compose.yml + .env
what happens if you use ports other than 80 & 443?
Where did you get the docker-compose.yml and the .env?
I got docker compose from this https://appwrite.io/install/compose
same thing for .env https://appwrite.io/install/env
So you went the manual install route?
Just to make sure - you have the .env file in the appwrite/ directory?
Is there any reason you didn’t go the recommended install route?
both of the docker-compose.yml and .env are in the same folder. I run docker compose in that folder 😄
And is there any reason you didn’t use the recommended install method?
isn't docker-compose the recommended method for advanced settings?
please try curl -i http://localhost:80
doesnt work too 😄
same config hosted on my local laptop
it works on my local laptop but doenst work on my public gpu server
something must be screwed up with the docker installation 🧐
what about curl -I http://127.0.0.1 and have you tried letting it run without canceling?
actually, let's try curl -v http://127.0.0.1
I just checked docker compose versin on both computer. They all run docker compose version v2.24.5
btw my local laptop runs ubuntu 22 while the gpu server runs ubuntu 20
how did you install docker?
I installed following this tutorial https://docs.docker.com/compose/install/linux/
this is compose. how did you install docker?
I dont really remember how I installed it but basically I followed this tutorial https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
here's my docker version
both of my server runs on the same docker version
this should be fine...
i know there can be problems with installing via snap. i think the versions may line up even if you install via snap, but then weird things happen
yeah. I have no idea why
I also tried hosting a web server with npm on port 3000 and still works fine when I curl on this port
what if you stop the appwrite stack and then curl?
connection refused Lol 😄
btw, you shouldn't need to use sudo with docker commands. you may have missed this step in the installation: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
can you try:
docker run -p 5678:5678 --rm -d hashicorp/http-echo -text="hello world"
curl -v http://localhost:5678
ok docker and networking must be fine then..
how about you wipe this appwrite installation and install using https://appwrite.io/docs/advanced/self-hosting#install-with-docker
Actually, I also tried that option but it didnt work neithr
Let's try from different containers
docker compose exec appwrite curl -v http://localhost/
docker compose exec traefik wget -q -S -O- http://appwrite/
The recommeded method is with the single docker command here - https://appwrite.io/docs/advanced/self-hosting#install-with-docker
same old thing ^^
does it work if you do a clean install and use ports other than 80/443? 👀
I just tried sudo npm run dev -- port=80 to test my project on localhost port 80 and it still works fine!
what do you mean by cleaning the install ? I tried removing all docker containers and started from scratch
thats what a clean install is 😅, starting from scratch.
Can you edit the docker-compose.yml and change the default ports to something like 4444 & 5555 & restart appwrite?
I've had issues on my local installs as well with 80 & 443, so I use other ports.
This is on the same server Appwrite is running on?!
yeah 😄
let me give it a go
Make sure you delete the volumes too, otherwise it's not really a new install
👀
this would indicate the container isn't working right...i wonder if it's some IP V6 problem...
I question that too
yeah I did
Do you see anything in the Traefik logs? docker compose logs traefik
he can't even hit appwrite from inside the appwrite container 👀
Good point. I don’t think it’s a V6 thing - you can see in the curl log “Connected to localhost”. Unless containers aren’t able to talk to each other, I guess?
oh..good point..wait i might have read things wrong..
you might have too many workers for the mariadb connection...
how many cores does the server have?
let's try setting _APP_WORKER_PER_CORE in your .env to 1
doesnt workout too 😄
haizz