How to Make Raspberry Pi File Server Using Samba Server

Did you work on multiple computers, did you ever find it tough to transfer data between the different computers. This article will answer the above statements. Here, we are going to share data between different computers using the Samba Server and set up the Raspberry Pi file server.

Material Required for Raspberry Pi File Server

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

Setup SD Card for Raspberry Pi File Server

Install the latest Raspbian on the 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, then proceed to the next step.

Get Ready

Power up the Raspberry Pi and open the terminal window. Make sure that everything is updated. To do that, type the following command one by one.

sudo apt-get update
sudo apt-get upgrade

Installing 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 the models of Raspberry Pi.
sudo apt-get install samba samba-common-bin
  • Once, Samba is successfully installed on your Raspberry Pi, the next step is to make a network storage folder. This folder can be located anywhere, including networked storage devices or external hard drives. In my case, I am creating the directory within the “Pi” users home directory and naming it Shared.
 mkdir /home/pi/shared
  • We can share this folder using Samba Server software. We just 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 the samba server once. To do this, again type the following command in the terminal.
sudo systemctl restart smbd
  • To access another computer, you need a Pi local IP address. To get it, type the following command-
hostname -I

Connect Windows

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

Leave a Comment