Skip to main content

Deployment

EdgeBase supports three deployment modes. The same code runs identically in all environments.

Cloud Edge

Global serverless deployment on 330+ edge locations.

npx edgebase deploy

On first deploy, EdgeBase automatically handles Cloudflare authentication:

  1. Checks if you're logged in via wrangler whoami
  2. Opens browser login if needed (no manual wrangler login required)
  3. Detects your account ID and configures wrangler.toml automatically
FeatureDetail
Cold start~0ms
ScalingAutomatic, global
Cost$5/month base
Storage egress$0
Backup30-day PITR

Requirements: Cloudflare account with Workers Paid plan ($5/month, account-level — covers all projects).

CI/CD

For non-interactive environments, set CLOUDFLARE_API_TOKEN as an environment variable instead.

Docker

Container-based self-hosting. Runs the same runtime as edge deployment — identical behavior, full data sovereignty.

npx edgebase docker build
npx edgebase docker run --env-file .env.release

Or run the equivalent container command yourself:

docker run -v edgebase-data:/data -p 8787:8787 --env-file .env.release edgebase

Or with Docker Compose:

version: '3.8'
services:
edgebase:
image: edgebase
ports:
- '8787:8787'
volumes:
- edgebase-data:/data
environment:
- JWT_USER_SECRET=your-secret-key
- JWT_ADMIN_SECRET=your-admin-secret-key
- SERVICE_KEY=your-service-key
healthcheck:
test: ['CMD', 'wget', '-q', '--spider', 'http://localhost:8787/api/health']
interval: 30s
timeout: 5s
retries: 3

volumes:
edgebase-data:

The same SERVICE_KEY is what all Admin SDKs use for server-side access.

FeatureDetail
Cold startN/A (always running)
ScalingManual (container orchestration)
CostVPS cost only (~$5–20/month)
DataLocal SQLite files in Docker volume

Requirements: Docker installed.

Direct Run

Run directly with Node.js — no Docker, no cloud account needed.

npx edgebase dev
FeatureDetail
Best forDevelopment, testing, lightweight production
DataLocal filesystem
RequirementsNode.js 20+

Comparison

EdgeDockerDirect
Commandnpx edgebase deploynpx edgebase docker runnpx edgebase dev
RequiresCloudflare accountDockerNode.js only
ScalingAuto globalManualSingle instance
Best forProductionSelf-hosted prodDev / lightweight
Cost~$5–30/monthVPS costFree

Environment Variables

EdgeBase uses separate files for development and production secrets:

FilePurposeUsed by
.env.developmentLocal dev secretsnpx edgebase dev
.env.releaseProduction secretsnpx edgebase deploy

Edge (Cloudflare Workers)

The simplest approach — put your production secrets in .env.release and deploy:

# Copy the example template and fill in your production keys
cp .env.release.example .env.release

# Deploy — secrets are auto-uploaded to Cloudflare
npx edgebase deploy

Or set secrets manually one at a time:

npx edgebase secret set JWT_USER_SECRET
npx edgebase secret set JWT_ADMIN_SECRET
info

SERVICE_KEY is auto-generated on first deploy — you don't need to set it manually.

Docker / Direct

# Use the env file directly
npx edgebase docker run --env-file .env.release

# Or pass variables inline
JWT_USER_SECRET=your-secret npx edgebase dev