Fix Spotify Login Issues with Proxy on Ubuntu 24.10 (Tested & Fixed Through Trial and Error!)

If you cannot log in to Spotify on Ubuntu 24.10, this guide may save you!

I personally had the same issue, and after a lot of trial and error, I finally found a working solution.

The Problem:

  • Spotify quits without logging in
  • Errors like "Auth 7" or other vague authentication failures
  • Spotify does not connect through a proxy or VPN
  • Setting the proxy manually inside Spotify does not persist

At first, I had no idea why it wasn’t working. But after a lot of troubleshooting, I realized that Spotify was unable to connect through the proxy properly, and worse, it didn’t create a necessary configuration file (prefs) by default!

Here’s how I fixed it step by step.

1. Remove the Snap Version of Spotify

I initially had the Snap version of Spotify installed, but I ran into too many issues, including difficulty finding config files.

To completely remove it:

sudo snap remove spotify

If you’re using Snap, you may still be able to try this guide, but I personally switched to the .deb version to make debugging easier.

2. Install the .deb Version of Spotify

Instead of Snap, I installed the .deb version, which made it easier to access configuration files.

Step 1: Add the Spotify Repository

curl -sS  | sudo gpg --dearmor --yes -o /usr/share/keyrings/spotify-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/spotify-archive-keyring.gpg]  stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.listhttps://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpghttp://repository.spotify.com

Step 2: Install Spotify

sudo apt-get update && sudo apt-get install spotify-client

For the official installation guide, visit:
Spotify Official Linux Installation Guide

3. Configuration File Issue (Bug?)

After installing, I expected Spotify to create a configuration folder and files inside:

~/.config/spotify/

However, this did NOT happen for me.

I opened and closed Spotify multiple times, expecting the prefs file to be generated, but it never appeared.

My Fix: Manually Creating the Configuration Folder

mkdir -p ~/.config/spotify

Manually Create the Preferences File

touch ~/.config/spotify/prefs

I suspect this is a bug in Spotify, where it fails to generate its own configuration file properly.

4. Configuring Spotify to Use a Proxy

Now, I had to manually set up the proxy because the Spotify settings didn’t save it properly.

Step 1: Open the prefs File

nano ~/.config/spotify/prefs

Step 2: Add the Following Lines

network.proxy.addr="<YOUR_PROXY_IP>:<YOUR_PROXY_PORT>@<YOUR_PROXY_TYPE>"
network.proxy.mode=<PROXY_MODE_NUMBER>
network.proxy.user=""
network.proxy.pass=""

How to Fill in These Fields:

  • <YOUR_PROXY_IP> → Replace this with your proxy server IP (e.g., 127.0.0.1).
  • <YOUR_PROXY_PORT> → Replace this with your proxy port (e.g., 10808).
  • <YOUR_PROXY_TYPE> → Choose your proxy type:
    • socks5 → For SOCKS5 Proxy
    • socks4 → For SOCKS4 Proxy
    • http → For HTTP Proxy

Example (Using SOCKS5 Proxy on Port 10808):

network.proxy.addr="127.0.0.1:10808@socks5"
network.proxy.mode=4
network.proxy.user=""
network.proxy.pass=""

Understanding network.proxy.mode

  • 0 = Autodetect settings
  • 1 = No proxy
  • 2 = HTTP
  • 3 = SOCKS4
  • 4 = SOCKS5

Make sure to set network.proxy.mode correctly based on your proxy type.

  • For SOCKS5 → network.proxy.mode=4
  • For SOCKS4 → network.proxy.mode=3
  • For HTTP → network.proxy.mode=2

Step 3: Save and Exit

Press Ctrl+O, then Enter, and Ctrl+X to exit.

5. Restart Spotify and Verify the Configuration

  1. Close Spotify completely: pkill spotify
  2. Reopen it: spotify
  3. Check if the Proxy is Set Correctly:
    • Go to Settings > Advanced > Proxy Settings.
    • If it shows the correct proxy type and address, then the configuration was successful.
  4. Spotify May Modify prefs Automatically:
    • After setting it manually, I noticed Spotify added additional settings to the prefs file.
    • If something resets to HTTP, change it back to your preferred proxy type and restart Spotify.

Snap Version Users – Help Needed!

I only tested this with the .deb version. If anyone knows how to apply this to the Snap version, please add your method here in the comments or replies! This will help others facing the same issue.

Final Notes

After applying this fix, Spotify logged in successfully and worked perfectly through the proxy!**

If this guide helped you, let me know, and if you found a better way to fix this issue, please share it so others can benefit!