If you have a NAS that you've either purchased as a NAS or built from an old PC, you'll need a way to access it remotely. There are a few ways to do so, and many different NAS software will actually have a file-sharing system built into the operating system. For example, I use TrueNAS, and it has support for many different file sharing methods, and you can install other ones too. These are some of the best ways to access any of the best NAS on Linux.

This tutorial uses TrueNAS Scale as the NAS software, but it should be similar to TrueNAS Core and will differ more from other NAS software.

Nextcloud

This is the way that I personally use my NAS the most for file sharing, and the reason I do is that it's accessible from any device, not just a Linux machine. It's used through a web browser, and there are mobile apps too, and you can automate file syncing and more. My personal setup has a shared data volume between Nextcloud and Photo Prism (a Google Photos alternative), and I have my photos automatically back up from my phone to this data volume. I also store other data too in my Nextcloud instance, like backups.

If you want to set up Nextcloud, it's pretty easy from your TrueNAS instance.

Step 1: Download the Nextcloud app

Simply search for Nextcloud in TrueNAS and configure it. You'll need to set a username and a password and also configure the port that you use to connect to it. I don't recommend setting it up so that you can access it externally without a VPN, as then you would be making your personal files vulnerable to attackers.

Step 2: Connect to Nextcloud

Once Nextcloud is installed, navigate to the IP address of your NAS and the port you install Nextcloud to, and you should be faced with a login screen. Once you log in, you'll be faced with a file explorer and the ability to upload files and store them, and the mobile apps can automatically back up certain files and folders to other folders on your Nextcloud instance.

File sharing via NFS

Network File Sharing is another great way to access your files on a NAS from Linux, and it works really well. Most NAS setups will probably support it, and there's very little you'll need to do to get it working. You'll need to be somewhat comfortable with the terminal to get it working, but your file manager may also support natively mounting NFS storage.

Step 1: Enable NFS on your NAS

If you're using TrueNAS, NFS won't be enabled by default, though there is a module to do so. Simply enable it under the Shares options, and make sure you enable NFS4 in the advanced options.

Step 2: Make sure you have NFS installed

You may not have NFS installed, though most Linux distributions would. To make sure, though, run the following command in Terminal.

sudo apt-get install nfs-common

Step 3: Mount your NFS storage

First, you'll need to create a directory that you want to mount your storage to. For example, you could do the following, making sure to change "adam" to your username.

mkdir /home/adam/Documents/Test

Using the "Test" folder in Documents as the place where your files will show up. Next run, the following command to complete the connection.

sudo mount -t nfs {IPaddressOfSystem}:{path/to/nfsShare} {localMountPoint}

In my case, I did:

sudo mount -t nfs 192.168.1.5:/mnt/Storage/TestingContainer /mnt/Test

And I could then access my files in /mnt/Test on my Linux system. You may need to grant further access to read or write to the NFS share depending on your configuration, but this will get you connected to your file system on your NAS.

Accessing your NAS on Linux

There are countless ways that people have thought of to connect to their NAS on Linux, but these are two popular ways and two of the ways that I would personally do it. You could also try to do an SMB share, or you could use other apps that can be used like Nextcloud to turn your NAS into essentially a cloud-based storage solution. With a NAS you have a lot of options and a lot of freedom to explore, and we highly recommend that you do so!