Question about nextcloud users folder


New to Nextcloud here.

As far as I know, when you install Nextcloud on TrueNAS, it creates its own directory structure somewhere. Is this reasonable to leave it as it is or you guys are moving the users directory where TrueNAS users root directory reside?

Another words, for example I have created a user John in TrueNAS, so the directory structure will be like:

→ Documents
→ Photos
→ Media

Can this directory be used for John created in Nextcloud under the same username John?


Yes, you can configure Nextcloud to use directories that are already set up for your TrueNAS users. This can be good for data organization and users can access the same files regardless, whether they log in through TrueNAS or Nextcloud.

You need to make sure the Nextcloud data directory and the TrueNAS user directories are accessible and have the correct permissions

chown -R www-data:www-data /mnt/homes/John
chmod -R 755 /mnt/homes/John

1 Like

That’s great!

Can I set the users folder through Nextcloud UI or I have to manually change config file in CLI?

It depends how many users you have. For one user you can set the users’ folder through the Nextcloud UI using the External Storage feature. But to change the default data directory for all users, you would need to modify the configuration file via the CLI.

1 Like

ok thanks a lot!!

Your welcome Lev :+1:

Interesting, how in this case, TrueNAS and Nextcloud will “cooperate” with already existing users there?

Yes, thats right, when integrating TrueNAS and Nextcloud with already existing users, the goal is to ensure that both systems can access and manage user data.

so do I have to go through additional steps or they will work well together when I set Nextcloud config file to use that folder?

If you want to change the default data directory for all users, you’ll need to modify the Nextcloud configuration file. This requires CLI access.

  1. Stop the Nextcloud Server: Stop the Nextcloud server to prevent any conflicts during the configuration change.
service nextcloud stop
  1. Move Existing Data (if any): If you have existing data, move it to the new location. For example:
mv /path/to/nextcloud/data /mnt/homes/nextcloud_data
  1. Update the Configuration File: Edit the config.php file to update the data directory path. The configuration file is typically located at /mnt/POOLNAME/iocage/jails/nextcloud/root/path/to/config/config.php.
nano /mnt/POOLNAME/iocage/jails/nextcloud/root/path/to/config/config.php

Find the line that specifies the data directory and update it:

'datadirectory' => '/mnt/homes/nextcloud_data',
  1. Set Correct Permissions: Ensure the new data directory has the correct permissions:
chown -R www-data:www-data /mnt/homes/nextcloud_data
chmod -R 755 /mnt/homes/nextcloud_data
  1. Start the Nextcloud Server: Start the Nextcloud server again.
service nextcloud start

By changing the config.php file, you set a new default data directory for all users. This method is more invasive and should be done with caution, make sure you have backups and do proper testing before applying it to a production environment.

1 Like

Unlimited thanks to you, my friend!!!

1 Like


Finally got back to the nextcloud…

what makes me uncomfortable is that you are pointing to nextcould_data directory within the users directory. There shouldn’t be anything but directories corresponding to the user names, no?

Here’s the installation screen

I’m pointing Nextcloud Used Data Storage to be TrueNAS user’s parent folder. Is this correct? Also do I have to check “Enable ACL?”

Also some say that it’s better to create a special dataset for nextcloud appdata and posgress data, but what’s wrong if this will be default ix-applications dataset?