How to install SAMBA on Ubuntu 22.04 LTS Jammy Linux

Install and configure the SAMBA server on Ubuntu 22.04 LTS Jammy JellyFish Linux to share files and folders with Windows 7/10/11 and Linux systems. 

Samba is a free & open-source implementation of SMB protocol for integrating servers and desktops running Linux or Unix in environments with Microsoft’s Active Directory directory service. The software can be used as a controller for the domain or as a regular member.

Using SAMBA software, users can easily access the files, printers, and other shared resources on a company network or intranet, among other things. The best thing in almost all Linux distributions is that SAMBA is present in their repositories to install easily.

Samba uses the frequently used client/server protocols SMB (Server Message Block) or CIFS (Common Internet File System), which is nowadays an open variant of SMB. If applications are compatible with SMB or CIFS, they can communicate with the Samba Server.

Samba’s SMB/CIFS client is called smbclient. Some desktop variants of Linux have the Samba Client pre-installed, whereas others need to be installed manually. The source code can be found at

Steps to install SAMBA on Ubuntu 22.04 LTS

1. Run system update

Well, it is not a necessary step; however, run the system update command to rebuild the repo cache and ensure all the system-installed packages are up to date.

sudo apt update


2. Install Samba on Ubuntu 22.04

Next, use the APT package manager in your command terminal to install Samba on your Ubuntu 22.04 LTS. The packages to set it up are already in the system repository; thus, we don’t need to add anything extra.

sudo apt install samba

Check its service is active and running:

systemctl status smbd --no-pager -l

Install Samba on Ubuntu 22.04

To enable the service and start it automatically with system boot, here is the command:

sudo systemctl enable --now smbd


3. Allow samba in Ubuntu 22.04 Firewall

To connect and access the shared files over SMB protocol, we first have to allow its service in the firewall to be accessed from outside the computer. Here is the command to follow.

sudo ufw allow samba


4. Add your user to the Samba group

Let’s add the current System user to the SambaShare group so it can access all files and folders shared under it.

sudo usermod -aG sambashare $USER

Set the password for sharing: This will differ from your system password.

sudo smbpasswd -a $USER

Note: $USER means your current user. If you want to set a different user, change $USER to the particular user name. Also, the file or folder you want to share must be accessible to that user.

Alternatively, if you want to add some other users to the SAMBA group, use:

sudo usermod -aG sambashare your-user

To set a password:

sudo smbpasswd -a your-user


5. Share some Ubuntu folder

We have configured the user to use Samba; let’s test it. Let’s say you want to share the Pictures folder or any other owned by your current user.

Network Share folder in Ubuntu 22.04

Once you have decided which folder to share over the network, right-click on it, select Properties, and then select the Local Network Share tab. If you want the users to create or delete the files from the shared directory, check the box for “Allow others to create and delete files in this folder.” If you want any user to log in and access the shared folder, select the “Guest access” box; otherwise, don’t. Finally, click the “Create Share” button to create the sharing point.

Share network folder on Ubuntu 22.04

When Ubuntu’s Nautilus file manager asks you to add permission to the folder you want to share, Click “Add the permissions automatically.

Nautilus file permission


6. Access the shared folder

We use Debian and Windows 11 to access the remotely shared folder on Ubuntu 22.04. You can use macOS if you want.

#On Debian, Ubuntu, CentOS, and other Linux with Gnome

Go to File Manager and then click on the Other locations.

There, go to the Connect Server box and type your Ubuntu 22.04 Samba IP address in the following format:


In the above URL format, replace the IP address with your SAMBA server IP and Shared-folder-name with a folder that you have shared.

Connect SAMBA in Debian

When the system asks for credentials, then select “Registered User” and give your Ubuntu system user and password set to use for SAMBA.

Enter SAMBA user

Soon, you will have the content of your remote Ubuntu server via SMB protocol.

Ubuntu running samba on Debian


#On Windows 11 or 10

If you are using a Windows system and want to mount the folder shared on Ubuntu 22.04 with the help of SAMBA, then follow these steps.

Go to This PC and right-click somewhere on the blank area to select “Add a network location” from the context menu.

Add a network location in Windows 11

Now, enter the IP address and shared folder name in the following format:


Replace the server IP address with your Ubuntu IP, where you have configured the SAMBA and the shared folder name.

Add Ubuntu network location on Windows 11

Soon, the system will ask you to enter the Username and password to access the SAMBA share folders. Enter that and hit the OK button.

Enter SAMBA credentials Add network location

Finally, Ubuntu’s shared folder is mounted remotely or locally on your Windows 10 or 11 via SMB protocol.

Connect Ubuntu 22.04 Jammy Samba to Windows


Other Articles:

Install Samba on Linux Mint to share files with Windows
How to Change file, folder, or app Icons in Gnome Linux
Install XAMPP on Ubuntu 22.04 LTS
4 Ways to Install GIMP on Ubuntu 22.04…


6 thoughts on “How to install SAMBA on Ubuntu 22.04 LTS Jammy Linux”

  1. Good morning! With the Ubuntu 22.04 client already joined to the domain with Samba4. I can login with a nominal account normally, but with an account with only numbers it does not open this user’s session.

  2. Thanks,
    although when connecting to a windows share, why do we have to use an ip address, shouldn’t all the windows shares just show up in ‘files’ so they can be clicked?


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.