Linux isn't officially supported by the Spotify music service, but if you're a premium or unlimited subscriber, you can get the Spotify for Linux preview version onto Ubuntu. Here's how:
Step 1: Open up a terminal window (CTRL+ALT+T).
Step 2: Add Spotify to the list of repositories by adding the following line in /etc/apt/sources.list,
deb http://repository.spotify.com stable non-free
sudo vi /etc/apt/sources.list
Step 3: Add Spotify's public key to verify downloaded packages.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4E9CFF4E
Step 4: Update the APT package index.
sudo apt-get update
Step 5: Install Spotify.
sudo apt-get install spotify-client-qt spotify-client-gnome-support
When prompted to continue, type "y" and hit ENTER
Step 6: Launch the preview release of Spotify for Linux, which is listed under "Media Apps."
Step 7: Log in and enjoy Spotify on Ubuntu!
That's it. Keep in mind that this is a preview release and because it doesn't support ads yet, it's only available to premium and unlimited subscribers. Also, local music files aren't supported, so you'll have to settle for Spotify's library of 15 million tracks.