How to Fix Spotify Error Code 4

Like all music streaming services, Spotify’s biggest disadvantage over locally saved files is having constant access to the Internet. While it is possible to download songs for offline playback, it is not possible to download songs for all songs. If Spotify keeps crashing or Spotify “error code 4” appears, it indicates a problem with the internet.

Spotify “error code 4” only appears when the Spotify desktop client cannot detect a working internet connection. There are tons of reasons this could happen, from a physically dropped connection to incorrect DNS settings. If you are facing this problem and trying to fix it, here is what you need to do.

What Causes Spotify Error Code 4?

A Spotify “error code 4” message is an issue that prevents Spotify’s desktop client from connecting to its servers. Without a connection, you cannot stream music without first downloading the files to your PC.

Connection problems like this could be caused by a disconnected WiFi or Ethernet connection to the local network or an outage from the internet service provider. It could also indicate a domain name server (DNS) problem, which can sometimes be resolved by clearing the DNS cache or changing DNS providers.

Spotify uses TCP port 4070 to connect to its servers in the desktop app but should revert to common web ports 443 and 80 if it fails. Ports 443 and 80 are unlikely to be blocked by a local network firewall or Windows Firewall as this would block all Internet access.

However, this is not guaranteed. Although Spotify should use web ports if port 4070 is blocked, this could still cause connectivity issues. You may need to check for open ports and, if port 4070 is blocked, open it using Windows Firewall or your network firewall.

You may also find that a corporate firewall is blocking the particular IP range or domain names used by Spotify. If Spotify and other external services are blocked by a school or workplace firewall, you will need to speak to a relevant network administrator to resolve the issue or consider alternatives to circumvent it.

Control of the network and Internet connections

Before changing any settings, check that the connection to the local network (and the connection between the network and the Internet provider) is working. You can quickly check whether or not you are connected to a local network via WiFi or Ethernet by looking for the network symbol in the system tray on Windows 10.

If you don’t have a working connection, the symbol appears as a globe with a cross in the corner.

Mac users facing the same problem can select the network symbol in the upper right corner of the menu bar. From here, they can double-check the status of their WiFi or Ethernet connection.

Assuming your local network connection is working, you may need to look into your internet connection. If you’re not sure, open your browser and try visiting some of your favorite websites. If these don’t load, it likely indicates a connection problem that you will need to investigate further.

If an Internet connection is lost, you should contact your Internet Service Provider (ISP) for further assistance. Alternatively, you can switch to a mobile hotspot using your smartphone’s mobile data connection to get back online quickly, being careful to avoid breaching your data or tethering limit.

If you are using a virtual private network (VPN) to connect to the internet, this could also cause DNS conflicts or connection problems. Spotify should usually work over a standard VPN connection, but if you’re unsure, disconnect and use the standard connection to test and troubleshoot first.

As mentioned, Spotify should default to ports 443 and 80 to make a connection if port 4070 is blocked, but that’s not always the case. If you think your network or system firewall is blocking this port, you will need to change your Windows Firewall rules or your router’s firewall settings to allow this.

Reset DNS cache

Domain name servers are essential for a larger Internet network. Without DNS, typing techvaz.com in your browser would not come up, as your browser would not be able to tell you the correct web server IP address.

Services like Spotify also rely on DNS to allow them to quickly switch servers (or spread server load) using domain names. If there is a DNS problem, this may be preventing Spotify from working. Before changing the DNS servers, you can clear the DNS cache and regenerate it.

  1. To clear the DNS cache on Windows, open a new PowerShell window. You can do this by right-clicking on the Start menu and selecting Windows PowerShell (administrator).
  2. In the PowerShell window, type ipconfig/flushdns and select the Enter key.
  3. On a Mac, you can clear DNS by opening a new Terminal window from the Launchpad (visible in the Other folder ). In the Terminal window, type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, then select Enter.

Change DNS settings

If a DNS problem is preventing Spotify from working, you can change your DNS server to a public provider. There are a number of free public DNS servers that you can use from organizations like Google and OpenDNS.

  1. To change DNS servers on Windows, right-click on the Start menu and select Settings.
  2. In the Settings menu, select Network and Internet > Status> Properties.
  3. In the Properties menu, scroll down to the IP Settings section, then select the Edit option.
  4. Change the Change IP Settings option to Manual, then select the IPv4 slider to the On position. In the boxes Preferred DNS and DNS alternative, type a suitable public DNS provider (eg. 8.8.8.8 and 8.8.4.4 for Google DNS), then select Save to save the settings. 
  5. On Mac, you can change DNS settings in the System Preferences menu. Select Apple menu> System Preferences to launch it.
  6. In System Preferences, select Network. In the Network menu, select your connection, then select the Advanced option.
  7. Select the DNS tab, then select the Add icon to add a public DNS provider. After adding it, select OK to save.

After changing the DNS settings, clear the DNS cache using the above steps or restart your PC or Mac.

Change player or reinstall Spotify

If the above steps still don’t fix the problem, you can try to fix it by switching to Spotify web player or mobile apps. 

As mentioned, Spotify uses port 4070 to connect to its servers. If it’s blocked and you can’t get Spotify desktop client working, switch to Spotify web player using this URL to make sure it only uses HTTP (ports 443 and 80) for connection. However, it will only work if your internet connection works.

Alternatively, you can reinstall the Spotify desktop app. You’ll need to uninstall it first, making sure all damaged files are removed in the process. Once Spotify is removed from your PC or Mac, you can download the latest version from the Spotify website.

author image

About Author

Samuel Afolabi is a lazy tech-savvy that loves writing almost all tech-related kinds of stuff. He is the Editor-in-Chief of TechVaz. You can connect with him socially :)

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.