From ArchWiki
Revision as of 15:37, 4 December 2012 by Grindcore (talk | contribs) (The command to start the daemon under point 2.3 was incorrect. Added 'See also'.)
Jump to: navigation, search

SpotCommander is an open source web-based remote control for the GNU/Linux version of Spotify. The application is written in PHP and HTML5, and thus optimized especially for mobile devices, like smartphones or tablets. It has a visual appealing, responsive and intuitive user interface.


The application offers amongst others the following features:

  • Launch and quit Spotify
  • Now playing
  • Control playback
  • Change Spotify's volume
  • Toggle shuffle and repeat
  • Browse playlists, albums and starred items
  • Search for tracks
  • Recently played
  • Queue
  • Gestures
  • Keyboard shortcuts



Install Apache web server

  • To be able to use SpotCommander, it is neccessary to have an Apache web server installed on the device, which should be controlled remotely later. Apache and PHP can be installed this way:
 $ pacman -S apache php php-apache

See the LAMP article for more detailed information about Apache.

Configuration of apache

  • To be able to run the application, the sqlite extension of PHP is required. First, install the package:
 $ pacman -S php-sqlite
  • Now edit the php configuration in /etc/php/php.ini:
 $ nano /etc/php/php.ini
  • Comment out the following lines, to enable the needed extensions:
Note: Make sure you have the openssl package installed.
  • It is neccessary to give Apache access to /tmp. Search in /etc/systemd/system/ for the line PrivateTmp=true and change it as follows:

To make this change take effect, a reboot is needed.

Other required packages

  • In addition the following packages need to be installed:
 $ pacman -S inotify-tools xautomation wmctrl 

Install SpotCommander

  • Go into the web server root directory:
 $ cd /srv/http/
  • Download the tar.bz2 file:
 $ wget -N
  • Extract the tar.bz2 file:
 $ tar -jxvf spotcommander-8.2.tar.bz2
  • Remove the tar.bz2 file:
 $ rm spotcommander-8.2.tar.bz2
  • Go into the spotcommander folder:
 $ cd spotcommander
  • Set the correct file permissions:
 $ sudo chmod 755 .
 $ sudo chmod 755 bin/*
 $ sudo chmod -R 777 db/
 $ sudo chmod 666 txt/*
 $ sudo chmod 777 lib/cache
  • Create a symlink, to be able to execute the SpotCommander daemon:
 $ ln -fs $(pwd)/bin/spotcommander /usr/local/bin/spotcommander
  • Adjust the config file:
 $ nano config.php
  • Set config_path to SpotCommander's root:
 $ define('config_path', '/srv/http/spotcommander');
  • Start the daemon:
 $ spotcommander start

Add daemon to startup (optional)

If you want the SpotCommander deamon to start automatically, you have to add it to the startup list of your desktop environment. An easy way to execute the right command, is to write a simple bash script:

 spotcommander start
  • Under GNOME

Open the startup applications dialog and add the bash script here:

 $ gnome-session-properties
  • Under KDE

Create a symlink to the script in the KDE autostart folder:

 $ ln -s /path/to/above/script ~/.kde4/Autostart/


After you have set up the server successfully, every device in your local network should be able to access SpotCommander under the ip adress of the server. For example, if the server would have the ip

To find out your current ip adress, execute the following:

 ip addr

If you cannot access the server, make sure, that apache is accessible by other hosts in the LAN. Check in /etc/httpd/conf/httpd.conf to what hosts it is listening to. The line should look like this:

 Listen 80

See also