{"id":47789,"date":"2024-12-23T13:20:18","date_gmt":"2024-12-23T13:20:18","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=47789"},"modified":"2025-10-13T02:07:35","modified_gmt":"2025-10-13T02:07:35","slug":"share-public-certain-folders-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2024\/12\/share-public-certain-folders-ubuntu\/","title":{"rendered":"How to Share &#8216;Public&#8217; or Certain Folder in Ubuntu 24.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/yaru-sharefolder.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-47790\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/yaru-sharefolder-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/yaru-sharefolder-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/yaru-sharefolder-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/yaru-sharefolder-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/yaru-sharefolder-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/yaru-sharefolder.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This tutorial shows how to share either the Public or certain user folder for local network access in Ubuntu 24.04 or Ubuntu 24.10 with default GNOME desktop.<\/p>\n<p>There are quite a few applications designed for local network file sharing\/transferring, but for Ubuntu and other Linux with GNOME, there are built-in services to share user specific folder\/folders for local access.<br \/>\n<!--more--><\/p>\n<p><b>NOTE: This tutorial is written for the default GNOME Desktop, while option 2 also works for MATE.<\/b><\/p>\n<h3>Option 1: Share Public Folder<\/h3>\n<p>In user&#8217;s home directory, there&#8217;s by default a &#8220;Public&#8221; folder specifically designed for sharing files over local network. It is handled by <a href=\"https:\/\/gitlab.gnome.org\/GNOME\/gnome-user-share\" target=\"_blank\" rel=\"noopener\"><code>gnome-user-share<\/code><\/a>, a small package that creates a dav server with Apache2 run in the background.<\/p>\n<p><b>1.<\/b> First, open terminal (Ctrl+Alt+T) and run command to make sure you have installed the <code>gnome-user-share<\/code> package:<\/p>\n<pre>sudo apt install gnome-user-share<\/pre>\n<p><i>Run <code>sudo apt update<\/code> to refresh cache if it says &#8216;Unable to locate package&#8217;.<\/i><br \/>\n<a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-gnome-usershare.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47791\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-gnome-usershare-700x394.webp\" alt=\"\" width=\"610\" height=\"343\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-gnome-usershare-700x394.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-gnome-usershare-300x169.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-gnome-usershare.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>2.<\/b> Next, launch or re-launch Settings (GNOME Control Center) and navigate to &#8220;Sharing&#8221; in left. Then, you can click &#8220;File Sharing&#8221; in right and enable the service.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/enable-gnome-usershare.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47792\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/enable-gnome-usershare-700x462.webp\" alt=\"\" width=\"610\" height=\"403\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/enable-gnome-usershare-700x462.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/enable-gnome-usershare-300x198.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/enable-gnome-usershare-768x507.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/enable-gnome-usershare.webp 971w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>That&#8217;s it. You can now try to access the &#8216;Public&#8217; folder in this computer from other machines in the same network.<\/p>\n<p><b>Though, you need first to find out which port the service is listening on<\/b> by running command:<\/p>\n<pre>lsof -i<\/pre>\n<p>Wait a few seconds for the command done, and \u00a0check the TCP port for &#8216;apache2&#8217;.<\/p>\n<p><b>NOTE: The port is NOT fixed! It changes every time you start\/restart the &#8216;File Sharing&#8217; service, such as log out and log back, or connect and disconnect to VPN. It&#8217;s NOT a good choice if the Ubuntu computer is running behind firewall.<\/b><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/lsofi.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47793\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/lsofi-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/lsofi-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/lsofi-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/lsofi.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>How to Access the &#8216;Public&#8217; folder from other machines<\/h4>\n<p><b>For Windows<\/b> (tested in Windows 10), simply open file explorer and type <b>\\\\server-ip-address@port-number\\DavWWWRoot<\/b> (e.g., \\\\192.168.0.104@40125\\DavWWWRoot) in address bar and hit enter. Then, input user <b>guest<\/b> and the password you set in last step to get access.<\/p>\n<p>Or, right-click on &#8220;This PC&#8221; in the file explorer window and choose &#8220;Map network drive&#8230;&#8221;. Then, type the address above as the folder path and mount it on left pane.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-davaccess.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47794\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-davaccess-700x333.webp\" alt=\"\" width=\"610\" height=\"290\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-davaccess-700x333.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-davaccess-300x143.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-davaccess-768x366.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-davaccess.webp 863w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>For Linux<\/b> with GNOME or KDE desktop, your file manager should automatically find the shared folder. Just open file manager and look for it under either &#8220;Other Locations&#8221; or &#8220;Network&#8221;.<\/p>\n<p>If your Linux file manager does not show you the remote share folder, try installing <code>gigolo<\/code> tool via the command below:<\/p>\n<pre>sudo apt install gigolo gvfs gvfs-backends<\/pre>\n<p>Then launch gigolo, and go to menu &#8220;Actions -&gt; Connect&#8221;. In pop-up dialog, choose WebDAV service, input server IP, listen port, user (guest) and connect.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/xfce-gigolo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47795\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/xfce-gigolo-700x523.webp\" alt=\"\" width=\"610\" height=\"456\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/xfce-gigolo-700x523.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/xfce-gigolo-300x224.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/xfce-gigolo.webp 735w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>For macOS, try <a href=\"https:\/\/www.webdavsystem.com\/server\/access\/macosx\/\" target=\"_blank\" rel=\"noopener\">this step<\/a> to get access, though I don&#8217;t have a mac computer to try it out. For Android and iOS, you need to install a dedicated app such as WebDAV Navigator from Google Play or App Store.<\/p>\n<h3>Option 2: Share a Certain Folder via samba<\/h3>\n<p>If you want to share a certain folder and its content, then try samba with nautilus extension.<\/p>\n<p><b>Tips: this option also works for MATE Desktop (e.g., Ubuntu MATE, Linux Mint MATE edition). Just replace <code>nautilus-share<\/code> with <code>caja-share<\/code> in the command below.<\/b><\/p>\n<p><b>1<\/b>. First, press Ctrl+Alt+T on keyboard to open up a terminal window. Then, run command to install the extension for Nautilus file manager:<\/p>\n<pre>sudo apt install nautilus-share<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-nautilusshare.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47796\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-nautilusshare-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-nautilusshare-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-nautilusshare-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/apt-nautilusshare.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>2<\/b>. Next, run command <code>nautilus -q<\/code> to quit nautilus file manager and then re-launch it. Right-click on the target folder and you&#8217;ll see the &#8220;<b>Sharing Options<\/b>&#8221; option.<\/p>\n<p><b>Tips:<\/b> For Ubuntu 22.04 and earlier, the context menu option is &#8220;Local Network Share&#8221;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/noble-shareoptions.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-47797 aligncenter\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/noble-shareoptions-700x490.webp\" alt=\"\" width=\"610\" height=\"427\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/noble-shareoptions-700x490.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/noble-shareoptions-300x210.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/noble-shareoptions-768x538.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/noble-shareoptions.webp 897w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>3<\/b>. Just click on that option will pop-up the dialog to enable folder sharing for the selected folder.<\/p>\n<p>If you want to grant both read &amp; write permission, then enable &#8220;Allow others to create and delete files in this folder&#8221;. And, it will ask to confirm adding that permission once you clicked &#8220;Create Share&#8221;.<\/p>\n<p>To allow anyone to access without authentication from the same network, also enable &#8220;Guest access&#8221;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/samba-share.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47798\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/samba-share-700x527.webp\" alt=\"\" width=\"610\" height=\"459\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/samba-share-700x527.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/samba-share-300x226.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/samba-share-768x578.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/samba-share.webp 822w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>If you got &#8220;<em>&#8216;network share&#8217; return 255<\/em>&#8221; error, open terminal (Ctrl+Alt+T) and run command to add current user to &#8216;sambashare&#8217; group.<\/p>\n<pre>sudo gpasswd --add $USER sambashare<\/pre>\n<p>Also run command to add a <b>separate password to current user for share folder authenticate purpose:<\/b><\/p>\n<pre>sudo smbpasswd -a $USER<\/pre>\n<p>After that, <b>restart your computer<\/b> and re-do the last step 2 and step 3 to enable folder sharing.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-39487\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sambapasswd-600x188.webp\" alt=\"\" width=\"600\" height=\"188\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sambapasswd-600x188.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sambapasswd-300x94.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sambapasswd-768x240.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sambapasswd.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h4>How to access this certain share folder:<\/h4>\n<p>For <b>Windows<\/b>, open either &#8220;Run&#8221; command box or file explorer , type <code>\\\\ubuntu-machine-ip<\/code> in address bar and hit Enter. Then, type username (your user in Ubuntu) and password (the separate password you set in previous step) to get access.<\/p>\n<p>For choice, you may right-click on &#8220;This PC&#8221; in file explorer, and use &#8220;Map network drive&#8221; option to map the share folder into left pane.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-access-samba-share.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47799\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-access-samba-share-700x425.webp\" alt=\"\" width=\"610\" height=\"370\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-access-samba-share-700x425.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-access-samba-share-300x182.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-access-samba-share-768x467.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/12\/windows-access-samba-share.webp 1050w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>For Linux user (only tested in GNOME), open &#8220;Files -&gt; Other Locations&#8221; and type <code>smb:\/\/ubuntu-machine-ip<\/code> in button to connect.<\/p>\n<p>For MacOS, press <b>command + K<\/b> on keyboard to open Connect to Server dialog, type <code>smb:\/\/ubuntu-machine-ip<\/code> and hit Enter to access.<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to share either the Public or certain user folder for local network access in Ubuntu 24.04 or Ubuntu 24.10 with default GNOME desktop. There are quite a few applications designed for local network file sharing\/transferring, but for Ubuntu and other Linux with GNOME, there are built-in services to share user specific [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":47790,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1828],"class_list":["post-47789","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-share-over-lan"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/47789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=47789"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/47789\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/47790"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=47789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=47789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=47789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}