Skip to content

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.

Terminal window
git clone https://github.com/FxEmbed/FxEmbed.git
cd FxEmbed
npm install

Copy the example Wrangler config and fill in your details:

Terminal window
cp wrangler.example.toml wrangler.toml

Edit 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.

Copy the example environment file and customize it:

Terminal window
cp .env.example .env

See the Configuration guide for details on each variable.

Copy and edit the branding configuration:

Terminal window
cp branding.example.json branding.json

You can configure the name, colors, icons, and redirect URLs for each zone you want to support. See Configuration for details.

Deploy to Cloudflare:

Terminal window
npm run deploy

This builds the worker with esbuild and deploys it via wrangler deploy --no-bundle.

Once your worker is running on *.workers.dev, add it to your custom domain through the Cloudflare dashboard.

To build without deploying (useful for testing):

Terminal window
npm run build-local

This runs esbuild without the Sentry upload step.

To tail real-time logs from your deployed worker:

Terminal window
npm run log

This runs wrangler tail to stream logs to your terminal.

Pull the latest changes and redeploy:

Terminal window
git pull
npm install
npm run deploy