HowTo - Mopidy music server to Ubuntu phone

  • Mopidy is an extensible music server that plays music from local disk, Spotify, SoundCloud, Google Play Music, and more. You edit the playlist from any phone, tablet, or computer using a range of MPD and web clients.

    Only Spotify related configuration is explained. If you want more features, please read docs from

    I assume that you have working adb shell connection to your phone. You should also have Spotify Premium account to get it work.

    Remember to backup everything important if phone is your daily driver! I am not responsible if your phone goes haywire! This may also break OTA updates..

    Mount system writable
    $ sudo mount -o remount,rw /

    We use Mopidy apt repositories, as they have precompiled armhf packages ready. Run following commands. Answer "yes" to install required dependencies (all packages should be around 30MB when installed).
    $ wget -q -O - | sudo apt-key add -
    $ sudo wget -q -O /etc/apt/sources.list.d/mopidy.list
    $ sudo apt-get update
    $ sudo apt-get install mopidy mopidy-spotify

    Now start Mopidy first time and let it load fully. Then use CTRL+C to shut it down.
    $ mopidy
    It created default config file for you. It is located in your home directory.. ~/.config/mopidy/mopidy.conf

    Next we configure Mopidy. (use any editor you want). For "client_id" and "client_secret" you have to pair Mopidy with Spotify in here:
    $ vi ~/.config/mopidy/mopidy.conf

    I only show here what I changed. Otherwise I leaved things default.

    enabled = false 
    enabled = false 
    enabled = false
    username = ...your spotify username here... 
    password = ...your spotify password here...
    client_id = ...client_id goes here...
    client_secret = ...client_secret goes here... 

    Test your configuration by starting mopidy. It should tell in the console if something is wrong. When Mopidy says "MPD server running at []:6600" itโ€™s ready to accept connections by any MPD client. Leave it running.
    $ mopidy

    Now we have to install Mopidy Mobile ( to our Ubuntu phone. Use Openstore app to install it.
    Open Mopidy Mobile and add a new server.

    Name: e.g Ubuntu phone
    Port: 6680
    Path: /mopidy/ws/

    Try to connect to the server by clicking server you just created.

    Now you should be able to listen music from spotify.

    Next we have to get Mopidy server starting while booting. First we create shell script ""

    $ cd ~
    $ mkdir .scripts
    $ cd .scripts
    $ vi

    Add following to the file

    mopidy &
    exit 0

    $ chmod 744 ~/.scripts/

    Next we create a upstart job
    $ sudo vi /usr/share/upstart/sessions/mopidystart.conf

    Add following to the file

    description "Mopidy start script"
    start on started unity8-dash
    exec /home/phablet/.scripts/

    Upstart file what we just created, will run once the desktop has started and you see the "home screen" (apps menu and scopes etc.).

    Now reboot your phone and test that everything works. You should wait few minutes after dash loads before opening Mopidy Mobile- app.


    • If network connection disconnects, it play from cache couple of minutes and shuts off. When network comes back on it may take few minutes before you hear sound again. App itself works but sound is missing for a while..
    • High CPU usage when Mopidy Mobile app is active. I recommend that when start listen music, you should swipe app to backround. Then CPU usage drops to normal.
    • Big playlist loads SLOW, be patient!
    • No offline playlists.. yet! ๐Ÿ˜ž

    Big thanks to Mikel Larrea from UBports Supergroup for testing this guide!