- Setting up permanent mount points in Linux using the fstab file and UUIDs.
- Activation and parameterization of the External Storage Support application to manage local routes.
- Volume mapping in Docker and Portainer to allow the container to access the host hardware.
- Implementing Nextcloud on Synology NAS systems to optimize collaboration and mass storage.
Have you noticed that your server space is running out? Whether you're using a small home server, a Raspberry Pi, or a more powerful machine, expanding your Nextcloud storage capacity is the best way to prevent system crashes and keep your data safe without having to delete anything. Here's how. How to connect an external hard drive or NAS to Nextcloud. An interesting solution to consider.
Depending on your infrastructure, different solutions can be used. These range from using external hard drives via USB to integrating a professional NAS system like those from Synology. The important thing is to understand that Nextcloud It is very flexible and allows you to manage storage centrally, although to achieve this you have to adjust some permissions and mounts that may seem like a world at first, but are actually quite simple.
How to add an external hard drive via USB
When you decide to connect an external hard drive to gain gigabytes, the first step is for the operating system (usually a Linux distribution like Debian or Armbian) to recognize the drive. Simply plugging it in isn't enough; you have to identify the disk partition using commands like lsblk o blkid To obtain the UUID, which is like the disk's ID. This is vital because if you use the generic name (like /dev/sdc), you could run into problems if the system changes the drive order upon reboot.
If the disk is formatted in NTFS (very common in disks used in Windows), you will need to install the package ntfs-3g so that Linux can read and write data smoothly. Once installed, you must create a folder on the system (for example, in /mnt or the root directory) that will serve as mounting pointTo avoid having to do this every time you shut down the server, you need to edit the file /etc/fstab adding the line with the disk's UUID, thus ensuring a permanent and automatic mounting.
Integration of external storage into the Nextcloud interface
Once the disk is visible to the operating system, the next step in connecting an external hard drive or NAS to Nextcloud is to get it recognized. To do this, it's essential to activate the application called External Storage Support from the cloud app store. Without this add-on, you won't see the options to add local routes in the control panel.
Within the administration settings, in the external storage section, you must choose the option local storageThis is where you specify the exact path to the folder where you mounted the hard drive. A key detail is that Nextcloud must have permissions read and write access to that folder; otherwise, you'll see a red dot indicating a connection failure. When everything is working correctly, a green dot will appear, and you can move your larger folders, such as videos, to free up space on the main drive.
Nextcloud in Docker and Portainer environments
For those using containers, connecting an external hard drive or NAS to Nextcloud is slightly different, because the container is isolated from the host system. The most common mistake is trying to add the drive within the Nextcloud app without first performing the necessary steps. volume mapping in DockerIf you use Portainer, you must configure the mounts so that a path on the host system (where the hard drive is located) is reflected in an internal container path (such as /var/www/html/data).
In a file Docker ComposeThis means adding the volume line, linking the external drive folder to the internal path. If you skip this step, even if you install the external storage app, the container won't have physical access to the server hardware. This is crucial. manage user permissions correctly so that the Nextcloud process can write to the disk mounted from the host.
Boosting the cloud with a Synology NAS
If you're looking for something more robust and professional to connect an external hard drive or NAS to Nextcloud, integrating Nextcloud with a Synology NAS It's a masterstroke. This allows for the elimination of data silos and turn your NAS into your own personal cloud centralizing all the information of a company or family on hardware specifically designed for mass storage. Installation is usually done using Docker in Synology's DSM, creating specific folders for the configuration and database.
Using a NAS not only provides more storage space, but also improves performance. collaboration across multiple devices and facilitates secure remote access. By deploying the Nextcloud stack via Portainer on the NAS, optimized containers are created that allow for much more efficient data flow management than a USB drive, also offering redundancy and backup capabilities that protect the information against physical disk failures.
Connecting an external hard drive or NAS to Nextcloud involves everything from configuring a USB drive to be permanently mounted using the fstab file and installing ntfs-3g drivers, to managing volumes in Docker or deploying a Synology NAS. Whether enabling the External Storage Support app for local paths or mapping folders in Portainer, the goal is always to free up space on the primary drive and centralize data on larger, more secure storage to ensure cloud stability.
Editor specialized in technology and internet issues with more than ten years of experience in different digital media. I have worked as an editor and content creator for e-commerce, communication, online marketing and advertising companies. I have also written on economics, finance and other sectors websites. My work is also my passion. Now, through my articles in Tecnobits, I try to explore all the news and new opportunities that the world of technology offers us every day to improve our lives.
