[Tutorial] How to install UMS in Docker

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
mrfatboy
Posts: 10
Joined: Sat Oct 21, 2023 9:41 am

[Tutorial] How to install UMS in Docker

Post by mrfatboy »

Here is a tutorial on how I installed UMS in Docker on Ubuntu 22.04 at the time of this posting. Full disclosure I'm a newbie at linux and docker. However, even if you are experienced there a several pitfalls that need to be overcome.

For reference I used this post as a starting point that explained some of the issues.

viewtopic.php?t=12922&sid=174b29121adbb ... a12759b2c7


Basically the current UMS Docker image has several issues that we must work around.


Let's go!


First you need to find that network interface of the host computer that you will be installing UMS on. This will be typically your wifi or lan interface. WARNING!!!!! If you install UMS when you are on Wifi than plug your computer into a LAN port (or visa versa) you will have to make changes to your UMS.config file and restart your container.

Step 1:
Use the following command in terminal to find your current network interface. Make note of it for later.

Code: Select all

ip route get 1.1.1.1  |grep -oP 'dev\s+\K[^ ]+'

Step 2:
Create a folder where you want install UMS

Step 3:
Create a docker-compose.xml file and place the below code into it and save in the UMS directory that you created in Step 2.

Code: Select all

version: '3.7'

services:

  universalmediaserver:

    image: universalmediaserver/ums
    container_name: UMS
    network_mode: host
    environment:
      - UMS_PROFILE=/profile
    volumes:
      - /path/to/your/ums folder/UMS.conf:/profile
      - /path/to/media1/:/Media1:ro
      - /path/to/media2/:/Media2:ro
 
    restart: 'unless-stopped'


Step 4:
Edit your docker-compose.xml file. Change the path for the /profile to your where you placed your ums folder. All add all of the paths to your media here. The Docker UMS GUI has issues of browsing and finding media paths. The "MediaX" folders can be named anything you want. (For ex. Music, Movies, etc)

Step 5:
In terminal, navigate to your ums folder where you put the docker-compose.xml file.

Run the command

Code: Select all

docker compose up -d
When finished docker UMS should be up and running but WAIT!!!!!!!! There is more configuration to do. There now should be a UMS.conf file in your ums folder.

Step 6:
Edit the UMS.conf file and add the line below. Insert your network interface name from Step 1 and save file.
network_interface=<insert your network interface name>

Step 7:
Restart the UMS Docker container.

Step 8:
Open up a browser window and navigate to http://localhost:9001 to view the UMS GUI

Step 9:
Create your login info

Step 10:
Using the menu bar (upper right corner) navigate to Shared Content

Step 11:
Delete the two default directories.

Step 12:
Add your Media folders that you mapped in your docker-compose.xml file.

Step 13:
Use UMS as normal. Scan your media and you should be good to go!


Good luck!
ocroquette
Posts: 1
Joined: Sun Jan 07, 2024 3:16 am

Re: [Tutorial] How to install UMS in Docker

Post by ocroquette »

Thanks mrfatboy for the tutorial. I allowed me to set up UMS quickly on a Debian Bookworm basis. Here is an update of the instructions with some corrections (XML -> YML) and some additions.

Step 1:
Install Docker. See https://docs.docker.com/engine/install/debian/

Step 2:
Create a directory to store the configuration files for Docker and UMS:

Code: Select all

sudo mkdir -p /srv/ums/app
sudo mkdir -p /srv/ums/app/profile
Note: these paths are reasonable defaults, but they can be changed freely.

Step 3:
Create the file /srv/ums/app/docker-compose.yml with the following content. We will tweak it in the next step.

Code: Select all

version: '3.7'

services:
  universalmediaserver:
    image: universalmediaserver/ums
    container_name: UMS
    network_mode: host
    environment:
      - UMS_PROFILE=/profile
    volumes:
      - /srv/ums/app/profile:/profile
      - /host/pathX:/container/pathX:ro
    restart: 'unless-stopped'
Step 4:
Adapt the paths in the docker-compose.yml file:
  • /host/pathX is the root directory of media files on the host, for instance "/srv/ums/data".
  • /container/pathX is where it will be mapped within the container. You can choose it freely. We will make UMS aware of it later using the web interface (Step 12).
You can define several media directory mappings if required.

Step 5:
Start UMS as container:

Code: Select all

cd /srv/ums/app
sudo docker compose up -d
Docker will download the required images and UMS will start in the background. But WAIT! There is more configuration to do.

Step 6:
Retrieve the main network interface of your system:

Code: Select all

ip route get 1.1.1.1  |grep -oP 'dev\s+\K[^ ]+'
Edit the file /srv/ums/app/profile/UMS.conf, which has just been created by UMS, and add the following line at the bottom. Replace <placeholder> by your actual network interface name.

network_interface=<placeholder>

Note: setting NETWORK_INTERFACE in docker-compose.yaml does not work, hence this step.

Step 7:
Restart the UMS Docker container:

Code: Select all

cd /srv/ums/app
sudo docker compose down && sudo docker compose up -d
Step 8:
Open http://<hostname>:9001 in a browser to view the UMS GUI. If you work locally, you might use http://localhost:9001

Step 9:
Create the first user. You can pick the name and password freely.

Step 10:
Using the menu bar (upper right corner), navigate to "Shared Content"

Step 11:
Delete the two default directories.

Step 12:
Add the directories that you mapped in your docker-compose.yml file (/container/pathX in the example above).

Step 13:
Scan your media

Step 14:
Restart the system to check if UMS starts automatically:

Code: Select all

sudo reboot
To update UMS, later on:

Code: Select all

cd /srv/ums/app
sudo docker compose stop
sudo docker compose rm -f
sudo docker compose pull   
sudo docker compose up -d
User avatar
mik_s
Moderator
Posts: 1130
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: [Tutorial] How to install UMS in Docker

Post by mik_s »

Thanks that will be a great help.

I curious what are the default directories in the shared folders in step 11?
I have seen problems with how people set up their shared folders by including their Home folder and the UMS installation folder.
I suspect that these are the default for some reason, if they are then could be changed in the Github repository.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Post Reply