Back

[SOLVED] How to run GraphQL Explorer on self hosted server on ip

  • 0
  • GraphQL
burakcbdn
9 Aug, 2023, 06:47

I self hosted my appwrite server on a linux vps, it is acitvely running on docker and I am connecting it using http://ip/v1 etc, how can I activate the graphql explorer? I tried the script that activates on the port 3000 but going to http://ip:3000/v1/graphql gives 404 error

TypeScript
APPWRITE_ENDPOINT=http://ip/v1
if [ ! -z "$1" ]; then
    APPWRITE_ENDPOINT=$1
fi

docker run --rm -p "3000:3000" -e "SERVER_URL=$APPWRITE_ENDPOINT/graphql" appwrite/altair:0.3.0
TL;DR
The user was having trouble running GraphQL Explorer on a self-hosted server. They initially resolved the issue by going to "https://ip:3000" instead of "http://ip:3000/v1/graphql". However, they encountered a new problem where port 3000 was already allocated when running the GraphQL Explorer script. The solution given by another user was to add port mapping for the GraphQL Explorer in the Docker Compose file of the self-hosted Appwrite server. The instructions for this were provided. Restarting the Appwrite Docker containers should apply the changes.
joeyouss
9 Aug, 2023, 07:19

Hi, have you tried the following:

  • SSH into your Linux VPS where the self-hosted Appwrite server is runnin
  • Locate the Docker Compose file you used to set up your self-hosted Appwrite server. docker-compose.yml or something similar
  • In the Docker Compose file, you need to add port mapping for the GraphQL explorer.
    TypeScript
    appwrite:
      ...
      ports:
        - "80:80"
        - "443:443"
        - "3000:3000"
      ...
    
  • Save the changes to the Docker Compose file and exit the editor. Then, restart your Appwrite Docker containers to apply the changes.
    TypeScript
    docker-compose down
    docker-compose up -d
    
  • http://ip:3000/v1/graphql in your web browser. Replace ip with the actual IP address of your VPS.
burakcbdn
9 Aug, 2023, 07:31

@joeyouss now it says port 3000 is already allocated when I run graphql explorer script

burakcbdn
9 Aug, 2023, 07:53

fixed seems like I need to go to just https://ip:3000 not http://ip:3000/v1/graphql

joeyouss
10 Aug, 2023, 19:44

@burakcbdn works for you now?

burakcbdn
11 Aug, 2023, 08:14

Yep it works thanks

joeyouss
11 Aug, 2023, 10:53

[SOLVED] How to run GraphQL Explorer on self hosted server on 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