How to turn a Raspberry Pi into a NAS

A Raspberry Pi is a very useful microcomputer for certain tasks that do not require much calculation process, since its CPU is very limited in this regard. Based on ARM we can find several models with different CPUs and amount of RAM , the number of input and output ports available in each version also changes. As it has multiple USB ports we can add USB storage and turn your Raspberry Pi into a NAS , we are going to show you how to do it.

A NAS (abbreviations for Network Attached Storage or Network Storage) allows us to access information hosted on this server . For this we can use a local network or connect to the NAS through the internet and access from our mobile or a computer connected to the internet from any location. Simply with a Raspberry Pi you can convert it to give it this utility , if you have it at home you can take advantage of it with this function or many others that are available .

The use of a Raspberry Pi as an emulator for video games or old video consoles is also well known , there are ISO images on the internet with operating systems dedicated to emulation that also include a multitude of games from different consoles. Additionally, a Raspberry Pi can be used as a VPN server or print server . Once your Raspberry Pi is converted to a NAS, you can even save the photos as a backup .

The Raspberry also consumes very little electricity and does not generate noise due to its passive dissipation, it also takes up very little space and we can place it practically anywhere there is a plug, although it would be advisable to use a network cable instead of Wi-Fi , to this we will also need to have a nearby RJ45 connection. Nothing prevents you from placing it next to the router that you surely have these two connections.

Material and steps necessary to convert the Raspberry PI into a NAS

Before starting to convert our Raspberry Pi into a NAS we will need the following materials:

  • Raspberry Pi(we will use a Raspberry Pi 3 Model B).
  • suitable power adapter, for a Pi 3 2.5 A is needed
  • microSDcard of at least 8 GB .
  • Some external storage unitto host the data. You can use a Pendrive or a USB external hard drive .
  • The Free Raspberry Pi ImagerSoftware  .

We will also need to make several adjustments once the Open Media Vault software is installed that will allow us to share the content of the connected USB devices, we will have to perform the following actions :

Steps to Convert the Raspberry Pi into a NAS

  1. Install the Raspberry PI OS(formerly known as Raspbian)
  2. Install Open Media Vault
  3. Create an SSL certificatefor secure connections
  4. Prepare disks or USB drives
  5. Sharefolders on USB drives
  6. Create usersto access the NAS
  7. Enable servicesto connect to NAS (Samba SMB)

In the following sections we will see in detail how to perform all these steps in a simple way. Let’s start by installing the operating system that will also serve us in case we want to use the Raspberry Pi as a desktop computer.

Install Raspberry Pi OS step by step

The first step is to  install the Raspberry Pi OS , formerly known as Raspbian. Let’s see how to do it.

  1. First of all, we  download Raspberry Pi Imager from its websiteand run it. Its use is very simple.
  2. We insert the microSD card either in a reader or in an adapter, the content of the card will becompletely removed .
  3. We select the version of the Raspberry Pi OSthat we want to install, in our case we will use the normal version, since it also includes the desktop in case we want to connect it to a television or monitor and see what we are doing.
  4. Now we select the inserted microSD cardin Raspberry Pi Imager , this program will only recognize the microSD or pendrive cards, so we will not be able to delete the contents of the hard disk by mistake.
  5. Finally, we click on Write, it will take a few minutes. Ignore if a Windows file explorer window appears, wait for it to finish, close everything and safely remove your microSD.

With the system installed on the microSD, we insert it into the Raspberry Pi and start the system , the first time it may take a little longer, since you have to finish installing and expanding the partition , a little patience. You will have to perform the initial configuration once we see the desktop or the console, depending on the system you have installed.

Now it would be advisable to install all the updates , it can be done in the initial wizard or with the commands sudo apt update && upgrade in the terminal. It is recommended to connect the Raspberry Pi by cable , as the updates can be heavy.

Once finished, we restart and we will have the Raspberry Pi ready to configure the software to use it as a NAS .

How to Install and Configure Open Media Vault for NAS Features

After having the operating system running and updated, we will begin with the installation of the software that we will configure to turn your Raspberry Pi into a NAS.

Install Open Media Vault

Now we will have to install the software that will be in charge of doing the NAS functions , the most used and widespread is OpenMediaVault . For this we will use the terminal and the wget command to download and install this software.

  1. We open the terminal.
  2. We write the command to install OpenMediaVault:
    1. Wget -O https://github.com/OpenMediaVault/-Plugin-Developers/installScript/raw/master/install | sudo bash
  3. You have to have a little patience, since this software takes a lot of time and can take several minutesto finish. Once the installation is finished , the Raspberry Pi will restart .
  4. Now we open the terminal to see the IP address assigned to the Raspberry Pi if we do not know it. For this we write the command ifconfigand it will show you the local ip that will be of the type 192.168.1.XXX.
  5. We open the browser and write this IP address to access the Open Media Vault configuration.
  6. We write the default username and password which is:
    1. User: admin
    2. Password: openmediavault

Once in the Open Media Vault interface we will have access to the different configurations that this software allows us.

Create an SSL certificate for secure connections

First, we will create an SSL certificate so that our connections are secure .

  1. For this we go to the Certificatessection of the System menu , we change to the SSL tab and click on add and add
  2. We add the data from the Name of the Organization section, the rest we leave as it was. This step is optional, just adding the Country is enough. We click on Save .
  3. Now we go to General Options inthe System section and enable the SSL / TLS box in the Secure Connection section In Certificate we select the one we just created from the drop-down, only that one should appear.
  4. We check the Force SSL / TLS boxto always have a secure connection.
  5. Now we click on Saveat the top left, apply the changes and close the connection to reopen it as secure .
  6. The browser may warnus of the risk until we add it as an exception as it is a self-signed certificate.

Prepare disks or USB drives

Now we will verify that the connected disk or disks are recognized and prepare them to start using them as storage. If we haven’t connected them yet, this is the time.

  1. To see the connected disks go to the Storagesection and select Disks . The microSD card will appear with the system and the connected disk (s).
  2. To add the partitions to the NAS system we go to the File Systemsection , and click on the Create button .
  3. Now we select the disk that we want to erase to add it to the NAS system from the Devicedrop-down .
  4. We write a Volume label. We leave the File System in EXT4 and click OK.
  5. Now we will have to wait a few minutes for it to finish, the process is long, so be patient. Once finished repeat the operationif we have more than one disk or unit connected.
  6. To finish we will have to mount the disks that we have added by clicking on the Mountbutton .

Share folders on USB drives

Then we will have to add this disk or disks to the shared drives so that we can save the data on it.

  1. We enter Access Permissionsin the Shared Folders option .
  2. We click on Addand select the name, the disk to share and a folder where to save the data.
  3. We click on Saveand apply the changes.

Create users to access the NAS

The next step is to create a user to connect to the NAS with in order to access the data. We will configure as many users as people will access to which we can also give different privileges.

  1. We enter the Usersection within Access Permissions to see the current users. The PI user that we must leave as is will appear.
  2. We click on Addand again on Add and fill in the fields that it asks for. We save the configuration.
  3. We select the user and click on Privileges, add the permissions we want for this user. We click on Save .
  4. Repeat the steps to configure as many users as we want.

Enable services to connect to NAS (Samba SMB)

Now we will use the standard protocol to access the NAS data. For most systems it is better to use Samba (SMB) , but you can choose any other.

  1. In the Servicessection we select SMB / CIFS and click to enable it.
  2. Now we go to the Sharedtab and click Add .
  3. We select the folder that we have shared previouslyand click on Save .

We already have our Raspberry Pi configured to be used as a NAS.

Access the NAS via SMB (Samba)

We can only access it from the computer through the SMB protocol by writing \\ IP_Raspberry_address in a file explorer window. You can also search for the Raspberry PI from the network section of the browser to access the data according to the assigned permissions.

To add extra storage units we can follow the steps above to format the unit, add the shared folders and give the corresponding permissions to the users. You can add as many disks or USB drives as the Raspberry allows , although in some cases it will be better if you add your own power to the USB drives .

We can also use our new NAS through the internet, for this we can create our own VPN network that will make us enter the local network where we have our Raspberry PI to access or save data on it. We have a complete guide to creating your own VPN with OpenVPN .

An inexpensive and easy-to-set up NAS

As you have seen, with a microcomputer for just 35 euros and an old, unused hard drive that we have at home, we can build our own network storage server . An inexpensive NAS, but very functional if we want to have our backup copies separated or if we need to access content from several computers without depending on a dedicated server.

We can also have  our own VPN  to remotely access the NAS in addition to all the resources on our network. With this VPN it will not matter where you are, you will only need internet access to use the data on our NAS. In addition, the NAS service can be complemented with other services such as a print server for example.

If you are thinking of getting a NAS and you have these components at home, you can try creating your own by following our guide.

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment