How to enable SAMBA on Raspberry Pi 4 8GB

How to enable SAMBA file sharing on Raspberry Pi 4GB

Enabling SAMBA on your raspberry pi gives you an instant directory you can use to map in a windows computer. We will be mapping the pi user directory. If you have changed to a different user you should simply change the username that is used below.

First we update and upgrade our Raspberry Pi

sudo apt update && sudo apt upgrade -y

When the update completes we need to install the samba packages

sudo apt-get install samba samba-common-bin

Once samba is installed we are going to edit our smb.conf file to the absolute basics

sudo nano /etc/samba/smb.conf

We need to delete everything in this file and replace it. You could just press delete but pressing CTRL+K is much quicker. Replace theentire text (there is a lot) and replace it with the below

netbios name = Pi
server string = The Pi File Center
workgroup = WORKGROUP

path = /home/pi
comment = No comment
create mask=0777
directory mask=0777

We need to change the default SAMBA password for the user pi

sudo smbpasswd -a pi

Add the password and then we can restart SAMBA

sudo service smbd restart

Now we can simply navigate in our windows address bar to our pi’s IP address. my pi’s IP address is so in the address bar i would type


This should present you with your Raspberry Pi default user pi files.

windows explorer

Hello there! My name is Darren and i am a hobbyist/homelab/crypto enthusiast. If you liked this post please consider signing up for a Digital Ocean account using my link and you will receive $100 in free credit while at the same time helping me to cover the costs of my servers. Thank you!

XCH: xch1hrumdza9u6slw5hz343p3yh954wvjs4rqnqdkq6huanctf0vytzqqkahxk
BTC: 1BVwmPMt6kxRe88EKhThJviFp3M4MhubTA
ETH: 0xa958d40518d76168BB795947Bf96AafD6bccc177
BAT: 0xab574A09fFf2aa391658D3D048265ad1401cA7AF
DOGE: DBCchyovcTXSioWM392kKydJxY5nyECYFB
SCP: 9f2feed9f29f3f8035e4ae2a33837ae4affa0a5b5773bcc5a33a4abb041e82e2cccb318c78ef
Share This Guide!