Skip to content

Getting Started ​

Follow these four steps for a new site, then optionally configure a recommended access domain. For an existing site, use the update guide. The workflow is named 00 Deploy Worker in newer versions and Deploy Worker in older ones.

1. Prepare Cloudflare ​

Follow Create a Cloudflare API Token to obtain a token and Account ID. Enable R2 in Cloudflare if you want file uploads.

2. Fork and Add Secrets ​

Fork the EdgeChat repository to your GitHub account.

Fork EdgeChat

Open your fork's Settings → Secrets and variables → Actions → Secrets, click New repository secret, and add:

NameValue
CLOUDFLARE_API_TOKENThe Cloudflare API token you created
CLOUDFLARE_ACCOUNT_IDAccount ID of the deployment account
EDGECHAT_ADMIN_USERNAMEYour initial administrator username
EDGECHAT_ADMIN_PASSWORDYour own strong administrator password

GitHub Repository Secrets

There is no default administrator password. Optionally set EDGECHAT_ADMIN_DISPLAY_NAME; it defaults to the username.

3. Deploy ​

  1. Open Actions and enable workflows for the fork.

  2. Select 00 Deploy Worker → Run workflow.

  3. Select the default branch.

    Leave both boxes unchecked for first-time deployments and routine updates

    The options beginning with Apply EDGECHAT_ENCRYPTION_KEYRING and Add a new automatic key are for key maintenance. They apply a manually configured keyring or generate and activate a new key, respectively. Select an option only when you intend to perform that operation.

    Keep the default settings and click the green Run workflow button to deploy.

  4. Wait for every step to succeed, then find the site URL in the deployment log.

Run the workflow

The workflow tests and builds the application, reuses or creates resources, initializes or migrates D1, creates the administrator, and deploys the Worker. Encryption keys are generated on first deployment and preserved afterward. See GitHub Actions Deployment for the workflow details.

4. Sign In and Check ​

  1. Open the site and sign in with your administrator credentials.
  2. Open registration invitations to create users or invitation links.
  3. Test messages between two users; test file uploads if R2 is enabled.
  4. Run a self-check under Installation & Maintenance.

Text chat works without R2. Enable R2 and rerun deployment to add attachment support.

Choose one of the following methods; do not apply both to the same access hostname. The domain must already be added to your Cloudflare account.

In the Cloudflare dashboard, open Workers & Pages, select your deployed Worker, and go to Settings → Domains & Routes → Add → Custom Domain. Enter your hostname, such as chat.example.com, and select Add Custom Domain. Cloudflare configures the DNS record and certificate automatically. See the official guide.

Use this alternative to try a third-party preferred route instead of the Custom Domain method above. The preferred hostname is the DNS CNAME target; visitors still use your own chat.example.com.

  1. In the same Worker's Settings → Domains & Routes → Add, choose Route, select your zone, enter chat.example.com/*, and set Failure mode to Fail open (proceed). Save the route.
  2. Open your domain's DNS → Records → Add record, choose CNAME, set the name to chat and the target to a preferred hostname, then set Proxy status to DNS only (gray cloud) and save.
  3. Recommended candidates to try first are saas.sin.fan, chsat.cf.090227.xyz, or Visa hostnames www.visa.com, www.visa.com.hk, www.visa.com.sg, and www.visa.co.jp. Choose one as the CNAME target without https:// or a path. Test sign-in, real-time messaging, and attachments through your own domain afterward.

Third-party prerequisites

Standard Cloudflare Worker routes require proxied DNS records. The DNS-only alternative above depends on compatible third-party SaaS routing and a valid hostname certificate; an arbitrary CNAME is not sufficient. These are third-party candidates with no guarantee of continued availability or better performance. If certificates or routing fail, use the Custom Domain method above.

Fail open bypasses the Worker when the Workers Free daily request allowance is exhausted. It does not keep EdgeChat running or automatically switch routes. See route requirements and daily requests and failure modes.

Next Steps ​

Token instructions now have a separate guide. Manual first-login steps are in Administrator Setup.

Built on Cloudflare · Designed for self-hosting