Router changed IP address, can't connect to Nextcloud web interface

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2):
Operating system and version (eg, Ubuntu 17.04):
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:
My router changed the IP address for the server I am using that is running Nextcloud. I installed Nextcloud on Xubuntu 18.04 using Snap, so version 15.0.10.snap1.

Xubuntu is on an old laptop I’m using as a server for my home network, so very simple. No email or anything complicated – just a replacement for Dropbox.

This morning, I got an error on my desktop client saying “host unreachable.” I tried to sign on with the original IP address and found that it didn’t work. I tried to sign on with the new address, and that didn’t work either.

I went to the server, tried the same things, no luck. The error message said “access through an untrusted doman” and I needed to add the new address in the “trusted_domain” setting. I found a forum post that said to edit the config.php file, var/snap/nextcloud/config, adding the new IP address and a trusted_domain setting. That didn’t work either. And I remembered to reboot.

So I’m stuck. I know just enough to use the command line to get myself in trouble, so thought installing via Snap would mean I didn’t have to do a lot of admin work. I’m not even sure if there is a way to sign in to my account someway other than the web interface at the IP address.

How do I fix this problem? Or would it be easier to delete this nextcloud installation via snap and reinstall it?

Thanks for your help.

Is this the first time you’ve seen this error? (Y/N): yes

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


The output of your Apache/nginx/system log in /var/log/____:


it is not recommended to use Nextcloud via the internet directly with an IP address, it is almost impossible to secure the connection with a certificate. So what I would suggest to use an dyndns service, which connects your changing IP to a (sub)domain. This domain can then be added to the trusted_domain value and you can secure it with an certificate from Lets encrypt.
There are some good and free dyndns services, e.g.
Securepoint DynDNS:


@jeffsiegel99, you are talking about the local IP address of your Nextcloud server, which you only access in your LAN or the global/ external IP address?

What type of router do you have?

The internal IP address, the one listed in the connection information, that I access the LAN. It’s attached with an ethernet cable to an Arris Surfboard.

Thanks for this. Let me get this problem fixed, and then I can take care of that.

ah ok, you just want to have local access to your server. Then you need a static IP, this can be achieved via router settings or on your “server”.

(Solution 1) When you are familiar with the router, just search in the settings for some settings for your LAN or Home Network. Normally you can set the so called “lease” from your routers DHCP-Server for your local IPs. Set this to infinite or a very high number, so each time your “server” connects to your router it is getting the same local IP.

(Solution 2) You could set up static IPs and turn off DHCP on the router as well, but in a private household, this could be annoying, because every device in your local network would need a manual setup to connect to it.

(Solution 3) this is also needed when you want Solution 2, also I think this is the best solution in this case:
Often you can set up a static IP in the network settings of your “server”/laptop, and if the IP is “available” the router will accept it, even when the DHCP server (which is normally distributing the local IPs) is active.

Thank you again. So how do I get back to my original “server” setting? Use solution 3, and use the original IP number?

exactly, should work this way. The only problem could be, that the original address is being used by an other device, but you can try it nonetheless

That did the trick. Thank you so much for your help.

Since it is Xubuntu, there is no etc/metwork/interfaces file, and I had to use the edit connection interface on the network connection plugin on the panel. Which was actually a little easier.

Thanks again.