Question

Add local Digital Ocean Volume to Nextcloud as additional storage?

Hi, I have seen many tutorials explaining how to entirely move the Nextcloud data directory, but I’m wondering if it is possible to keep the current data director, and also add a Digital Ocean Volume located at “/mnt/new-volume”?

For example, can I list more than one directory in the config file:

 'datadirectory' => '/var/www/nextcloud/data',

Alternatively, are there security reasons for just moving outside the “/var/www/nextcloud/data” directory completely?

Thank you!

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Keeping your data directory in the /var/www/nextcloud/data directory is not the best idea security wise because it could lead to an easier compromise for a hacker (potentially through command injection or some other method). The chances of this being the case may not be very high but still it’s always a good idea to add another layer of difficulty for those trying to remotely exploit your system.

If I were you, rather than adding multiple data directories (not sure if that’s even possible tbh) I would check out the External Storage plugin for Nextcloud: https://docs.nextcloud.com/server/9/admin_manual/configuration_files/external_storage_configuration_gui.html. When going to add storage you can choose local storage and select your DO volume.

You can also mount other shares using the occ command implemented in Nextcloud 9: https://docs.nextcloud.com/server/9/admin_manual/configuration_server/occ_command.html#files-external-label.

Hopefully this gives you a helpful starting point! If you need help totally say so and I can try to start experimenting on my own Nextcloud instance and give you some sort of walkthrough on the commands you would need to use.

Keeping your data directory in the /var/www/nextcloud/data directory is not the best idea security wise because it could lead to an easier compromise for a hacker (potentially through command injection or some other method). The chances of this being the case may not be very high but still it’s always a good idea to add another layer of difficulty for those trying to remotely exploit your system.

If I were you, rather than adding multiple data directories (not sure if that’s even possible tbh) I would check out the External Storage plugin for Nextcloud: https://docs.nextcloud.com/server/9/admin_manual/configuration_files/external_storage_configuration_gui.html. When going to add storage you can choose local storage and select your DO volume.

You can also mount other shares using the occ command implemented in Nextcloud 9: https://docs.nextcloud.com/server/9/admin_manual/configuration_server/occ_command.html#files-external-label.

Hopefully this gives you a helpful starting point! If you need help totally say so and I can try to start experimenting on my own Nextcloud instance and give you some sort of walkthrough on the commands you would need to use.

Keeping your data directory in the /var/www/nextcloud/data directory is not the best idea security wise because it could lead to an easier compromise for a hacker (potentially through command injection or some other method). The chances of this being the case may not be very high but still it’s always a good idea to add another layer of difficulty for those trying to remotely exploit your system.

If I were you, rather than adding multiple data directories (not sure if that’s even possible tbh) I would check out the External Storage plugin for Nextcloud: https://docs.nextcloud.com/server/9/admin_manual/configuration_files/external_storage_configuration_gui.html. When going to add storage you can choose local storage and select your DO volume.

You can also mount other shares using the occ command implemented in Nextcloud 9: https://docs.nextcloud.com/server/9/admin_manual/configuration_server/occ_command.html#files-external-label.

Hopefully this gives you a helpful starting point! If you need help totally say so and I can try to start experimenting on my own Nextcloud instance and give you some sort of walkthrough on the commands you would need to use.