Skip to main content

Change the default homeserver in Element Desktop

This guide applies if your system cannot connect to https://matrix.org and you see this error message when opening Element Desktop for the first time.

This is a temporary workaround until this issue is resolved.

In this guide, the homeserver domain is example.com, meaning Matrix usernames are @someone:example.com, and the homeserver is exposed on the domain matrix.example.com. Make sure you add your domains in the config below before pasting it into config.json.

First, exit Element, then follow the steps for your operating system below.

Linux

The exact steps may depend on your distro, but generally, it will be something along the lines of:

  1. Open your Terminal

  2. Right-click and paste cat > ~/.config/Element/config.json, then hit enter

  3. Right-click and paste

    {
        "default_server_config": {
            "m.homeserver": {
                "base_url": "https://matrix.example.com",
                "server_name": "example.com"
            }
        },
        "room_directory": {
            "servers": []
        }
    }
    
  4. Hit Ctrl + C

Mac

  1. Open Terminal. Hit Command + Space then enter terminal

  2. Right click and paste cat > ~/Library/Application\ Support/Element/config.json then hit enter

  3. Right-click and paste

    {
        "default_server_config": {
            "m.homeserver": {
                "base_url": "https://matrix.example.com",
                "server_name": "example.com"
            }
        },
        "room_directory": {
            "servers": []
        }
    }
    
  4. Hit Ctrl + C

Windows

  1. Press Win + R

  2. Paste in %APPDATA%\Element\

  3. Create a new text file named config.json

  4. Open config.json in Notepad

  5. Paste in

    {
        "default_server_config": {
            "m.homeserver": {
                "base_url": "https://matrix.example.com",
                "server_name": "example.com"
            }
        },
        "room_directory": {
            "servers": []
        }
    }
    
  6. Save and exit