External Storage in Nextcloud under TrueNAS Core

External Storage in Nextcloud under TrueNAS Core

First thing is go to Storage -> Pools:

1698073823374.png




There you probably already made a pool.
Just in case I'll show you.
Click on "Add":

1698073882722.png


Then Create new pool:

1698073913639.png



Add the disks in the layout you want. For example if you have 6 HDDs then go for one VDEV in a raidz2 config.
In case of 4 disks just make to mirrored VDEVs.
My virutal machine only has one drive so I just add that:

1698074296407.png


And hit create.

Now we have a pool, but we need a dataset to actually use it:


1698074376110.png



Let's just keep the defaults except ShareType. This should be set to SMB as we plan to share it later:

1698074461395.png



Then hit submit.

Now we are up and running with the basics.
If you already did all of that: Good.

Now what we want do is make our dataset accessible via SMB.
To do that we go to Services -> SMB -> start:

1698074653011.png



Then go to Sharing ->Windows Shares (SMB) and click add:

1698074712986.png



Select the dataset you want to share via SMB. Default options should be fine as they are. Then hit Submit.

1698074769312.png


It will tell you that it will auto enable the SMB service. Click okay you should now see the SMB share up and running:

1698074849974.png



Now we need a user that actually has access to the SMB share. So we go to Accounts -> Users -> Add:

1698075548407.png



select a username, a secure password that you want to use as authentification for SMB and under Directories and Permissions we select what dataset we want to have access to. In My case I jsut chose My_Dataset as it is the only one available:


1698075676781.png



Then click submit.
Now go to windows explorer, then right click on ThisPC -> map a network drive:

1698075857627.png



Then choose a Drive Letter and enter the location.
Be aware that your truenas system is simply called truenas instead of truenascore.
I just changed that because it would conflict with my real truenas.
Also select "Connect using different credentials". Because the user we created in TrueNas is not your Windows User which windows will attempt to login by default.


1698075872495.png




After you flick finish Windows will as you to enter the credentials:


1698075974111.png



Do that , click OK et voila:

1698076069313.png


SMB up and running.

Now for the NextCloud part.
Go To Plugins -> NextCloud -> Install -> choose a name and click Save.
Nextcloud will install:


1698076198172.png



After the Installation it should show as "up".

Now we have two methods to share files with nextcloud.
The first is the easy solution. External storage "local".
For this we need to stop nextcloud again:

1698076830154.png



Then click on Mount Points:
Actions -> Add:

1698076871418.png



Choose the dataset to share (in my case My_Dataset) under source and "mnt/My_Dataset" under Destination as target (you have to enter the "/My_Dataset" manually:


1698077488115.png



This way it will mount under nextcloud. Hit submit.

Because nextcloud is running under a systemuser called "www" that user needs permissions to access My_Dataset.
To do that we got to: Storage -> Pools -> My_Dataset -> Edit Permissions:

1698083470961.png



Scroll to the end of the list and click Add ACL Item:

1698083525229.png



Under Who* you select User
And in the User field you enter www. Permissions should be fine by default (Basic, Modify).
Check: Apply premissions recursively
And if you have more datasets below My_Dataset then also check apply permissions to child datasets:
1698083676911.png



Click Save.


Go back to Jails -> Nextcloud -> Start.
Wait for it to start up and copy the address for the admin portal:


1698076589991.png



and login with the credentials you find under "Post Install Notes":


1698076646607.png




1698076686161.png



Now click on the "N" on the top right and choose Apps:


1698077162716.png



Scroll down until you find "External Storage support". Enable it:


1698077199768.png



Now go to Administration settings:


1698077230181.png



and choose External storage (under the Administration section. Not under Personal!):

1698077333037.png



Here we enter the Folder Name that NextCloud should display to the users. E.g. TrueNAS_Storage or just the name of the dataset (which I used)
Then the Storage Method "Local" and the path to the storage "/mnt/My_Dataset" which we defined in the Mount Points. You can also select which NextCloud users may access the folder:

1698077763593.png



Click on the Check arrow on the right and the entry should be marked green on the left side. This means everything works and NextCloud can access the dataset/folder.

Go To files and try uploading a test file. It should work:

1698083741516.png



It's quite late and there might be errors or practices which should be avoided.
If any of the more experienced users could point these out that'd be great :)
Author
asap2go
Views
2,938
First release
Last update
Rating
0.00 star(s) 0 ratings
Top