Ubuntu 20.04 install guide / headless / running as a service
Posted: Tue Jun 16, 2020 6:06 am
So I have stumbled across this application while researching something for work. Wanted to have a go at installing it. Was surprised to see so many questions about the application running as a service
Got it up and running on a headless Ubuntu 20.04 server and running as a service
I know the optional section might seem a bit redundant but I just wanted to test it worked okay with the media on a separate device
The user running the service is called ums-user which was created during server installation
*** INSTRUCTIONS ***
# ssh into new Ubuntu 20.04 server (headless) server
ssh -p 22 [email protected]
# Install updates pre-reqs
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openjdk-8-jre openjdk-8-jre-headless
sudo apt-get install mediainfo dcraw vlc mplayer mencoder
# Download onto my PC
https://www.fosshub.com/Universal-Media ... x86_64.tgz
# Copy over to the server
scp -P 22 UMS-9.6.2-x86_64.tgz [email protected]:/home/ums-user/UMS-9.6.2-x86_64.tgz
Unpack
tar xzvf UMS-9.6.2-x86_64.tgz
cd ums-9.6.2
# Test application
./UMS.sh
# Control C to stop application
# Create unit file
sudo nano /etc/systemd/system/ums.service
[Unit]
Description=Run UMS as ums-user
DefaultDependencies=no
After=network.target
[Service]
Type=simple
User=ums-user
Group=ums-user
ExecStart=/home/ums-user/ums-9.6.2/UMS.sh
TimeoutStartSec=0
RemainAfterExit=yes
[Install]
WantedBy=default.target
# Exit and save the file
sudo systemctl daemon-reload
sudo systemctl enable ums.service
sudo systemctl start ums.service
# Check service is running
sudo systemctl status ums.service
ums-user@ums:~$ sudo systemctl status ums.service
● ums.service - Run UMS as ums-user
Loaded: loaded (/etc/systemd/system/ums.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-06-15 14:40:52 UTC; 27s ago
Main PID: 2277 (java)
Tasks: 58 (limit: 9451)
Memory: 153.4M
CGroup: /system.slice/ums.service
└─2277 jre14/bin/java -Xmx1280M -Xss2048k -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djna.nosys=true -classpath update.jar:ums.jar net.pms.PMS
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.296 [main] Transcoding engine "DCRaw" is available
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.297 [main] Using address /192.168.0.111 found on network interface: name:enp0s3 (enp0s3)
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.297 [main] Created socket: /192.168.0.111:5001
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.320 [main] WEB interface is available at: http://192.168.0.111:9001
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.333 [main] A tiny cache admin interface is available at: http://192.168.0.111:5001/console/home
Jun 15 14:40:54 ums UMS.sh[2277]: INFO 14:40:54.839 [HTTPv2 Request Worker 5] Media renderer was not recognized. Possible identifying HTTP headers:
Jun 15 14:40:54 ums UMS.sh[2277]: User-Agent: DAFUPnP
Jun 15 14:40:54 ums UMS.sh[2277]: Cache-Control: no-cache
Jun 15 14:40:54 ums UMS.sh[2277]: Pragma: no-cache
Jun 15 14:40:55 ums UMS.sh[2277]: INFO 14:40:55.832 [main] Universal Media Server is now available for renderers to find
# Go to application
http://192.168.0.111:9001
# Test service starts after a reboot
sudo reboot
# Check application
http://192.168.0.111:9001
# Success!
# OPTIONAL SECTION
# ssh into Ubuntu 20.04 server (headless) server
ssh -p 22 [email protected]
# Install nfs-common to allow mounting of NFS shares
sudo apt-get install nfs-common
# Edit hosts file so server can locate my FreeNAS media storage
sudo nano /etc/hosts
192.168.0.10 freenas
# Create mount point
sudo mkdir /mnt/FreeNAS
# Edit stab file
sudo nano /etc/fstab
# Add path
freenas:/mnt/Pool /mnt/FreeNAS nfs defaults 0 0
# Reboot server
sudo reboot
# ssh into Ubuntu 20.04 server (headless) server
ssh -p 22 [email protected]
# Check disk space
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 797M 1.3M 795M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 125G 8.0G 111G 7% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda2 976M 103M 806M 12% /boot
/dev/loop0 55M 55M 0 100% /snap/core18/1754
/dev/loop1 55M 55M 0 100% /snap/core18/1705
/dev/loop2 69M 69M 0 100% /snap/lxd/14804
/dev/loop3 31M 31M 0 100% /snap/snapd/7777
/dev/loop4 28M 28M 0 100% /snap/snapd/7264
/dev/loop5 70M 70M 0 100% /snap/lxd/15457
freenas:/mnt/Pool 2.1T 972G 1.2T 47% /mnt/FreeNAS
tmpfs 797M 24K 797M 1% /run/user/121
tmpfs 797M 4.0K 797M 1% /run/user/1000
# Success. Storage is mounted
# Setup conf file
nano /home/ums-user/.config/UMS/UMS.conf
# Set "Shared folders"
folders=/mnt/FreeNAS/Movies
# Exit and save the file
Restart UMS
sudo systemctl restart ums.service
# You can now access your media on the server after a couple of minutes. Assume this is UMS scanning the new directories.
# Server level configurations are held at
nano /home/ums-user/ums-9.6.2
Got it up and running on a headless Ubuntu 20.04 server and running as a service
I know the optional section might seem a bit redundant but I just wanted to test it worked okay with the media on a separate device
The user running the service is called ums-user which was created during server installation
*** INSTRUCTIONS ***
# ssh into new Ubuntu 20.04 server (headless) server
ssh -p 22 [email protected]
# Install updates pre-reqs
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openjdk-8-jre openjdk-8-jre-headless
sudo apt-get install mediainfo dcraw vlc mplayer mencoder
# Download onto my PC
https://www.fosshub.com/Universal-Media ... x86_64.tgz
# Copy over to the server
scp -P 22 UMS-9.6.2-x86_64.tgz [email protected]:/home/ums-user/UMS-9.6.2-x86_64.tgz
Unpack
tar xzvf UMS-9.6.2-x86_64.tgz
cd ums-9.6.2
# Test application
./UMS.sh
# Control C to stop application
# Create unit file
sudo nano /etc/systemd/system/ums.service
[Unit]
Description=Run UMS as ums-user
DefaultDependencies=no
After=network.target
[Service]
Type=simple
User=ums-user
Group=ums-user
ExecStart=/home/ums-user/ums-9.6.2/UMS.sh
TimeoutStartSec=0
RemainAfterExit=yes
[Install]
WantedBy=default.target
# Exit and save the file
sudo systemctl daemon-reload
sudo systemctl enable ums.service
sudo systemctl start ums.service
# Check service is running
sudo systemctl status ums.service
ums-user@ums:~$ sudo systemctl status ums.service
● ums.service - Run UMS as ums-user
Loaded: loaded (/etc/systemd/system/ums.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-06-15 14:40:52 UTC; 27s ago
Main PID: 2277 (java)
Tasks: 58 (limit: 9451)
Memory: 153.4M
CGroup: /system.slice/ums.service
└─2277 jre14/bin/java -Xmx1280M -Xss2048k -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djna.nosys=true -classpath update.jar:ums.jar net.pms.PMS
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.296 [main] Transcoding engine "DCRaw" is available
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.297 [main] Using address /192.168.0.111 found on network interface: name:enp0s3 (enp0s3)
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.297 [main] Created socket: /192.168.0.111:5001
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.320 [main] WEB interface is available at: http://192.168.0.111:9001
Jun 15 14:40:53 ums UMS.sh[2277]: INFO 14:40:53.333 [main] A tiny cache admin interface is available at: http://192.168.0.111:5001/console/home
Jun 15 14:40:54 ums UMS.sh[2277]: INFO 14:40:54.839 [HTTPv2 Request Worker 5] Media renderer was not recognized. Possible identifying HTTP headers:
Jun 15 14:40:54 ums UMS.sh[2277]: User-Agent: DAFUPnP
Jun 15 14:40:54 ums UMS.sh[2277]: Cache-Control: no-cache
Jun 15 14:40:54 ums UMS.sh[2277]: Pragma: no-cache
Jun 15 14:40:55 ums UMS.sh[2277]: INFO 14:40:55.832 [main] Universal Media Server is now available for renderers to find
# Go to application
http://192.168.0.111:9001
# Test service starts after a reboot
sudo reboot
# Check application
http://192.168.0.111:9001
# Success!
# OPTIONAL SECTION
# ssh into Ubuntu 20.04 server (headless) server
ssh -p 22 [email protected]
# Install nfs-common to allow mounting of NFS shares
sudo apt-get install nfs-common
# Edit hosts file so server can locate my FreeNAS media storage
sudo nano /etc/hosts
192.168.0.10 freenas
# Create mount point
sudo mkdir /mnt/FreeNAS
# Edit stab file
sudo nano /etc/fstab
# Add path
freenas:/mnt/Pool /mnt/FreeNAS nfs defaults 0 0
# Reboot server
sudo reboot
# ssh into Ubuntu 20.04 server (headless) server
ssh -p 22 [email protected]
# Check disk space
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 797M 1.3M 795M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 125G 8.0G 111G 7% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda2 976M 103M 806M 12% /boot
/dev/loop0 55M 55M 0 100% /snap/core18/1754
/dev/loop1 55M 55M 0 100% /snap/core18/1705
/dev/loop2 69M 69M 0 100% /snap/lxd/14804
/dev/loop3 31M 31M 0 100% /snap/snapd/7777
/dev/loop4 28M 28M 0 100% /snap/snapd/7264
/dev/loop5 70M 70M 0 100% /snap/lxd/15457
freenas:/mnt/Pool 2.1T 972G 1.2T 47% /mnt/FreeNAS
tmpfs 797M 24K 797M 1% /run/user/121
tmpfs 797M 4.0K 797M 1% /run/user/1000
# Success. Storage is mounted
# Setup conf file
nano /home/ums-user/.config/UMS/UMS.conf
# Set "Shared folders"
folders=/mnt/FreeNAS/Movies
# Exit and save the file
Restart UMS
sudo systemctl restart ums.service
# You can now access your media on the server after a couple of minutes. Assume this is UMS scanning the new directories.
# Server level configurations are held at
nano /home/ums-user/ums-9.6.2