---
title: "Set up a separate editor hostname"
description: "Set up a separate hostname for the Alpacon editor on a self-hosted site. Verify editors open on the new hostname and the console returns 404 for the old path."
---

> Full documentation index: https://docs.alpacax.com/llms.txt

# Set up a separate editor hostname

The code editor runs software from your servers, so it should not share a hostname with the console.

## Before you start

- Run server 2.51.0 or later and proxy server 1.5.2 or later. Earlier releases don't support a separate editor hostname.
- Count the site's active workspaces, excluding the system workspace (`public`). The editor hostname supports exactly one active workspace. If you have more than one, leave `ALPACON_EDITOR_HOST` empty and turn off the editor on servers you don't trust.
- Choose a hostname reserved for the editor, such as `alpacon-editor.example.com`. The console, API, and other services must each use a different hostname from the editor. Use the same registrable domain as the console, such as `example.com`, so the browser can send the editor's login cookie. Create a DNS record and install a TLS certificate that covers the editor hostname.
- Serve the console over HTTPS. If you set `ALPACON_FRONT_DOMAIN_ROOT`, set `ALPACON_HTTP_TYPE=https`. Otherwise, set `ALPACON_URL` to the HTTPS console origin with no path. Use ASCII for the console and API hostnames, including the `xn--` form of internationalized names.

## Set up the hostname

1. Route the new hostname to the proxy and enable WebSocket upgrades. You can forward all requests on that hostname or forward only requests under `/proxy/editor/`. Check that the route forwards the editor hostname and allows WebSocket upgrades.
2. Set `ALPACON_EDITOR_HOST=alpacon-editor.example.com` in the environment file shared by the server and proxy. Check that you entered only the hostname, with no scheme, port, or path.
3. Recreate the server and proxy together. Check that both services start.
4. Open an editor from the console. Users with editors already open need to open them again. Check that the editor address uses the new hostname.
5. On the console hostname, request `/proxy/editor/test-session/test-channel/test-token/` using these dummy values. Check that it returns HTTP 404.
6. If administrators saw a warning about the shared editor hostname before the change, open the console as an administrator. Check that the warning is gone.

## After the change

Have users clear the browser's site data for the console hostname. Then have each user sign back in and end their previous sign-ins one at a time from [Sign-in sessions](/use/settings/security/#sign-in-sessions) to revoke those login tokens.

## Troubleshooting

| Symptom | Fix |
| --- | --- |
| The proxy doesn't start | Configure a valid HTTPS console origin. Set `ALPACON_FRONT_DOMAIN_ROOT` with `ALPACON_HTTP_TYPE=https`, or use an HTTPS `ALPACON_URL` with no path when `ALPACON_FRONT_DOMAIN_ROOT` is empty. |
| The server doesn't start | Read the startup message for the setting to fix. Set `ALPACON_EDITOR_HOST` to a bare DNS hostname distinct from the console and API hostnames. Use ASCII for both the console and API hostnames. Remove CSRF or CORS entries that trust the editor hostname, including matching wildcards or patterns in your site's `local_settings.py`. Turn off any CORS setting that allows all origins. |
| The editor returns HTTP 404 | Open the editor from the console and verify the address uses the configured editor hostname. Confirm that the site has exactly one active workspace, excluding `public`. |

## Go back

1. Empty `ALPACON_EDITOR_HOST` in the shared environment file. Check that the setting is empty.
2. Recreate both services together. Check that both start.
3. Restore the previous routing. Check that the previous editor route forwards requests to the proxy again.
4. Open the editors again from the console. Check that the editors load using the previous hostname.

Source: https://docs.alpacax.com/learn/security/editor-hostname/
