Samba, Deploying

Samba running on the Raspberry Pi server can come in handy in many situations.

(From “Photo Server: Turning Raspberry Pi into a photo server” by Dmitri Popov, Raspberry Pi Handbook, Special Edition 14, pg. 54)

If you have Windows machines on your local network and you want to access photos stored on the Raspberry Pi server, you should install and configure Samba software. Even if your local network is free from Windows clients, having Samba running on the Raspberry Pi server can come in handy in many situations. For example, the Photo Mate RAW processing app for Android can access photos stored on Windows shares. So, if you want to access photos stored on the Raspberry Pi server from your Android device, deploying Samba is the way to go.

To install Samba on Raspberry Pi, run

sudo apt-get install samba samba-common-bin

and add user pi to the local smbpasswd file:

sudo smbpasswd -a pi

Open the smb.conf file for editing in the Nano text editor using

sudo nano /etc/samba/smb.conf

and uncomment the security = user line. Scroll down to the end of the file and add a share definition (e.g., for photos; replace </path/to/dir> with the actual path to the directory containing photos):

[Photos]
path = </path/to/dir>
available = yes
valid users = @users
read only = no
browsable = yes
public = yes
writable = yes

Save the changes and restart Samba using

sudo /etc/init.d/samba restart

You can now access the defined share from a Windows machine or from an app that supports the SMB protocol.

For more information, visit the Samba website.

Related content