Quick Start
The core goal of Sublink Worker is to minimize the barrier to self-hosting subscription conversion/distribution tools. Below is a three-step onboarding process based on the most common deployment methods.
1. Cloudflare Workers One-Click Deployment
If you've previously deployed GitHub apps via Cloudflare, you might encounter an
An unknown error occurrederror. See FAQ for solutions.
Click the button above to automatically fork and deploy. Or manually:
- Go to Cloudflare Dashboard, select Workers & Pages → Create application → Pages → Connect to Git.
- Authorize GitHub and select your forked
sublink-workerrepository. - In Build settings:
- Framework preset:
None. - Build command:
npm run deploy. - Build output directory: Keep default.
- Framework preset:
- Bind a custom domain (optional) to avoid
*.workers.devaccessibility issues in certain regions.
After deployment, Cloudflare will inject KV and Worker environment variables, which work by default. If you need to bind Redis/Upstash, continue reading Runtime & Storage.
2. Vercel Deployment
Click the button above to quickly deploy to Vercel. The system will automatically guide you through configuring necessary environment variables. Or manually:
- Import the forked repository in Vercel console.
- Go to
Settings → Environment Variablesand addKV_REST_API_URLandKV_REST_API_TOKEN(auto-generated if using Vercel KV). - Run
vercel deployto get a serverless app powered by/api/index.js.
3. Docker / Compose Deployment
Docker Compose (Recommended)
# Clone repository
git clone https://github.com/7Sageer/sublink-worker.git
# Enter directory
cd sublink-worker
# Start
docker compose up -dDocker Run
docker run -p 8787:8787 ghcr.io/7sageer/sublink-worker:latestBy default, running Docker containers directly won't persist data - short links/configs will be lost. We recommend configuring Redis/Upstash for data persistence. See Runtime & Storage for details.
4. Node.js Deployment
# Clone repository
git clone https://github.com/7Sageer/sublink-worker.git
# Enter directory
cd sublink-worker
# Install dependencies
npm install
# Build
npm run build:node
# Run
node dist/node-server.cjsBy default, running Node.js directly won't persist data - short links/configs will be lost. We recommend configuring Redis/Upstash for data persistence. See Runtime & Storage for details.
For Node.js, we recommend using process managers like PM2.
Generate Your First Subscription
- Open the Worker root path (or Docker-exposed
http://localhost:8787). - Paste your Base64/URL-encoded subscription.
- Select a rule template (
Balanced/Comprehensive, etc.), or add custom rules below. - Click
Convertto export Sing-Box, Clash, Surge, Xray configs or QR codes. If short links are enabled, links will be stored in KV.
For more details on storage/variables, see Runtime & Storage. If you plan to modify base configurations, jump to Base Config (Experimental).