{"id":46869,"date":"2024-07-09T15:51:42","date_gmt":"2024-07-09T15:51:42","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=46869"},"modified":"2024-07-10T06:55:47","modified_gmt":"2024-07-10T06:55:47","slug":"setup-media-server-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2024\/07\/setup-media-server-ubuntu\/","title":{"rendered":"How to Easily Setup Home Media Server in Ubuntu 24.04 | 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/07\/video-recording-icon.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-44140\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/07\/video-recording-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/07\/video-recording-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/07\/video-recording-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/07\/video-recording-icon-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/07\/video-recording-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/07\/video-recording-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This simple tutorial shows how to easily turn your Ubuntu or Debian into home media server, so that you can listen to the music, watch photos and videos that are stored in Linux PC remotely using your mobile phones and\/or smart TVs.<\/p>\n<p>GNOME, the default desktop in Ubuntu and Fedora Workstation, has built-in option to enable this feature. It uses <a href=\"https:\/\/wiki.gnome.org\/Projects\/Rygel\" target=\"_blank\" rel=\"noopener\">Rygel<\/a> home media solution as backend.<\/p>\n<p>It automatically transcode media to a format compatible with the client device. And, client machines that supports DLNA\/UPnP, such as Sony PlayStation, Microsoft Xbox, smart TV, Android, iOS, can access them through the local network.<br \/>\n<!--more--><\/p>\n<p>Rygel does not have any GNOME specific dependencies. It also works in other desktop environment. For this tutorial, I&#8217;ve tested the home media server in Ubuntu 24.04, XUbuntu 24.04 and Ubuntu Server 24.04, though it should work in all current Ubuntu releases, and Debian.<\/p>\n<h3>Enable Rygel Home Media Server<\/h3>\n<h4>For default GNOME Desktop<\/h4>\n<p>As mentioned, the default GNOME has built-in options to enable this feature.<\/p>\n<p>First, open <b>Settings<\/b> (aka GNOME Control Center) either by searching from the overview screen or by using the top-right system status menu (Quick Settings).<\/p>\n<p>When <b>Settings<\/b> opens, navigate to <b>Sharing<\/b> in left pane, then click &#8220;<b>Media Sharing<\/b>&#8221; in right.\u00a0 In the pop-up dialog, do:<\/p>\n<ul>\n<li>Turn on &#8220;Media Sharing&#8221; to enable the home media server.<\/li>\n<li>Use &#8216;+&#8217; and trash icons to add\/remove folders, to share media from them.<\/li>\n<li>Under <i>Networks<\/i>, use on\/off switch to select which network interface to listen to.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/gcc-enable-media-sharing.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46871\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/gcc-enable-media-sharing-700x538.webp\" alt=\"\" width=\"610\" height=\"469\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/gcc-enable-media-sharing-700x538.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/gcc-enable-media-sharing-300x231.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/gcc-enable-media-sharing-768x591.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/gcc-enable-media-sharing.webp 1138w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>For other Desktop Environments<\/h4>\n<p>For XUbuntu, KUbuntu, Ubuntu MATE, Ubuntu Server and other non-GNOME Desktops, there&#8217;s no graphical options to enable this feature. Users can press <code>Ctrl+Alt+T<\/code> on keyboard to open up a terminal window, then do following steps one by one instead.<\/p>\n<p><b>1.<\/b> First, run command to install the rygel media server as well as its dependencies.:<\/p>\n<pre>sudo apt install rygel<\/pre>\n<p>For Ubuntu Server, you also need to install extra media libraries:<\/p>\n<pre>sudo apt install ubuntu-restricted-extras<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/apt-rygel.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-46872\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/apt-rygel.webp\" alt=\"\" width=\"660\" height=\"397\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/apt-rygel.webp 660w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/apt-rygel-300x180.webp 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<p><b>2.<\/b> The Rygel service runs in per-user basis. The default config file locates in <code>\/etc<\/code> directory. You may run the command below to move (or copy with cp) it to local folder:<\/p>\n<pre>sudo mv \/etc\/rygel.conf ~\/.config\/<\/pre>\n<p>For Ubuntu Server, run <code>mkdir -p ~\/.config<\/code> if the folder does not exist.<\/p>\n<p>Then, change the ownership of the file to current user:<\/p>\n<pre>sudo chown $USER:$USER ~\/.config\/rygel.conf<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/rygel-config.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-46873\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/rygel-config.webp\" alt=\"\" width=\"660\" height=\"309\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/rygel-config.webp 660w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/rygel-config-300x140.webp 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<p><b>3.<\/b> Next, edit the config file by either opening it from your file manager (<code>.config<\/code> is hidden folder, press Ctrl+H to view\/hide) or running the command below in terminal:<\/p>\n<pre>xdg-open ~\/.config\/rygel.conf<\/pre>\n<p>or run <code>nano ~\/.config\/rygel.conf<\/code> if you&#8217;re following this tutorial on Ubuntu\/Debian Server.<\/p>\n<p>When file opens, do:<\/p>\n<ul>\n<li>add <b>upnp-enabled=true<\/b> under [general] section.<\/li>\n<li>find out and edit <b>uris=@MUSIC@;@VIDEOS@;@PICTURES@;<\/b> to add\/remove folders (separate with <b>;<\/b>) you want to share.<\/li>\n<\/ul>\n<p>You can leave all other default, or edit it with your need. For example:<\/p>\n<ul>\n<li><code>interface=192.168.x.xxx<\/code> if you have more than one network connections, and want to specify which one to listen to.<\/li>\n<li><code>port=12345<\/code> to listen on port 12345, in case you has firewall enabled and need to configure which port to be allowed.<\/li>\n<li>edit <code>transcoders=mp3;lpcm;mp2ts;wmv;aac;avc<\/code> for list of active transcoders.<\/li>\n<li>and more.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/config-rygel.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46874\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/config-rygel-700x481.webp\" alt=\"\" width=\"610\" height=\"419\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/config-rygel-700x481.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/config-rygel-300x206.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/config-rygel-768x528.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/config-rygel.webp 1073w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>4.<\/b> After saving the changes to the config file, enable the media service by running command:<\/p>\n<pre>systemctl enable --user --now rygel.service<\/pre>\n<p>Then, verify if it&#8217;s in active by running command:<\/p>\n<pre>systemctl status --user rygel.service<\/pre>\n<p>Next, every time after made changes to the <code>~\/.config\/rygel.conf<\/code> file, you need to restart the service by running the command below to apply.<\/p>\n<pre>systemctl restart --user rygel.service<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/enable-rygel.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-46875\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/enable-rygel.webp\" alt=\"\" width=\"660\" height=\"460\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/enable-rygel.webp 660w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/enable-rygel-300x209.webp 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<h3>Access the Media Server in Clients<\/h3>\n<p>After enabled the Rygel media server, any device in same network with upnp support can access.<\/p>\n<p>In my case, I use <b>VLC media player<\/b>. Either go to menu <code>View -&gt; Playlist -&gt; Universal Plug'n'Play<\/code> in VLC player in PC, or navigate to <code>Network<\/code> tab in the mobile edition. Then, you can browse and enjoy the media in server.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/vlc-upnp-access.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46876\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/vlc-upnp-access-700x435.webp\" alt=\"\" width=\"610\" height=\"379\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/vlc-upnp-access-700x435.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/vlc-upnp-access-300x186.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/vlc-upnp-access-768x477.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/vlc-upnp-access-1536x954.webp 1536w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/vlc-upnp-access-1320x820.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/vlc-upnp-access.webp 1739w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Disable Rygel Home Media Server<\/h3>\n<p>For the default GNOME desktop, just open <b>Settings<\/b>, then just turn off the toggle switch under &#8220;Sharing -&gt; Media Sharing&#8221;.<\/p>\n<p>For others, just open terminal (Ctrl+Alt+T) and run command to stop the media service:<\/p>\n<pre>systemctl stop --user rygel.service<\/pre>\n<p>If you don&#8217;t need the media server any more, just run command to uninstall:<\/p>\n<pre>sudo apt remove --autoremove rygel<\/pre>","protected":false},"excerpt":{"rendered":"<p>This simple tutorial shows how to easily turn your Ubuntu or Debian into home media server, so that you can listen to the music, watch photos and videos that are stored in Linux PC remotely using your mobile phones and\/or smart TVs. GNOME, the default desktop in Ubuntu and Fedora Workstation, has built-in option to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":44140,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1154,1317],"class_list":["post-46869","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-multimedia","tag-network"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/46869","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=46869"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/46869\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/44140"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=46869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=46869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=46869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}