How to Install and Configure Samba on Ubuntu 16.04 | 18.04 | 20.04

Samba is an open-source programming suite that sudden spikes in demand for Unix/Linux based stages however can speak with Windows customers like a local application. So Samba can offer this assistance by utilizing the Common Internet File System (CIFS). At the core of this CIFS is the Server Message Block (SMB) convention.


In this post, We will install and Configure Samba on Ubuntu 16.04 | 18.04 | 20.04

Step 1: Update and Upgrade System

You need to update and upgrade the ubuntu system by using the command.

$ sudo apt-get update && sudo apt-get upgrade -y

Step 2: Install Samba Server

To install samba Server just use the following command.

$ sudo apt-get install samba -y

By default, You will get running state of Samba sevrer, To get verify use the following command.

$ sudo systemctl status smbd

Step 3: Configure Samba

You need to create a Samba share directory to network and add the entry in Samba configuration file, Use the following steps for that.

$ sudo mkdir /mnt/samba-share

After this you need to open the samba config file.

$ sudo vim /etc/samba/smb.conf

Add the following parameters like this.

[samba-share]
comment = Samba Shared Diretory
path = /mnt/samba-share
read only = no
browsable = yes

Save and Exit from Vim editor.

Step 4: Configure Samba User

You need to create Samba user to access the Samba’s shared directory from another machine, You can create a new user or user existing user of your machine, In my case, I am creating new user.

$ sudo useradd sambauser
$ sudo sudo smbpasswd -a sambauser

You will be asked for set the password for Samba user account.

Step 5: Restart Samba Service

To get effects, You need to restart the Samba service by using the following command.

$ sudo systemctl retart smbd && $ sudo systemctl status smbd

Step 6: Update UFW Firewall

If you have enabled UFW firewall, SO then you need to allow Samba port by using the following command.

$ sudo ufw allow ‘Samba’
$ sudo ufw reload


Here Your Server side installation and configuration is completed…

How to Install and Configure Samba on Ubuntu 16.04 | 18.04 | 20.04

One thought on “How to Install and Configure Samba on Ubuntu 16.04 | 18.04 | 20.04

Leave a Reply

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

Scroll to top