Skip to content

Cloudflare Worker Deployment (Recommended) ​

This is the easiest and fastest way to host NodeAuth yourself—no VPS needed, running directly on Cloudflare's free tier with minimal maintenance.


📋 Deployment Prerequisites ​

  • License Code: Required to start the system, obtain it from the License Center.
  • GitHub Account: Used to Fork the code and authorize one-click deployment.
  • Cloudflare Account: Provides the Worker runtime environment.
  • CF Hosted Domain (Optional): If you want to bind a custom domain, it must be hosted on CF (otherwise, *.workers.dev is assigned).

🛠️ Deployment Steps ​

NOTE

The repository (nodeauth/nodeauth-worker) already contains prebuilt files—no local build step is needed. On first launch, the Worker creates the required D1 database tables automatically with no manual SQL import.

1. Preparation ​

  1. Fork the nodeauth/nodeauth-worker repository to your GitHub account.
  2. Give the project a Star ⭐ (this will help you stay notified about future updates).

2. One-click Automated Deployment ​

  1. Click the Deploy Button: Deploy to Cloudflare Workers
  2. On the page that opens, click "Continue with GitHub".
  3. Authorize Cloudflare to read your repositories and select the nodeauth-worker project you just forked.
Click to view: Authorization Guide ScreenshotNodeAuth Cloudflare GitHub repository authorization screen
Select the forked nodeauth-worker repository in Cloudflare
  1. Click "Deploy", wait for the progress bar to complete, and then click "Continue to project".
Click to view: Detailed Deployment Steps ScreenshotNodeAuth Cloudflare Workers deployment setup
NodeAuth Cloudflare Workers build progress
NodeAuth Cloudflare Workers deployment finished
NodeAuth Cloudflare Workers project dashboard

3. Configure Core Variables ​

After a successful deployment, the app won't run yet. You need to inject security keys:

  1. Enter the project dashboard, click "Settings" -> "Variables & Secrets".
  2. Click "Add", select the type as "Secret", and enter the following required items (Environment Variables Guide):

CAUTION

Warning: Be sure to select the Secret type. Otherwise, your configured environment variables may be lost when the project is updated.

  1. Don't forget the login channels: If you want to use GitHub login, you also need to add:
  • OAUTH_GITHUB_CLIENT_ID: Your CLIENT_ID
  • OAUTH_GITHUB_CLIENT_SECRET: Your CLIENT_SECRET
  • OAUTH_GITHUB_REDIRECT_URI: Your callback URI (e.g., https://your-domain.com/oauth/callback)
Click to view: Adding Variables & Secrets ScreenshotAdd NodeAuth secret environment variables in Cloudflare Workers
  1. Finally, click "Deploy" to save your changes.

🌐 Custom Domain ​

By default, Cloudflare assigns a xxx.workers.dev subdomain. If you have your own domain:

  1. In the project dashboard, click "Settings".
  2. Find "Custom Domains" -> "Add Custom Domain".
  3. Enter the domain you want to bind (e.g., 2fa.example.com). Cloudflare will automatically configure the DNS for you.
Click to view: Adding a Custom DomainBind a custom domain to NodeAuth Cloudflare Worker