When you surround your tech spaces and have valuable information on your devices, a very useful complement for your environment is a private cloud in which you can store all this data.
The means to create said cloud, it is via a network attached storage device, or NAS server. The function of this device is to make copies of your information.
Among the many functions attributed to Raspberry Pi, there is also the possibility of turning it into a perfectly functional home NAS server to keep the data and files of your computers safe. If you are interested in knowing how to do it, we will explain it to you right now.
What is a NAS server and what is it for in computing?
A NAS server it is a network connected device that works as a storage unit for data and files of all configured and connected devices. Its main function is to act as a kind of remote hard drive with the ability to create your own cloud storage, but unlike cloud companies like Google, the hard drives on which the information is stored are stored in your own home.
Advantages of using your Raspberry Pi as a NAS server Why should you do this project?
Raspberry Pi has both advantages and disadvantages with its commercial counterparts when it comes to functioning as a NAS server, however, in this case, the pros outweigh the cons. As a first point in favor of the Raspberry Pi, there is the fact that its affordable price makes it a much more attractive option than a pre-configured NAS system. Besides that, It has the advantage of having a very low electrical energy consumption, to the point that one battery pack is enough to make it work as a NAS server.
Which comes in handy for a team that must be constantly up and running. Its compact size and easy portability also qualify as advantages, although We must take into account that it offers considerably lower storage capacity and processor performance than commercial NAS servers.Although, when it comes to acquiring a private cloud service, this project is an elegant and functional solution.
What are the best Raspberry Pi to use as a NAS server? The most profitable models
To turn your Raspberry Pi into a NAS server, you must select the versions that are optimal for this project.
Here is a list of the three most viable options:
Raspberry Pi 2B
The first model to take into account time to create your NAS server is the Raspberry Pi 2B. It has a Broadcom BCM2836 processor, Quad Core ARM Cortex a7, which has a response capacity of 900 mHz. This machine only has 1GB of RAM, giving it just enough processing power for the private server task.
Raspberry Pi 3B +
The Raspberry Pi 3B + offers a solid option to host your NAS server, thanks to its processor Broadcom BCM2837 with Quad Core, running at 1.4GHz. These specifications, along with their 1GB of RAM, They give you a high quality of data transmission between the computers on your local network.
Raspberry Pi 4
The Raspberry Pi 4 made a leap in technical capabilities over its predecessors. It has a powerful processor Broadcom BCM2711 at 1.5 GHz and a new 8Gb RAM capacity, making it the best equipped model to function as a NAS server in your virtual spaces. Each of these models has its own individual capabilities, These are the best options if what you want is to make your own private network server.
Materials and requirements to use Raspberry Pi as a NAS server What do I need to carry out the whole project?
The first thing you will need to create your NAS server is a Raspberry Pi in the presentation of your choice; this must have a micro SD memory in which we will install the required operating system. Besides that, you need at least two medium to high capacity storage drives. For this, you can have some memories 100GB powered USB or more capacity that will connect to the Raspberry Pi.
However, the most widely used alternative is External hard drives, these can be 2.5 inch with USB HUB or from 3.5 inches with its own electrical network. Of course also you need a stable internet connection for your Raspberry Pi. The most reliable connection method is via Ethernet cable, since it provides a better quality of data transmission.
Learn step by step how to create your NAS server with a Raspberry Pi from scratch
Once you have all the materials, now you can proceed to the installation:
Download the OS OpenMediaVault
The first thing you should do is obtain the correct operating system and install it from an external computer. From the website of Source forge you can find the image files corresponding to each version of Raspberry Pi. All you have to do is download it and write it to the SD memory.
Start the operating system and configure the input method
For this step you need to have the computer peripherals connected (keyboard, mouse and monitor). Start the Raspberry Pi and follow the steps to finish the installation process until the system prompts you for login information.
In this instance, enter the following data:
- Username: “root”.
- Password: “openmediavault”.
The standard keyboard configuration will be in English, so you must modify that aspect, this is achieved through the following command:
dpkg–reconfigure keyboard-configuration
Then select “Other” and “Spanish”. The last thing you’ll see is a series of dialogs where you can accept the default settings or set your own keyboard specifications.
Modify the password and get the IP address
To prevent unauthorized third parties from accessing the server settings, enter the following command:
passwd
Now all you have to do is enter the new password twice and confirm with the key. “Enter”, after which the message jumps “Password updated successfully”. Now, insert the command ipconfig
to display the information lines of the network to which your Pi is connected, the IP address will be identified as “Inet addr” and registered under “Eth0”. Write down and keep this address handy, as it is the address signed by the router to the NAS server.
Sign up on the web interface and secure NAS
For this step, you need a computer other than the Raspberry, this must be connected to the same network. Enter the IP address of the NAS server in the address bar of the browser.
The login credentials are:
- Username: “admin”.
- Password: “openmediavault”.
Now you have access to the OpenMediaVault start menu, which will allow you to see the available services and make the necessary settings. To secure the interface, follow the path “System”, “General settings” and “Secure connection”.
You need a certificate to be able to secure the network using SSL, to create it go to “Systems”, open the option “Certificates” and click on SSL, then press “Add” and “Keep” in the pop-up window that will appear. You just have to enable the certificate in the general settings and save the changes made.
Now what you should do is close the current session and replace HTTP in the address bar with HTTPS and start a new session via SSL. The browser will probably show a notification as it does not recognize the certificate, in which case you should add it as an exception. As soon as you have logged in again, change the password using the path “Systems”, “General settings”, “Web administrator password”.
Connect storage drives
This step is simply to connect the storage media (hard drives or USB sticks) to the Raspberry Pi NAS and configure them in the web interface. By means of the option “Data storage” in the section “File System” you will be able to see the real hard drives connected to the Raspberry Pi. In case it does not recognize them automatically, you can look for instructions in the section of “Look for”.
Set up the user profile
In the access control section of the web interface you will find the option “User”. Select the option “Add” and fill in the requested data.
Make file storage settings and customize access
In the access control option you will have the possibility to add partitions of the storage units to keep your files organized. To do this, click on “Shared folders” and press the option “Add”. From there you will find the “Home” directory, from where you can configure the paths to the folders the way you want.
In function “User”, You can add and delete access profiles to the NAS server, as well as modify the access permissions of these profiles. For this, go to “Users” and select “Add”, then enter the corresponding data, and in the option “Modify access”, You can grant or revoke permissions to users so that they can modify the stored content, read-only permissions, or no permissions at all.
Connect to the NAS server
With all the settings ready, all that is left to do is connect to the server.
The methods vary from one operating system to another:
- For linux, for example, you will access the file manager and select the option “Connect to server”, then you enter the prefix “sbm: // “ followed by the IP address of the server.
- To be able to connect Windows to the NAS server just open Windows explorer and enter double backslash “\”, before the IP address.