Install HTPC Manager on Ubuntu Linux

HTPC Manager combines many media related applications and provides an easy way to view and control them in one place. It supports applications like CouchPotato, NZBGet and XBMC / Kodi among others. Currently it is still missing support for NZBDrone / Sonarr.

 

Set up credentials

Create a system user account that HTPC Manager will run under.

adduser --system htpc-manager

 

Create a group that HTPC Manager will run under.

groupadd media

 

Add the system user to the primary group.

usermod -g media htpc-manager

 

Verify that the group has been added correctly.

groups htpc-manager

 

Install HTPC Manager

Update the package list.

apt-get update

 

Install the required dependencies.

apt-get install git-core python

 

Change the current directory to the installation directory.

cd /opt

 

Clone the latest release of HTPC Manager from the official git repository.

git clone https://github.com/styxit/HTPC-Manager

 

Optionally you can rename extracted directory to something more manageable.

mv HTPC-Manager htpc-manager

 

Set the ownership to the user and group HTPC Manager will run as.

chown -R htpc-manager:media /opt/htpc-manager

 

Set the permissions so that the htpc-manager user has full access.

chmod -R 755 /opt/htpc-manager

 

Run HTPC Manager.

python /opt/htpc-manager/Htpc.py

 

Note that application will create new directories and files with ownership of the user which executed the script. To avoid issues run HTPC Manager only with the user it will always run under or set ownership permissions again before running it under a different user.

 

Access HTPC Manager in your browser on http://192.168.0.100:8085 substituting the IP address with the correct value.

 

Run HTPC Manager at Startup

Open or create a new upstart configuration file for HTPC Manager.

nano /etc/init/htpc-manager.conf

 

Copy the script below and save the configuration file.

description "HTPC Manager upstart script"
author "DominicM @ dominicm.com"

# What user to run as
setuid htpc-manager

# What group to run as
setgid media

# When to start the service
start on runlevel [2345]

# When to stop the service
stop on runlevel [016]

# Automatically restart process if crashed
respawn

# Start the process
script
exec python /opt/htpc-manager/Htpc.py
end script

 

Run HTPC Manager with upstart.

start htpc-manager

 

Reboot to verify that HTPC Manager starts automatically.

reboot

 

Quick reference

adduser --system htpc-manager
groupadd media
usermod -g media htpc-manager
groups htpc-manager
apt-get update
apt-get install git-core python
cd /opt
git clone https://github.com/styxit/HTPC-Manager
mv HTPC-Manager htpc-manager
chown -R htpc-manager:media /opt/htpc-manager
chmod -R 755 /opt/htpc-manager
python /opt/htpc-manager/Htpc.py

http://192.168.0.100:8085

nano /etc/init/htpc-manager.conf
start htpc-manager
reboot

dom