How to Fix Discord ‘Connection Refused’ on Linux Client
🔍 WiseChecker

How to Fix Discord ‘Connection Refused’ on Linux Client

When you launch Discord on Linux and see a “Connection Refused” error, your client cannot reach the Discord servers. This often happens after a system update, a firewall change, or a corrupted Discord installation. The error message typically appears in a pop-up window or in the terminal output if you start Discord from the command line. This article explains the most common causes of the “Connection Refused” error on the Linux Discord client and provides step-by-step fixes to restore your connection.

Key Takeaways: Fixing Discord ‘Connection Refused’ on Linux

  • Check systemd-resolved or local DNS resolver: A misconfigured DNS resolver can block Discord’s connection to its servers.
  • Clear Discord cache files: Corrupted cache in ~/.config/discord/ or ~/.cache/discord/ can cause connection failures.
  • Reinstall Discord via .deb or .rpm package: A fresh install from the official package restores missing or broken network libraries.

Why Discord Shows ‘Connection Refused’ on Linux

The “Connection Refused” error means the Discord client is unable to establish a TCP connection to Discord’s servers (typically discord.com or gateway.discord.gg). On Linux, this is rarely caused by Discord servers being down. Instead, the root cause is usually one of these three things:

Local DNS or Network Configuration

Linux distributions often use systemd-resolved, NetworkManager, or a custom DNS setup. If your DNS resolver is misconfigured or the system’s /etc/hosts file contains a stale entry for Discord domains, the client may be redirected to a non-existent IP address.

Corrupted Discord Installation or Cache

Discord stores user data and cache in hidden directories under your home folder. If these files become corrupted — for example, after an incomplete update or a crash — the client may fail to initialize its network stack properly.

Firewall or Proxy Interference

Some Linux distributions enable ufw or iptables by default. If a rule blocks outbound connections on ports 443 or 80, Discord cannot reach its servers. Similarly, a system-wide HTTP proxy setting that is no longer valid will cause a connection refusal.

Steps to Fix ‘Connection Refused’ on the Discord Linux Client

  1. Verify Discord server status
    Open a browser and visit discordstatus.com. If Discord reports an API or gateway outage, wait for Discord to resolve the issue on their end. If the status page shows all green, proceed to the next step.
  2. Flush DNS cache and check resolution
    Open a terminal and run:
    sudo systemd-resolve --flush-caches
    Then test DNS resolution with:
    ping discord.com
    If the ping fails or returns a strange IP, check /etc/hosts for any Discord-related entries. Remove any lines containing “discord” or “discordapp” with:
    sudo nano /etc/hosts
    Save and exit, then try Discord again.
  3. Clear Discord cache and config files
    With Discord fully closed, run these commands in a terminal:
    rm -rf ~/.config/discord
    rm -rf ~/.cache/discord
    These folders will be recreated when you launch Discord next. Deleting them removes any corrupted cache that could cause connection issues.
  4. Disable or reconfigure firewall rules
    If you use ufw, check its status with:
    sudo ufw status
    If it is active, allow Discord traffic with:
    sudo ufw allow out 443/tcp
    sudo ufw allow out 80/tcp
    Then restart Discord. If you use iptables directly, ensure no rules drop outbound connections to Discord’s IP ranges.
  5. Unset or correct proxy environment variables
    Check for proxy variables with:
    echo $http_proxy $https_proxy $HTTP_PROXY $HTTPS_PROXY
    If any are set, unset them temporarily with:
    unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
    Then launch Discord from the same terminal to see if the error disappears. If it does, remove the proxy settings from your shell configuration files (~/.bashrc, ~/.profile).
  6. Reinstall Discord using the official package
    First, remove your current Discord installation. For Debian/Ubuntu systems:
    sudo apt remove discord
    For Fedora/RHEL:
    sudo dnf remove discord
    Then download the latest .deb or .rpm from discord.com/download. Install it with:
    sudo dpkg -i discord-deb (Debian/Ubuntu)
    or
    sudo rpm -i discord-rpm (Fedora/RHEL)
    Launch Discord after installation completes.
  7. Test with a different network or VPN
    If the error persists, connect to a different Wi-Fi network or use a VPN. This isolates whether your local network is blocking Discord. If Discord works on another network, your ISP or router may be blocking Discord’s IP ranges.

If Discord Still Has Issues After the Main Fix

Discord Launches but Shows ‘Connection Refused’ After a System Update

System updates can change DNS resolver settings or firewall rules. Re-run the DNS flush and firewall check steps above. Also verify that systemd-resolved is running with:
systemctl status systemd-resolved
If it is not active, start it with:
sudo systemctl start systemd-resolved
Then enable it to start on boot:
sudo systemctl enable systemd-resolved

Discord Works with sudo But Not Normally

Running Discord with sudo changes the user environment. This usually means a user-level configuration or cache file is corrupted. Repeat the cache clearing step from the main fix as the affected user. Also check for any user-specific proxy settings in ~/.bashrc or ~/.profile.

Discord Shows ‘Connection Refused’ Only in Voice Channels

If text chat works but voice channels fail, the issue is likely with UDP ports. Discord uses UDP ports 50000-65535 for voice. Ensure your firewall allows outbound UDP traffic on those ports. For ufw, add:
sudo ufw allow out 50000:65535/udp
Then restart Discord.

Discord Installation Methods Compared: Native Package vs Flatpak vs Snap

Item Native .deb/.rpm Flatpak (Flathub) Snap
Installation Download from discord.com or use apt/dnf flatpak install flathub com.discordapp.Discord sudo snap install discord
Sandboxing None — full system access Sandboxed — may need extra permissions for screen sharing Sandboxed — limited access to system directories
Cache location ~/.config/discord and ~/.cache/discord ~/.var/app/com.discordapp.Discord/config/discord ~/snap/discord/current/.config/discord
Network access Direct — no restrictions May require --socket=network flag Full network access by default
Best for Users who want minimal overhead and full control Users who prefer sandboxed apps and automatic updates Users on Ubuntu who want easy installation from the Snap Store

Now you know how to resolve the “Connection Refused” error on the Discord Linux client. Start by flushing your DNS cache and clearing the Discord config folder. If the problem continues, reinstall Discord using the native package from the official website. For persistent voice channel issues, adjust your firewall to allow UDP traffic on ports 50000-65535.