I’ve installed Nextcloud on an RPi 4 8GB running Ubuntu 20 and LAMP stack, and set up a domain name with Namecheap, as well as SSL from LetsEncrypte. For whatever reason, I simply can’t get DDNS to work. I’m able to connect to NC fine inside my network using the local IP for the RPi.
I had set up a different RPi with NC, but running Raspian Buster, and using a domain from no-ip. It has run great great for a couple months, but I recently decided I wanted to replace that set up with an RPi on Ubuntu. I’ve checked an re-checked the various settings (as outlined in the various tutorials I’ve followed for each step), and uninstalled and reinstalled ddclient this morning, which when run indicates it is running and successfully updating the dynamic IP with the namecheap server. The Namecheap tech support folks said everything also looks fine on their end. Certbot also reports it is successfully updating the SSL cert.
Unfortunately, for some reason, when I ping my public IP address from a device outside the network, I get no response, and obviously my domain isn’t working. I’ve included the errors appearing in my NC Admin log (below). I have no idea what the first one means, but I think the second one is related to an attempt to run Duplicati and save to a another RPi.
I’ve included as much info as I can think might be helpful.
Nextcloud version : 20.0.3
Operating system and version: Ubuntu 20.04
Apache 2.4.41
PHP version: 7.4.3
The issue you are facing: DDNS not working
Is this the first time you’ve seen this error? (Y/N): Yes.
Steps to replicate it:
- Attempts to connect using domain name from namecheap unsuccessful.
- Ping to local IP address unsuccessful.
- Port check shows both 80 and 443 are open (and I have them forwarded to my NC RPi’s local IP).
Steps I used to perform my install:
- Installed Ubuntu Server (64-bit) 20.04 on SD card
- Via SSH, changed password and ran apt update & apt upgrade
- Created new user [username]
- Added to sudo group
- Logged out and back in as new [username]
- Deleted user ubuntu
- Changed default SSH port to XXXX
- Changed hostname from default ubuntu to [newhostname].
- Installed LAMP stack via tutorial at https://www.linuxbabe.com/ubuntu/install-lamp-stack-ubuntu-20-04-server-desktop
- Installed Fail2ban
- Installed Xubuntu desktop as per https://linuxconfig.org/how-to-install-xubuntu-desktop-on-ubuntu-18-04-bionic-beaver-linux.
- Installed VNC server via tutorial at https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-20-04.
- VNC server successfully installed, but connection from remote viewer unsuccessful
- Installed ddclient and set up DDNS via tutorial https://serdima.wordpress.com/2018/04/23/tutorial-updating-dynamic-dns-with-ddclient/
- Setup successful, verified via sudo service ddclient status
- Installing Certbot via https://certbot.eff.org/lets-encrypt/ubuntufocal-apache (using snap protocol)
- Ran certbot; indicates it has successfully installed ssl cert
- Installed Nextcloud via tutorial at https://pimylifeup.com/raspberry-pi-nextcloud-server/
- Initially tried using the tutorial specifically for ubuntu from linuxbabe, but found Gus’s tutorial at PUML included a couple additional and helpful steps. The PUML guided install was on a fresh ubuntu installation (i.e. I wiped the previous SD card with the linuxbabe guided install).
- Completed NC setup via local IP.
What currently works:
- I can hit the NC login page using the local IP of my RPi from a computer on the same network.
- I can hit the NC login page from outside my network using the public IP of my modem/router, if I add the current public IP as a trusted domain in the config.php file. <- obviously this isn’t a long-term solution since that IP address is dynamically assigned and changes, and of course also defeats the purpose of having a domain name. But it does indicate that the port forwarding is working.
This is my nextcloud.conf file
Alias / "/var/www/nextcloud/"
<VirtualHost *:80>
DocumentRoot "/var/www/nextcloud"
ServerName [domain.name]
ErrorLog ${APACHE_LOG_DIR}/nextcloud.error
CustomLog ${APACHE_LOG_DIR}/nextcloud.access combined
<Directory /var/www/nextcloud/>
Require all granted
Options FollowSymlinks MultiViews
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
Satisfy Any
</Directory>
</VirtualHost>
Output of your Nextcloud log in Admin > Logging:
Error: GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 120001 milliseconds with 192353859 out of 360239365 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
Warning: Host 192.168.X.XX was not connected to because it violates local access rules
Output of your config.php file in /path/to/nextcloud
(identifiable information removed):
<?php
$CONFIG = array (
'instanceid' => 'oc8gq8d15tv4',
'trusted_domains' =>
array (
0 => 'xxx.xxx.x.xx',
1 => '[domain.name]',
),
'passwordsalt' => 'ZQ46FgInf5bLHAt...[trucated]',
'secret' => 'jxAGqLsZwkYqt5ptv9wn...[truncated]',
'datadirectory' => '/var/nextcloud/data',
'dbtype' => 'mysql',
'version' => '20.0.3.2',
'overwrite.cli.url' => 'http://xxx.xxx.x.xx',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => '[username]',
'dbpassword' => '[password]',
'installed' => true,
);
Output of your Apache system log in /var/log/____
:
I don’t see a “system log” in my /var/log/apache2 folder, but this is what’s in my error.log this morning, after doing a complete uninstall and reinstall of ddclient…
[Sat Dec 19 12:00:16.998968 2020] [mpm_prefork:notice] [pid 27319] AH00169: caught>
[Sat Dec 19 12:00:29.799359 2020] [mpm_prefork:notice] [pid 2182] AH00163: Apache/>
[Sat Dec 19 12:00:29.803572 2020] [core:notice] [pid 2182] AH00094: Command line: >
And this is what appears in the nextcloud.error log this morning…
[Sat Dec 19 04:57:04.318467 2020] [php7:error] [pid 28807] [client 195.133.59.127:6>
[Sat Dec 19 06:09:44.644905 2020] [php7:error] [pid 28830] [client 194.87.55.136:54>
[Sat Dec 19 07:48:14.198064 2020] [php7:error] [pid 28810] [client 2.58.29.151:1920>