Can't access from iphone app externally

Hi guys,

so i got nextcloud installed on FreeNas. i got my drives mounted and i can access them on nextcloud and stuff… so that aspect of nextcloud is working.

However, i can’t access nextcloud on my app outside of my home network.

I know you have to forward port 80 and 443; however, on my router setting, i have another IP (my surveillance system) which is using those two ports and iam already forwarding those ports. So when i try to forward 80 and 443 using the nextcloud IP, my router says i cant.

What can i do? Seems like both surveillance system and nextcloud uses 80 and 443.

I assume, that the simpliest way will be to use a different external port on your router, e.g. 8443/tcp, and forward it to your local 443/tcp port of your Nextcloud server.

sorry, i’m a bit confused here.

isn’t nextcloud setup to use 443. so if i use 8443 to forward to 443, and when i try to login from outside the network, won’t it just open up my surveillance system page?

do i have to change the netcloud setting somehwere to say i am not using 8443 and then forward the port

On your router you can usually enable access on external ports which will then be redirected to a different target. So if you open port 443/tcp and forward inbound traffic to your surveillance system, e.g. on ip, you can set-up an additional port, e.g. port 8443/tcp and forward it to your Nextcloud server on ip port 443/tcp.

This works as long as the surveillance system and your Nextcloud runs on different hardware. Due to the fact that you’ve not mentioned that it runs on the same hardware, I assumed the latter.

Currency, my surveillance system is running off a NVR and and nextcloud on FREENAS.

I will go home and try this. If I’m unsuccessful , I’ll post some screenshots. Thanks

so, is this what you mean. the .193 is my nextcloud and .172 is my surveillance system. I still can’t access next cloud.

That looks fine, except that I usually would disable port 80/tcp :wink: You should make sure that a) the default gateway on your FreeNAS is pointing to your internet router and b) that no firewall blocks access from and external site. Additionally you should check if any inbound traffic can be seen on your FreeNAS. Usually the web server log would be the right place to see that. What is error message which is displayed when you try to access your server over the internet?

Ugh this is stressful.

On the iOS app. Do I basically use my external IP address and user name and password?

So like xx.xx.xx.xx:443

I’m getting the SSL connection could not be established.

Ok, let me revise my question. What is the error message which is displayed if you access your server using a web browser, NOT the Nextcloud app? What about the other points, have you checked them?

When I use the web browser and put my external IP address only. It takes me to my surveillance system login page.

Then I use my external ip and add :443 or :8443 at the end, I get “this site can’t be reached” error.

Then I try my external ip and add /nextcloud at the end, I get “Access Error: 404 — Not Found can’t open URL”

Well… the best solution would be to have a reverse-proxy running inside your home network, which is able to handle this correctly. Also, you’d need to have a dynamic DNS solution in place, such as that you can actually reach your NC instance via the same DNS name, regardless if you’re on your home network or abroad.

This is not rocket sience per se, but it is challenging for a novice user, because there’re so many moving parts in this setup and it’s not a single thing that needs to be set up. However, if your’re seriously interested in getting this up and running I’d suggest some reading-up on these tools:

  • HA-Proxy as a reverse-proxy
  • dnsmasq (for local DNS service)
  • LetsEncrpyt SSL certificates
  • Some dynamic DNS service

And you’ll need correct SSL certificates… And yes, this can be stressful, but once this is setup the effort will reduce to renew your Letsencrypt SSL certs every 3 months.

Unfortunately you not very precise again. Are you using http and/or https as protocol during you tests? What about the other points, have you checked them?

okay! i got it working. however, im getting the error saying i need to add the domain to the trusted domain list. i searched the forum and found results, but i’m not able to do it. I used WINSCP, but i can’t find the files in user/pbi/… there is nothing after pbi.

i logged in FTP as root.

im not really good with shell commands. I was hoping to open the config file in winscp and edit it in text and save it as it’ s the easiest way.

It would be nice if you could explain what you’ve done to solve the problem.

Identify the directory in which you’ve installed Nextcloud. In this directory you will usually find a sub-directory or symbolic link called “config” which contains the “config.php” file.

oh, i forgot to forward port 80. I only forwarded port 443. Once i forwarded port 80, it worked fine.

So, in FreeNas. Nextcloud is installed inside the iocage jail.

Wouldn’t that mean i would need to loginto the jail and find that directory? Because the IP i used in Winscp, is the FreeNas IP. should i use the nextcloud Jail IP and try to access that directory to find the config file?

Yes, that’s a good idea :+1: