Raspberry Pi: Set up your own file server (NAS)
Having your own file server is very convenient. Unfortunately, finished NAS systems still cost a lot of money. With the Raspberry Pi, however, you can also build your own NAS. You can find out how to do this in this practical tip.
Raspberry Pi: Set up your own file server (NAS) - how it works
Setting up your own NAS is not difficult and can be done in just a few steps. In this case we will show you the steps for a Pi with Raspbian.
- First run the command "sudo apt-get update && sudo apt-get upgrade" to bring Raspbian up to date.
- Then execute the commands "sudo apt-get install samba samba-common-bin -y", "sudo apt-get install apache2 -y" and "sudo apt-get install php5 mysql-server -y". You may have to set a strong password for MySQL.
- Then use the "sudo chown -R pi / var / www / html" command to give your Raspberry Pi standard account access to a system folder.
- Also create a new directory using the sudo mkdir -m 1777 / share command.
Configure Samba correctly
Then you have to configure the "Samba" service. This can be done with the command "sudo leafpad /etc/samba/smb.conf". Add the following entry at the very end of the file. Don't forget to save the file at the end.
- [Share]
- Comment = Pi network drive
- Path = / share
- Browseable = yes
- Writeable = Yes
- only guest = no
- create mask = 0777
- directory mask = 0777
- Public = yes
- Guest ok = yes
Raspberry Pi: Start NAS
After completing all of the above steps, you can start the server.
- To do this, first set a password for Samba using the "sudo smbpasswd -a pi" command.
- Finally, you can start the server with the command »sudo /etc/init.d/samba restart«.
- Now you can access the cloud on your network with an internet-enabled device. To do this, open the file explorer in Windows and click on "Network".
In the next practical tip we will show you how you can control your Raspberry Pi with your smartphone.