Using with external NAS

Dear Experts,
I have a question.
We have 2 units in our rack in the same network.

  1. One Server unit which Nextcloud server installed.
  2. One NAS Unit which all files considered to be stored.

How we can make Nextcloud to store files and all users to use (share, sync) files in the another device (NAS) located in the same network.

I would setup a nfs connection on the Nextcloud host to the location where you want to store data then add that in Nextcloud as data location

this requires package nfs-kernel-server on debian and variants

on the share edit /etc/exports
add line below adjust network might be or single ip being the nc host ip see ( Netmask Quick Reference Chart )


then run

exportfs -ra

on the NC Host edit /etc/fstab
add line below and point to your nas IP /media/cloud/directory/to/share nfs defaults 0 0

of course make sure the directory exists.

sudo mkdir -p /media/cloud

mount -a

add /media/cloud/directory/to/share to your config.php as datadirectory

verify that /media/cloud is owned by root 755
and /media/cloud/directory and up is owned by www-data:www-data 750

1 Like

If you use one server as (only) storage you may or may not distribute the load (speed of network transfer vs. local storage) but double your outage risk - Nextcloud is broken in each of the servers fails.

There might be reason to split Nextcloud installation over two servers I would rather suggest running Nextcloud on one server and user the second as backup destination. Depending on your need you might have the second server just store your backups or become a cold standby (by doubling all the installation steps) so you could easily swap in case of failure…

Dear wwe,
Thanks for your reply. I have problem with the limit of the storage capacity in the server where Nextcloud server installed.
What about installing nextcloud server on the NAS server itself where all files going to be stored? I am planing to buy Synology NAS by the way.

using a Synology nas is possible.

but keep in mind that once your NAS is full where you gonne store data next.