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.devis 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
- Fork the
nodeauth/nodeauth-workerrepository to your GitHub account. - Give the project a Star ⭐ (this will help you stay notified about future updates).
2. One-click Automated Deployment
- Click the Deploy Button:
- On the page that opens, click "Continue with GitHub".
- Authorize Cloudflare to read your repositories and select the
nodeauth-workerproject you just forked.
Click to view: Authorization Guide Screenshot


- Click "Deploy", wait for the progress bar to complete, and then click "Continue to project".
Click to view: Detailed Deployment Steps Screenshot




3. Configure Core Variables
After a successful deployment, the app won't run yet. You need to inject security keys:
- Enter the project dashboard, click "Settings" -> "Variables & Secrets".
- 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.
NODEAUTH_LICENSE: System license code, obtain from license.nextmatrix.app/byos.ENCRYPTION_KEY: A random key of at least 32 characters, obtain from tools.nodeauth.io.JWT_SECRET: A random JWT secret of at least 32 characters, obtain from tools.nodeauth.io.OAUTH_ALLOWED_USERS: Allowed login list, e.g., your@example.com
- Don't forget the login channels: If you want to use GitHub login, you also need to add:
OAUTH_GITHUB_CLIENT_ID: Your CLIENT_IDOAUTH_GITHUB_CLIENT_SECRET: Your CLIENT_SECRETOAUTH_GITHUB_REDIRECT_URI: Your callback URI (e.g.,https://your-domain.com/oauth/callback)
Click to view: Adding Variables & Secrets Screenshot

- Finally, click "Deploy" to save your changes.
🌐 Custom Domain
By default, Cloudflare assigns a xxx.workers.dev subdomain. If you have your own domain:
- In the project dashboard, click "Settings".
- Find "Custom Domains" -> "Add Custom Domain".
- 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 Domain
