Back

Understanding the appwrite hosting...

  • 0
  • Self Hosted
  • General
Prince Raj
23 Mar, 2023, 07:12

Hey, I've hosted the apprwrite's docker container locally and I'm having trouble when I'm running the app on different devices...

  1. How can I make it work with different devices? I'm having trouble understanding the "For self hosted solutions" part on the website... The private IP thing...
  2. If I'm hosting it on Google cloud, do I need pass the GCP's external IP when appwrite asks for hostname.. What I'm supposed to enter there as idk how I'll access if it is hosted on VM's localhost
TL;DR
1) To make the app work with different devices, you need to ensure that all devices are connected to the same local network. The appwrite instance should be hosted on a private IP address. You can find your private IP address by running `ipconfig` on Command Prompt and use that IP address as the endpoint for your app. This way, all devices on the same network can access the appwrite instance. 2) If you're hosting appwrite on Google Cloud, you should pass the external IP of your GCP instance as the hostname when prompted. This IP address will allow external devices to access your appwrite instance. Make sure
safwan
23 Mar, 2023, 07:31

Hey there! I'll try answering both your questions.

safwan
23 Mar, 2023, 07:35

For the first question, what the documentation is saying, is that if you're running your appwrite instance on your own computer (locally), instead of using http://localhost/v1, use your private IP address.

To find out your private IP address, open command prompt, and run ipconfig. If you're connected to your network via WiFi, look for the Wireless LAN adapter Wi-Fi: heading, and find the value of the IPv4 Address entry. Mine says 192.168.100.5. So instead of using localhost/v1 as my appwrite endpoint on apps, i'll use http://192.168.100.5/v1.

Hope that makes sense

safwan
23 Mar, 2023, 07:40

For second question.

You're right. One thing I'm not a 100% sure about, is if you're supposed to use a domain when hosting appwrite on a remote server. Using the server's IP address isn't necessarily the best thing to do. WHat I would recommend, is to get a domain, and use that domain as the Appwrite instance's main hostname and Appwrite instance's DNS A record hostname which is asked during installation.

Once you enter your domains, you will be instructed to add an A record to your domain's DNS settings, which will make sure that yourdomain.com points to your server's IP address

safwan
23 Mar, 2023, 07:40

Hope I answered your questions! Feel free to ask any more

Prince Raj
23 Mar, 2023, 08:01

I can't afford to purchase a domain for my practice projects, which is basically for showcase

safwan
23 Mar, 2023, 08:06

ah okay. then a locally hosted appwrite instance ahould be okay for you

Prince Raj
23 Mar, 2023, 08:17

Thank you for answering, I have another follow up question..

Assuming, I'm going with the first approach, do all the devices needs to be connected on the same network to access the server, By accessing, I mean, suppose I've hosted the db on the private IP, will i be able to access it after building the apk from another device?

safwan
23 Mar, 2023, 08:18

if you host on something like GCP, you'll get a static public IP address, which can be accessed from anywhere.

if you host in your local network, only devices within your network will be able to access it. There's more to it, which I'm haopy to explain. give mena few minutes

safwan
23 Mar, 2023, 08:36

Okay so to elaborate on local hosting.

If you host on your computer in your local network, you'll have a private IP, that can't be accessed from anywhere outside of the local network. If you plan on using that private IP for appwrite, I'd recommend assigning your computer a static IP. Most local networks use DHCP - which basically means that your private IP changes periodically. With static IP addresses, you can be sure that the host (your computer) will always have that IP address on the network.

Prince Raj
24 Mar, 2023, 04:32

Got it

Prince Raj
24 Mar, 2023, 04:33

Thank you

BadBoomba
24 Mar, 2023, 05:09

It is worth mentioning OP will have to also use port forwarding on their router for WAN access

Prince Raj
24 Mar, 2023, 05:11

I think it's very over my head now

Drake
24 Mar, 2023, 05:44
Prince Raj
24 Mar, 2023, 09:59

Hey, sorry if I'm bothering you, but after hosting it on my private IP, I'm not able to create a new account, the error is "The current project has exceeded the maximum number of users . Please check your user limit in the Appwrite console"

Neither I'm able to sign in with the email and pass used on localhost..

What should I do now to overcome this?

Drake
24 Mar, 2023, 13:21

after hosting it on my private IP

What did you do exactly?

Prince Raj
24 Mar, 2023, 13:26

I ran the ifconfig to get the IPv4 address and then I entered that IP address instead of localhost

Drake
24 Mar, 2023, 13:39

entered that IP address instead of localhost

Can you explain in more detail? Did you run the install command again?

Prince Raj
24 Mar, 2023, 13:39

Yes

Drake
24 Mar, 2023, 13:40

On the same server/machine that had a previous installation without uninstalling?

Prince Raj
24 Mar, 2023, 13:40

Yes

Drake
24 Mar, 2023, 13:42

I see. First off, you don't need to change the domain from localhost to IP. You need to change it when you start using an actual domain.

Secondly, you can't install again without uninstalling because your new installation will be using the same data from your previous one. I suggest just running docker compose down in your new folder, go to your old folder, and run docker compose up -d go switch back to using your previous installation

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