Nextcloud data on TrueNas smb share

Discussion in 'Installation/Configuration' started by FredZ, Oct 30, 2025.

  1. FredZ

    FredZ Member HowtoForge Supporter

    Hello all
    Been working on this periodicaly for a while but can't seem to see the wood for the trees.
    I am attempting to install nextcloud on ISPconfig but have my data on an SMB share on my TrueNas server.
    I have created the website within ISPc and it is active.
    I have created the share on TrueNas. User is the website number (web22 for example) with password dissabled.
    I have created a sharepoint in fstab
    as root I can r/w the share from ISPc
    however if I attempt to write to the share as the web user (web12 for example) I get access denied.
    Clearly I have missed something but I can't seem to work out what.

    fstab
    Code:
    //10.*.*.*/nextcloud /mnt/nextcloud cifs rw,vers=3.0,credentials=/etc/.nextcloud,dir_mode=0775,file_mode=0775
    /etc/.nextcloud
    Code:
    username=web12
    Write command
    Code:
    sudo -u web12 touch /mnt/nextcloud/testfile
    Truenas is a standard smb share with web12 as the user. I din't set ACL on the TrueNas share.

    Note: I can install nextcloud natively on the server and it works just fine.

    ISPConfig 3.3.0p3
    TrueNAS SCALE Fangtooth 25.04

    Your thoughts/comments would be most helpful.

    Regards

    Fred
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member

    you don't explicitly state if the website (or ssh as the user) can read from the share.

    my initial thoughts would be that the website is using a chrooted php or open_basedir setting that simply does not give it access to the filesystem outside specific paths.

    perhaps try mounting the share to /var/www/clients/client##/web12/private/nextcloud *
    or bind mounting /etc/.nextcloud to /var/www/clients/client##/private/nextcloud in /etc/fstab

    * probably don't want it mounted directly in the /web folder for security reasons.
    or directly in /var/www/clients/client##/web##, as you'll need to play around with the immutable bit to add/delete the folder, and the private folder already exists for client data you want to keep private anyway...

    also, did you 'chown web12:client## /mnt/nextcloud' which, in retrospect, should probably have been my first thought..
     
    ahrasis likes this.
  3. FredZ

    FredZ Member HowtoForge Supporter

    So I found several things I had missed/done wrong.
    I reset the share to /var/www/clients/client1/web12/private/nextcloud
    I was trying to chown -R web12:client1 /share while the share was mounted. It doesn't work while mounted.
    The share on TrueNas had incomplete permissions. I forgot to add the group.
    I also moved the credentials file to /var/www/clients/client1/web12/private/nextcloud as suggested.
    Lastly I added /var/www/clients/client1/web12/private/nextcloud to the PHP open_basedir for the website.

    Many thanks for the initial pointer as it turned me in the write direction.

    Regards

    Fred

    I found to errors I had missed.
     
    till and ahrasis like this.

Share This Page