Skip to content

NextCloud ​

I started with nextcloud-aio container, but later decided to try manual installation to learn more and understanding about NextCloud service.

Add Share ​

Untitled

Install MariaDB ​

Untitled

Change the following:

Untitled

Click Console.

Untitled

Check that the database nextcloud is created.

Untitled

Grant privilege to nextcloud database to nextcloud user that we created earlier.

python
GRANT ALL PRIVILEGES ON nextcloud.* to 'nextcloud' IDENTIFIED BY '<YOUR_PASSWORD>';

Untitled

Install NextCloud ​

Install nextcloud provided by linuxserver.

Untitled

Choose latest branch.

Untitled

Set the path to /data to the share we created earlier at /mnt/user/nextcloud.

Untitled

Take note of Mariodb container IP address.

Untitled

Access nextcloud Web UI.

Untitled

Fill in the settings. Select MySQL/MariaDB as the database, then paste the IP address.

Click Install when done.

Untitled

Skip when asked to install recommended apps. We just want to share our files for personal use and not for team use.

Untitled

Untitled

Home page for your newly created user.

Untitled

Screenshots ​

Files

Untitled

Photos

Untitled

Additional NextCloud App ​

Memories ​

Search for memories

Untitled

Download and enable.

Untitled

Click your icon profile at top right, then select Admistration Settings. Next select Memories on the side menu.

Go through each settings.

Untitled

Setup External Transcoder ​

By default transcoding is disabled. Memories recommend using external transcoder that utilizes Intel QuickSync to speed up 5x+. External transcoder requiring you to run a separate docker container and pass /dev/dri to it.

I didn’t try this out and I kept it disabled (default settings).

Untitled

See https://memories.gallery/hw-transcoding/#external-transcoder for more info.

No Pictures after add ​

Console login to nextcloud container, then run

python
occ memories:index

See https://help.nextcloud.com/t/memories-with-no-pictures/159355/2 for more info.

External Storage ​

Since nextcloud didn’t support symbolic link for folder, we have to use External Storage plugin then mount a shared folder from unraid to nextcloud Container.

Stop nextclloud container if it is still running, then

Example below show I map my shared drive pictures and mount it to container path /mnt/pictures

Untitled

Go to app and search for External Storage plugin.

Untitled

Mount the storage as local.

Untitled

More info: https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html

Protect with CloudFlare Tunnel ​

Before you continue

Make sure you follow my Cloudflare Tunnel Setup guide before proceeding as the steps below require you to already setup Cloudflare tunnel agent running in your unRAID server.

Configure existing tunnel.

Untitled

Select Public Hostname then click Add a public hostname.

Untitled

Fill in the details.

Click Save hostname when done.

Untitled

Click Additional application settings and check No TLS Verify . It is fine because our nextcloud certificate is self signed, and we know it.

Untitled

Result

Untitled

Access the web link and you might see.

Untitled

Next we have to configure trusted domain.

Open Unraid console then.

python
cd /mnt/user/appdata/nextcloud/www/nextcloud/config

# make a backup
cp config.php config.php.bak

Edit the file nano config.php

Add your domain name used to access from cloudflare.

Untitled

Restart nextcloud container after the changes.

Untitled

Login again using the subdomain you set on CloudFlare. Voila! No more untrusted domain origin error!

Untitled

Check its serving certificate

Untitled

Untitled

Protect with CloudFlare Access Policy ​

Let’s further strengthen any remote access to this website using Google IdP. See xxx for more info.

Go to CloudFlare Zero Trust > Access > Applications. Click Add an application

Untitled

Select Self-hosted.

Untitled

Use the same subdomain we created earlier.

Untitled

Add a policy.

Untitled

Result.

Untitled

Adding Photos by Transferring from Other Drive ​

If you simply copy and paste the files from NAS to the /mnt/data folder, you’ll noticed NextCloud will not find those files. That is because it relies on database entry to render it. To update the files in db, do a scan.

Login to nextcloud container, then

python
root@ab37e6338507:/data# occ files:scan --all

Output example:

python
root@ab37e6338507:/data# occ files:scan --all
Starting scan for user 1 out of 2 (deluge23)
Starting scan for user 2 out of 2 (gary.gan)
+---------+-------+-----+---------+---------+--------+--------------+
| Folders | Files | New | Updated | Removed | Errors | Elapsed time |
+---------+-------+-----+---------+---------+--------+--------------+
| 590     | 14490 | 0   | 30038   | 0       | 0      | 00:00:15     |
+---------+-------+-----+---------+---------+--------+--------------+

Info: https://help.nextcloud.com/t/why-doesnt-show-photos-copied-from-local-storage/59738/3

Issues ​

Currently login via mobile app will fail if setup behind CloudFlare tunnel. So using web login for now.

References ​

https://medium.com/@chrismorris_82249/setup-a-reverse-proxy-nextcloud-server-on-unraid-using-letsencrypt-831905d94f7d

https://medium.com/@sirkirby/replace-your-homelab-vpn-with-cloudflare-zero-trust-8416a1d7045e