Sharing folders in Ubuntu is essential for managing file access across different devices within a network. This is particularly useful in environments where multiple users need to collaborate by accessing and modifying files on a central system. By setting up shared folders, you can control access and ensure that files are securely available to authorized users.

The most common way to configure shared folders on Ubuntu is by using Samba. Samba implements the SMB/CIFS protocol, allowing Ubuntu to share files with Windows and other systems. This is crucial in mixed operating system environments, where interoperability is required for efficient network management.

You can set up shared folders on Ubuntu either through the command line or a graphical interface. The command line provides detailed control, while the graphical interface offers a user-friendly approach. Both methods achieve the same goal, making shared resources accessible across the network according to your security and access requirements.

Steps to share folders via Samba or SMB on Ubuntu Desktop:

  1. Open the Files application on Ubuntu Desktop.
  2. Right-click the folder you want to share and select Local Network Share.
  3. Check the Share this folder option in the sharing settings.
  4. If prompted, install the required sharing services, such as Samba.

    This will install Samba and other related packages.

  5. Click on the Install button on the Install additional software? window.

    Click on the Description to view more details about the packages to be installed

  6. Enter your password and click on the Authenticate button on the Authentication Required window.

    Your account must have administrator privilege to be able to proceed.

  7. Wait for the installation to finish.
  8. Select other options if necessary and click on Create Share.
  9. Shared folder will now have a sharing icon.
  10. If your firewall is enabled, open the necessary ports for Samba.
    $ sudo ufw allow samba
    [sudo] password for user: 
    Rules updated
    Rules updated (v6)

    This is only required if you've enabled firewall. It is disabled by default.

  11. Test the shared folder access from another machine on the network.

This guide is tested on Ubuntu:

Version Code Name
22.04 LTS Jammy Jellyfish
23.10 Mantic Minotaur
24.04 LTS Noble Numbat
Discuss the article:

Comment anonymously. Login not required.