Home
Buy Me a Beer
Support my work!
Linux Guide

How to Install Samba

Share files across your network with this easy-to-follow guide

Samba is an open-source implementation of the SMB/CIFS networking protocol, allowing file and printer sharing between Linux and Windows systems. This comprehensive guide will walk you through installing and configuring Samba on Ubuntu-based distributions.

1 Update Package Repositories

sudo apt update

Updates the package list from all configured repositories to get the latest version information.

2 Install Samba Package

sudo apt install samba

Installs the Samba package along with its dependencies from Ubuntu's repositories.

3 Create Shared Directory

mkdir /home/tom/examplefolder

Creates a directory that will be shared with other network users.

4 Edit Samba Configuration

sudo nano /etc/samba/smb.conf
[Example Folder]
comment = Tom's example folder
path = /home/tom/examplefolder
read only = no
browsable = yes

Add this configuration block at the end of the file to define your shared folder settings.

5 Restart Samba Service

sudo service smbd restart

Applies your configuration changes by restarting the Samba service.

6 Configure Firewall

sudo ufw allow samba

If you're using UFW firewall, this command allows Samba traffic through.

7 Create Samba User

sudo smbpasswd -a tom

Sets a Samba-specific password for the user account. You'll be prompted to enter and confirm the password.

Success!

You've successfully installed and configured Samba! Your shared folder should now be accessible from other devices on the network.