Install Nextcloud outside of apache2root /var/www/html directory

Hey everyone,
I already successfully installed nextcloud on an ubuntu server but what I’d like to do is to use storage from another HDD installed in my server. I have one 500GB HDD where ubuntu is installed. Now I installed a 4TB HDD and would like to use it as my nextcloud storage. I have read some posts that its not quite good to link the /data folder onto another disk so I considered to reinstall nextcloud but this time directly on the 4tb HDD.
Is it possible to install Nextcloud outside of Apache root directory?
Thanks for any help

Most likely what you want to do here is leave Nextcloud where it is but move the data folder.

Alternatively, you can move the web root and just adjust your Apache site config accordingly. You should be able to put it anywhere you like.

linkind data to an EXTERNAL hdd is not considered as a good practice ( mostly thinking on USB-like HDD.

linking data storage like the /nextcloud can be done on several differents way.

I am using a mdadm raid6 array, witch is mounted like:

  • /mnt/raid6/ /nextcloud