Self-Hosting
FxEmbed is designed to run on Cloudflare Workers, which are free for up to 100,000 requests per day per account. Because Workers run on Cloudflare’s global edge network, your instance will automatically be distributed worldwide for low latency.
Prerequisites
Section titled “Prerequisites”- Latest Node.js LTS (Currently 24.14.x)
- A Cloudflare account
- Your Cloudflare Account ID
1. Clone and Install
Section titled “1. Clone and Install”git clone https://github.com/FxEmbed/FxEmbed.gitcd FxEmbednpm install2. Configure Wrangler
Section titled “2. Configure Wrangler”Copy the example Wrangler config and fill in your details:
cp wrangler.example.toml wrangler.tomlEdit wrangler.toml and set your Cloudflare Account ID:
name = "fxembed"account_id = "YOUR_ACCOUNT_ID_HERE"main = "./dist/worker.js"compatibility_date = "2026-04-11"If you don’t need Cloudflare Analytics Engine, remove the analytics_engine_datasets section.
3. Configure Environment Variables
Section titled “3. Configure Environment Variables”Copy the example environment file and customize it:
cp .env.example .envSee the Configuration guide for details on each variable.
4. Configure Branding (Optional)
Section titled “4. Configure Branding (Optional)”Copy and edit the branding configuration:
cp branding.example.json branding.jsonYou can configure the name, colors, icons, and redirect URLs for each zone you want to support. See Configuration for details.
5. Authenticate and Deploy
Section titled “5. Authenticate and Deploy”Deploy to Cloudflare:
npm run deployThis builds the worker with esbuild and deploys it via wrangler deploy --no-bundle.
6. Set Up Custom Domain
Section titled “6. Set Up Custom Domain”Once your worker is running on *.workers.dev, add it to your custom domain through the Cloudflare dashboard.
Building Locally
Section titled “Building Locally”To build without deploying (useful for testing):
npm run build-localThis runs esbuild without the Sentry upload step.
Viewing Logs
Section titled “Viewing Logs”To tail real-time logs from your deployed worker:
npm run logThis runs wrangler tail to stream logs to your terminal.
Updating
Section titled “Updating”Pull the latest changes and redeploy:
git pullnpm installnpm run deployFurther Reading
Section titled “Further Reading”- Self-hosting Mosaic (optional multi-image service)
- Cloudflare Workers Getting Started
- Configuration Reference
- Credentials Setup