How to make Raspberry Pi file server using samba server

Spread the love

Did you work on multiple computers? Did you ever fill hard to transfer data between the different computers? This article will solve this problem. Here we are going to share data between different computers using samba server and setup Raspberry Pi file server.

Material required for Raspberry Pi file server

Name Quantity
Raspberry Pi any board1
Adaptor1
SD Card 16GB+1
Keyboard 1
Mouse1
Display1

Setup SD Card for Raspberry Pi file server

Install the latest Raspbian on SD card Here we have a full tutorial on how to install OS on Raspberry Pi. Follow the tutorial and install the Operating system on it. If you already have OS installed proceed to next step.

Get Ready

Power up the raspberry pi and open the terminal window. Make sure everything is up to date to do that type following command one by one.

sudo apt-get update
sudo apt-get upgrade

Install and configuring samba server

  • Raspberry pi is now up to date. The next step is to install the samba server on raspberry pi. These steps are the same for all models of Raspberry Pi.
sudo apt-get install samba samba-common-bin
  • Samba is successfully installed to your raspberry pi. The next step is to make a network storage folder. This folder can be located anywhere, including on a networked storage devices or external hard drive. In my case, I am creating the directory within the “pi” users’ home directory. Name it Shared.
 mkdir /home/pi/shared
  • We can share this folder using Samba server software. we need to modify the “smb.conf” file. To do this run the following command.
sudo nano /etc/samba/smb.conf
  • Add the following text and save it.
[pimylifeupshare]
path = /home/pi/shared 
writeable=Yes 
create mask=0777 
directory mask=0777 
public=no
  • Run the following command and set up the username and password for the samba server.
sudo smbmypasswd -a pi
  • Everything is ready now restart once the samba server. To do this type the following command in terminal.
sudo systemctl restart smbd
  • To access another computer you need a pi local IP address to get this type the following command.
hostname -I

Connect windows

  • Open “my computer” and “Map network driver“.
Raspberry Pi file server
  • In second window on “folder” option enter \\raspberrypi\shared“. Replace Shared with your folder name. then click finish button.
raspberry pi file server
  • Finally, it will ask the login details user name and password enter the samba server username and password and you are done. In my case username is “pi” and password is “smbmypassword“.

Add a Comment

Your email address will not be published. Required fields are marked *