juliushaertl / nextcloud-docker-dev

Nextcloud development environment using docker-compose
GNU Affero General Public License v3.0
126 stars 67 forks source link

How to open URL in mobile browser or to connect server with android app #289

Open Darshan-upadhyay1110 opened 6 months ago

Darshan-upadhyay1110 commented 6 months ago

I have this URL working on my local system which "http://nextcloud.local/index.php/apps/dashboard/"

Questions:

image

image

Assume that my wifi nextwork has this ip address : 192.168.X.X

CC: @juliushaertl

juliushaertl commented 6 months ago

The reverse proxy that is used for distributing requests between different containers requires to use a hostname. On other devices you can achieve this either by adding nextcloud.local pointing to your local wifi ip in /etc/hosts or you need to use a custom dns server for that https://juliushaertl.github.io/nextcloud-docker-dev/basics/hostnames/#use-dns-service-discovery-on-macos

Darshan-upadhyay1110 commented 6 months ago

@juliushaertl i have added my ip in etc/hosts image

But in my phone i can not open nextcloud.local. (i have restarted docker after edit etc/hosts)

Am i doing wrong here ?

juliushaertl commented 6 months ago

You will need to change the hosts file on the mobile device for this so that it can resolve the hostname. This only works on rooted android devices as far as I'm aware. Otherwise you could use an app like https://www.zenz-solutions.de/personaldnsfilter-wp/ to add custom dns resolution or you need a local dns server as described in the linked documentation above.

brccabral commented 5 months ago

I have PiHole setup as my DNS server on my WiFi LAN network. On the phone, I change the WiFi settings to point DNS to my PiHole IP. In PiHole, I configured nextcloud.local to the IP where Nextcloud is (198.168.x.y). No root required. Another option is to use dnsmasq, but I think this is more complicated, and PiHole has other benefits. And open firewall with ufw. I have compiled some instructions here https://gist.github.com/brccabral/a632c5dc826d0fe55db60722adbbd2dd#local-dns but this is not a fully tested tutorial.