Install Headphones on Arch Linux

Headphones and Arch Linux logo

Headphones is an automatic music downloader and manager. It is equivalent to CouchPotato or Sonarr but for music. For improved security it is installed under it’s own user and group. Backing up settings and the library is very simple and only requires a database and configuration files to be saved. The one major weakness of Headphones is that it uses MusicBrainz public mirror by default. The MusicBrainz public mirror is slow and unrelaible. This problem can be solved by using alternative server, either free or paid or running your own my setting up MusicBrainz VM Server with QEMU.

 

Setup Credentials

Create a system account and group.

sudo useradd -r -s /bin/false headphones

 

Optionally add the user to secondary groups.

sudo usermod -a -G nzbget,utserver headphones

 

Install Headphones

If needed install Packer on Arch Linux or install Yaourt on Arch Linux or use another package wrapper.

 

Install Headphones with packer.

packer -S headphones

 

Install optional dependencies.

sudo pacman -S git unrar python2-notify

Updating headphones requires git. Automatic decompression is done with unrar. Desktop notifications are enabled with python-notify package.

 

Create Music Download Directory

Headphones needs access to directories where music is downloaded by the downloader applications. For Usenet you can install NZBGet on Arch Linux while for torrents install uTorrent on Arch Linux or Deluge.

 

Create download destination directory.

sudo mkdir -p /mnt/downloads/music

 

Set the ownership of the download directory.

sudo chown -R headphones:headphones /mnt/downloads/music

 

Set the permissions of the download directory.

sudo chmod -R 770 /mnt/downloads/music

 

Create Music Storage Directory

Create a destination directory for music.

sudo mkdir /mnt/virtual/music

 

Set the ownership of the music directory.

sudo chown -R headphones:headphones /mnt/virtual/music

 

Set the permissions of the music directory.

sudo chmod -R 775 /mnt/virtual/music

 

Start Headphones

Start Headphones with systemd.

sudo systemctl start headphones

 

Enable Headphones to run on boot.

sudo systemctl enable headphones

 

Disable Github Updates

Open the configuration file.

sudo nano /opt/headphones/config.ini

 

Set Github update check settings to zero and save the configuration file.

check_github = 0
check_github_on_startup = 0

 

Access Headphones

Access the web interface on 192.168.0.100:8181 and configure it from the settings page.

Change 192.168.0.100 to the actual IP address if different. Leave the default port as 8181 unless it has been changed during configuration.

 

Backup & Restore Headphones

Settings are contained within config.ini file while the library is saved as headphones.db file. To completely recover to a previous state save both files and move them to the new installation directory.

 

Copy the configuration file.

cp /opt/headphones/config.ini /mnt/backup/headphones

 

Copy the database file.

cp /opt/headphones/headphones.db /mnt/backup/headphones

dom