Self-hosting Element Web with your own config: what it changes for your users
Self-hosting Element Web with your own config means serving the Element Web client from your own domain and setting it to sign users in to your homeserver by default. You need it when your organization runs its own Synapse and wants staff to land on one client, on one address, without being pointed at public servers. The change applies to the client only. Your homeserver, its user accounts and its federation settings are configured separately, so this page does not change how Synapse itself authenticates or routes traffic.
Element Web reads a JSON file at startup. It first looks for config.$domain.json matching the domain it is served from and falls back to config.json if that file is absent. The two files are never merged, so a domain-specific file must contain every setting you need. The central setting is default_server_config, the preferred way to name the homeserver that new sessions use. Pair it with disable_custom_urls: true and users can no longer type a different homeserver into the login screen. Without that lock, anyone can still sign in to a server you do not run from the same client build.
The integration manager is the third control to review. Setting integrations_ui_url, integrations_rest_url and integrations_widgets_urls to null disables it. The documented example of the default integration manager is Scalar, hosted at scalar.vector.im, so a stock build can send users to a third-party service they never chose. Before you roll out, confirm the exact keys against the Element Web configuration reference for the Element Web version you package, and test the login flow from a clean browser profile.
Which config file Element Web loads and when
When Element Web is served from one domain, you usually need only one configuration file. Element Web requests config.$domain.json for the hostname in the browser address bar. If that file is missing, it requests config.json instead. The two files are never merged, so the file it finds is the entire configuration for that page load. A single config.json in the web root is the simplest setup and works for most internal deployments.
- One file to maintain: Keep
config.jsonas the only config, and put yourdefault_server_configanddisable_custom_urlssettings in it. - Full copy, not partial: Any key you omit falls back to Element Web's built-in default, not to a value from another file, so copy every setting you need into the file.
- Integration manager off: Set
integrations_ui_url,integrations_rest_urlandintegrations_widgets_urlstonullin the same file. - Cache after changes: Clear the browser cache or force a reload after you deploy a new file, because an old copy may still be served.
- Check the served file: Request the config URL directly in a browser and confirm the response is the JSON you wrote.
After deployment, sign in from a clean browser profile and confirm the homeserver field is your server and that the custom homeserver option is unavailable.
When one web root serves several hostnames, each hostname can have its own file, such as config.chat.example.com.json for one domain and config.guest.example.org.json for another. Element Web tries the matching domain file first. A domain without a matching file falls back to the generic config.json, which may point users at the wrong homeserver. Because files are never merged, a domain file must contain every setting that domain needs.
- Name files by exact hostname: Use the full host as it appears in the browser, including subdomains, and avoid typos in the file name.
- Decide the fallback: Choose whether
config.jsonshould point to a safe default homeserver or be removed so unknown hostnames fail closed. - Repeat shared settings: Copy the integration manager and
disable_custom_urlssettings into every domain file, since they are not inherited. - Keep the files in sync: Review all domain files whenever you change a homeserver address or add a domain.
- Route each host to the right root: Confirm your reverse proxy serves the same web root for each hostname so the correct file is found.
Test each hostname separately and note which config file each one loads, because a single shared fallback is the most common cause of users seeing another homeserver.
When a user lands on the wrong homeserver or sees a custom server field they should not have, the cause is almost always the file lookup rather than the browser. Start by identifying which file the page actually loaded. The check takes a few minutes and avoids guessing at settings that are already correct in the file you intended to change.
- Confirm the hostname: Compare the address the user typed with the file name you expect, including the port if one is used.
- Request each candidate file: Open
config.$domain.jsonandconfig.jsondirectly and see which one returns a 404 or a different homeserver. - Look for a stale copy: Check whether a CDN, reverse proxy or browser cache still returns an earlier version.
- Review the file contents: Verify
default_server_configanddisable_custom_urlsare present in the file that is loaded, not only in a neighbor. - Check the proxy path: Make sure the web server maps the hostname to the directory you deployed.
Record the file name, the homeserver value and the test result for each domain. Confirm the exact behavior in the Element Web config documentation for the version you run before you change production files.
Configuration keys and when each one fits
This table compares the Element Web config keys that set the default homeserver, lock users to it, and switch off the integration manager. Read each row as a decision: the key on the left controls one behavior, and the last column says when to keep it. The main takeaway is that the pinning keys serve most organizations, while the integration manager choice depends on whether staff need third-party integrations.
| Key | What it controls | When to use it |
|---|---|---|
| default_server_config | Sets the homeserver that Element Web connects to by default, using your server name and base URL | Use it on every deployment so new users land on your homeserver without typing a server address |
| disable_custom_urls: true | Stops users from entering a different homeserver or identity server on the login screen | Use it on an internal server where accounts must stay on your domain |
| disable_custom_urls: false (default) | Lets users point the client at any compatible homeserver | Keep it only if staff are expected to log in to other Matrix servers from the same client |
| integrations_ui_url, integrations_rest_url, integrations_widgets_urls set to null | Turns off the integration manager, which otherwise points at the Scalar example service at scalar.vector.im | Use null when staff do not need third-party bots, widgets or integrations managed through that service |
| Integration manager left at defaults | Keeps the integration manager reachable, so users can add bots and widgets through an external service | Keep it only after you have reviewed which external service you point to and what data it can receive |
| config.$domain.json file | Applies settings only when Element Web is loaded from that exact domain | Use it when one web host serves several brands or domains, since the file replaces rather than merges with config.json |
| config.json file | Serves as the fallback config for any domain without a matching file | Use it as the single shared config when all users reach Element Web through one domain |
| Your own domain for Element Web | Lets you serve the client and its config from a host you control, so pinning settings apply to your users | Confirm the setup in the Element Web configuration documentation before publishing the config file |
Setting up your own Element Web config in order
This sequence turns a stock Element Web build into a client that serves your own domain, opens only on your homeserver, and offers no third-party integration manager. Each step ends with a check you can run before moving on.
Build the web root from a pinned release
Download a released Element Web bundle or build one from the source tree, and unpack it into the directory your web server will serve, such as a dedicated virtual host for chat.example.com. Keep the version number in your change record so later upgrades can be compared against it. Done when the directory contains index.html and a config.json placeholder, and the bundle loads over HTTPS in a browser with no configuration applied yet. Confirm the exact release and build steps against the Element Web repository's documentation for the version you choose.
Write the domain-specific config file
Create config.chat.example.com.json (replace the hostname with the one users type into their browser) in the web root. Element Web looks for this file first, based on the hostname of the page being loaded, so it is the file that governs your deployment. Add only the keys you intend to override in this step, and keep the JSON valid. Done when a JSON linter accepts the file and the browser's network panel shows the request for the domain-specific file returning HTTP 200 when the page loads.
Add a fallback config.json
Place a config.json next to the domain-specific file with the same settings, so that a request from an unexpected hostname, such as an IP address or an old alias, still lands on your homeserver. Element Web does not merge the two files: if the domain-specific file exists, the fallback is ignored entirely. Keep both files in version control so they cannot drift apart. Done when a request to the page through a second hostname returns config.json and the login page shows the same homeserver.
Point default_server_config at your homeserver
In both files, set default_server_config to an object whose m.homeserver entry holds the base URL of your Synapse or other homeserver, using the address that clients reach through your reverse proxy. Element Web's documentation names this key as the preferred way to set the default homeserver. Confirm the exact key shape and any identity server setting against the configuration documentation for your Element Web version. Done when the login screen pre-fills your homeserver URL and a sign-in attempt reaches your server's log.
Set disable_custom_urls to true
Add disable_custom_urls with the value true at the top level of both config files. This stops users from typing a different homeserver into the login screen, which is the control that keeps the client pinned to your organization's server. Note that this setting governs the client only and does not stop a user from running another client against a public server. Done when the login page no longer shows an editable homeserver field, and a manual attempt to change the server in the URL has no effect on the target.
Null the integration manager keys
Set integrations_ui_url, integrations_rest_url and integrations_widgets_urls to null in both config files. The default integration manager example points to Scalar at scalar.vector.im, and nulling these keys disables it so that widgets and bots cannot be installed through a third-party service. Review the same keys in any custom branding or theme files you ship. Done when the Element settings screen shows no integration manager option and the browser network panel shows no requests to scalar.vector.im during login and room use.
Verify in a clean browser session
Open a new private browser window with no cached data, navigate to your Element Web domain, and inspect the login page. It should offer only your homeserver, with no custom server field and no third-party links that open an integration manager. Repeat the check from a second browser or device and record the Element Web version, the config file hashes and the results. Done when both checks pass and the evidence is stored with your change record, so the next upgrade can be verified the same way.
Security and operational considerations for a pinned client
A pinned Element Web build is only as trustworthy as the domain, cache and release process that serve it. The cards below cover what you take on by hosting the client, what the config lock does and does not stop, and how to keep the client current after launch.
Trust in your own client domain
Whoever controls the origin that serves Element Web controls the JavaScript that runs in every user's browser, including the code that handles keys and messages. Treat the web origin as a security boundary with the same change control as your homeserver. Restrict who can publish files to it, log deployments, and confirm that the build you serve matches the release you tested. Ask your team who holds write access to the web host and CDN.
Element Web config docsCache behavior on config changes
Browsers and CDNs can keep serving an old config.json or config.$domain.json after you publish a change, so users may connect to the wrong server or keep an outdated setting. Set cache headers for configuration files deliberately and purge them as part of every config release. After a change, load the client in a clean browser profile and confirm the homeserver shown on the login screen. Document the purge step in the runbook.
What the lock prevents
Setting disable_custom_urls: true stops users from pointing the client at a different homeserver through the normal interface, and default_server_config sets the server they start from. These settings shape the default experience. They do not stop a user from running a different client, a copy of the web app, or a native app that connects elsewhere. Confirm the exact behavior of the lock against your Element Web version before you describe it to users or auditors.
What the lock leaves open
Users can still reach other homeservers through clients that do not read your configuration, so the lock is not a network control. Pair it with firewall egress rules, managed devices and an approved client list where the policy requires that. Keep the scope of your claims to what the Element Web documentation supports, and test any stronger claim with your own tests before it appears in a policy.
Keeping the web client current
A pinned client still needs security fixes and compatibility updates from its upstream release line. Track each Element Web release, read its notes for changes to config keys and to the homeserver features it expects, and test the new build against your homeserver and login flow before you deploy it. Schedule these updates with the same cadence as your Synapse upgrades so the two stay compatible.
Verifying config and build integrity
Config files are plain JSON and easy to change by mistake, and a typo can silently fall back to the default file. Validate every config file for syntax and expected keys in the pipeline, and store them in version control with review. After deployment, check the served files and the login page against the approved copy. Ask your vendor or internal team how they verify the build artifact itself before it reaches the web host.
How Element Web, your homeserver and SSO fit together
A browser user first loads the Element Web static files from your own domain, such as chat.example.com. Those files are plain assets served by your web server or reverse proxy. Once the app starts, it reads its configuration, finds the homeserver named in default_server_config, and then talks to that homeserver's client-server API directly. Element Web does not proxy chat traffic, so the path the user's requests take is determined by your DNS, your reverse proxy routes and the homeserver's own listeners. Before go-live, confirm that the web host, the homeserver base URL and any delegation target resolve and return valid TLS certificates from the network your staff use.
The client config does not replace homeserver settings. The identity of your server is set in the homeserver's server_name, which controls how user IDs such as @user:example.com and room IDs are formed. Changing default_server_config in the web build only points the app at a server; it cannot rename accounts, change federation behavior or alter registration rules. Treat these as two separate change records so that a web redeploy is never mistaken for a homeserver change.
Single sign-on is configured on the homeserver or on its identity provider, not in the Element Web file. Synapse reads OpenID Connect, SAML2 or CAS settings from its own configuration, and Matrix Authentication Service connects to upstream providers in its own setup. The web config only decides where the login screen is sent. Ask your identity team to confirm the redirect URIs registered with the provider match the homeserver or MAS address, because a mismatch is a common cause of failed sign-in that looks like a web problem. Verify SSO with a test account after each change to either side.
How the client config, your domain and the homeserver connect
The flow starts with a browser requesting Element Web from your own domain. Element Web then looks for config.$domain.json and falls back to config.json, since the two files are never merged, so the file served for each hostname decides which homeserver the client uses. Check that the chosen file sets default_server_config, that disable_custom_urls is true, and that the integration manager URLs are null before you publish.
Element Web picks one config file, then connects to the homeserver it names.
Limits to confirm before you rely on a pinned client
A pinned Element Web config controls only the clients that read it. The cards below cover what to verify across versions, platforms, other clients and branding before you tell staff that this server is the only one they can reach.
Element Web version against Synapse version
Confirm that the Element Web release you serve works with the Synapse release your homeserver runs. Synapse upgrade notes list platform floors such as PostgreSQL 14 or newer for Synapse 1.143.0 and later, and Python 3.10 or newer for 1.142.0 and later, so a client upgrade and a server upgrade should be planned together. Record the pair you tested and repeat that test after each upgrade.
Synapse upgrade notesSettings that reach mobile and desktop apps
The config.json file read by Element Web is a browser setting. Confirm with the current config documentation which keys the Element desktop and mobile apps honor, since a setting such as default_server_config may behave differently in a packaged app. Test a fresh install on each platform you support, including a sign-in attempt against a server name other than yours.
Reaching other servers through other clients
Pinning Element Web does not stop a user from installing a different Matrix client, pointing it at a public homeserver, and signing in there. Decide whether that is acceptable for your policy, then combine the pin with federation controls such as federation_domain_whitelist or a mobile device policy if you need to restrict it. Be explicit with staff about what the pin does and does not prevent.
Config file lookup and fallback
Element Web loads a domain-specific file such as config.$domain.json first and falls back to config.json, without merging them. Confirm which hostname the browser sees behind your reverse proxy, because a mismatch silently serves the generic file. Keep one complete config per served domain and check the file that actually loads in the browser's network tab.
Branding keys and the pinned server
Rebranding options such as the app name, logo, theme and SSO login page can change how the sign-in screen presents the server. Confirm that branding changes do not override default_server_config or disable_custom_urls, and that a custom SSO entry point still lands on your homeserver. Review the login page after every branding change.
Integration manager settings after updates
Setting integrations_ui_url, integrations_rest_url and integrations_widgets_urls to null disables the integration manager, but the key names and defaults can change between releases. Confirm them against the current config documentation at each Element Web upgrade, and verify that the integration manager stays unreachable from a test account.
Element Web config docsQuestions teams ask before self-hosting Element Web
How much work is it for an internal team to self-host Element Web?
For most teams the work is a small, bounded task: build or download the Element Web bundle, write a configuration file, and serve static files from your own domain. The effort is modest compared with running the homeserver itself, but it is not zero, because each release of Element Web needs to be rebuilt or redeployed and checked against your settings. Ask any partner to estimate the work from your current deploy pipeline, your web server setup and how often you plan to upgrade the client. Your own team can confirm those inputs faster than an outside party can guess them.
Can we set this up without outside help?
Yes, if your team already runs static web hosting, manages TLS certificates and maintains a deploy pipeline. The configuration itself is a JSON file with a small number of keys, documented in the Element Web configuration guide. The parts that usually need review are the reverse proxy rules, the handling of your domain and the way you test that users cannot reach other homeservers. Outside help is most useful for the verification step and for documenting the setup so that the next person can maintain it.
What does the work need from our infrastructure?
You need four things: a web server or CDN that can serve static files over HTTPS on a domain you control, a homeserver the client can reach, a place to store the configuration file, and a build or deploy pipeline that copies the right files for each environment. Confirm that your homeserver is already running and reachable under the name you plan to pin, because the client configuration points users to it. Also confirm who owns DNS and certificate renewal, since a broken certificate stops the client for every user at once.
How long does it take to confirm the setup works?
The time depends less on the configuration than on the checks you run. A basic confirmation covers loading the client on your domain, signing in against your homeserver, confirming that the login page does not offer another server, and checking that the integration manager is not reachable from the settings. Test in a staging environment first, then repeat the same checks after each client upgrade. Ask your team to size the test plan against the number of environments and browsers your users rely on.
Which parts of the setup drive the effort up?
The biggest drivers are the number of environments, the number of domains you serve, and how much you change from the default configuration. Each domain needs its own configuration file or a deliberate fallback, and configurations are not merged, so a missing key in a domain-specific file can change behavior unexpectedly. Other drivers include branding changes, integration with single sign-on, and the frequency of client releases. The more of these you combine, the more regression testing you need after each change.
Does pinning Element Web to our homeserver replace server-side access controls?
No. Setting default_server_config and disable_custom_urls guides users to your homeserver in the client, but it does not decide who can register, sign in or join rooms. Those decisions live in the homeserver and its identity configuration, such as registration settings and SSO. Treat the client settings as a usability and policy layer, and confirm your access controls on the server side with your security team before you describe the deployment as controlled.
What should we ask a partner in a written quote?
Ask for the scope in writing: which domains and environments are covered, whether the work includes the build pipeline, the reverse proxy and the verification checklist, and what documentation you receive. Ask how upgrades of Element Web are handled after handover and whether that work is included or billed separately. DeployOpen does not publish a price list, and a quote follows from the written scope, so the clearer the scope, the more comparable the quotes will be.
How DeployOpen scopes and delivers a pinned Element Web deployment
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, including cloud accounts, data centers and air-gapped networks. For Element Web, that means a written scope that pins the client to your homeserver, serves it from your domain, and hands your team a configuration they can review and maintain.
How we scope
- Confirm which homeserver domain users must sign in to, and whether custom server URLs should be blocked.
- Agree which integration manager settings are disabled and which features stay enabled.
- Record hosting target, domain names and per-domain config files in the written scope before work starts.
How we build
- Create the main Element Web config with default_server_config and disable_custom_urls set for your homeserver.
- Add domain-specific config files only where your user base needs them, and test each one separately.
- Test sign-in, server switching and integration manager removal in a staging environment before production.
How we hand over
- Deliver the config files, web server setup and a note on how Element Web chooses its config file.
- Document the steps to upgrade Element Web and retest the pinned settings after each upgrade.
- Walk your platform and security teams through the configuration so they can review it independently.
How we support
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- Ongoing upgrades, configuration reviews and retesting are available as a retainer.
- Ask any partner to confirm how a retainer covers Element Web upgrades that follow Synapse changes.

