Nextcloud install on UnraidJuly 12, 2021
Nextcloud is a free software for storing data on your own server. When using a client, the server is automatically synchronized with a local directory. This allows access to a consistent database from multiple computers, but also via a web interface. It is a self-hosted alternative to Google Drive.
In order to install Nextcloud as a Docker container, the Community Applications plugin is required. You can find out how to install it here.
Install Nextcloud on Unraid
Nextcloud requires a database. For this, it is best to use the MariaDB Docker from “Linuxserver”. Click on the Install button and the following window appears:
The port and also the PUID and PGID can be left at the default. However, you should always store a root password. This should be kept well, because it is always needed if you want to install a Docker that requires a MariaDB database. Here you can directly generate a secure password:
Once the Maria DB Docker is installed, you can continue with Nextcloud.
Install Nextcloud on Unraid
Nextcloud also uses the Docker from “Linuxserver”. Under the settings, the path to the directory where Nextcloud should store the data can be entered as “Host Path 2”. Again, you can leave the other settings as they are. If you had to change them, you would know it.
Once the installation is complete, you can open the web interface by opening your server IP followed by port 443 in the browser. Example: https://192.168.178.57:443
There you should see the following page:
Under “Create administrator account”, who would have thought it, the administrator account is created. The data directory can be left at the default value, where the data is stored was already defined during the Docker installation.
Under Database, enter root as the user and the password you just set. The database name can be chosen freely. It is best to simply use “Nextcloud”. Under Localhost you must specify the MariaDB Docker. So Localhost or the IP of your server followed by the port: 3306
With a click on Finish installation Nextcloud is already installed. Now you can also call Nextcloud locally. But a cloud service that only works locally is not really practical. Therefore, here are the instructions on how to make your local Nextcloud installation available worldwide.
For this the NginxProxyManager Proxy Manager is required. How to install it, you can read here: Install NginxProxyManager Proxy Manager.
If you do not have a static IP on your Internet connection, but a dynamic IP, as is usual for normal Internet connections, you still need Duck DNS. How to install and configure it, you can read here: Install DuckDNS.
Of course you can also use your own domain with a dynamic IP address. How this works in combination with a Fritz box you can read here: Use your own domain with a dynamic IP address.
Once the preparations shown in the two linked tutorials are complete, you still need to set up port sharing for Nextcloud.
Create port shares for Nextcloud
In order to make the Nextcloud installation accessible from outside your network, a port share must be created as with the NginxProxyManager. Two TCP ports can be shared. Although you can omit port 80, encrypted connections only use port 443. You can learn how to set up port shares on the most common routers here.
With the NginxProxyManager you forward the requests to the Nextcloud Docker. There you can also create a Let`s Encrypt SSL certificate to encrypt the connection.
In the web interface of the Nginx Proxy Manager you create a new proxy host. There you enter the domain or the DuckDNS domain. Then the IP and the port of the server, as shown in the picture above. Under “Scheme” you have to enter “https”.
Under the tab “SSL” you can request an SSL certificate to encrypt the connection.
Make Nextcloud available with Nginx Proxy Manager
Nextcloud has a special security feature. That’s why you will see the following error page when you try to access Nextcloud now:
To fix this you have to edit the Nextcloud Config. To do this you need to connect to your Unraid server with an FTP client. Now you have to open the config under this path: appdata/nextcloud/www/nextcloud/config/config.php
open it with a text editor of your choice. It should look something like this:
. . . 'trusted_domains' => array ( 0 => '192.168.178.39:443', ), 'dbtype' => 'mysql', 'version' => '184.108.40.206', 'overwrite.cli.url' => 'http://192.168.178.39:443', 'dbname' => 'nextcloud', . . .
The irrelevant lines above and below the entry have been omitted.
Now you have to add 3 lines:
. . . 'trusted_domains' => array ( 0 => '192.168.178.39:443', 1 => 'Subdomain.duckdns.org', ), 'dbtype' => 'mysql', 'version' => '220.127.116.11', 'overwrite.cli.url' => 'http://192.168.178.39:443', 'overwritehost' => 'Subdomain.duckdns.org', 'overwriteprotocol' => 'https', 'dbname' => 'nextcloud', . . .
The domain / subdomain must be specified twice and the “https” scheme once. The config must be saved, then you can already access the Nextcloud.
I followed this guide but I still cannot get rid of the Nextcloud “trusted domain” warning page.
In your nextcloud config.php that you show why is it port 444? HTTPS is port 443.
I had a Nextcloud installation installed on port 444. For me it works like this without Nextcloud giving a warning.
Why does this take a so many different installs, of different software, and so many settings?
Can’t there just by “install this docker” and it’s all included… and 0 configuration… and you are done?
We’ve tried to install/setup nextcloud on several difference occasions over the past 2 years. We give up after the first couple of DOZEN steps.
There is the possibility to install Nextcloud in a Docker, but the configuration of the SSL certificate is much more difficult. That’s why I personally prefer to use Nextcloud + NginxProxyManager. This way you can easily add more web applications without having the problem with the ports. I will try to set up a single Docker soon.