Skip to content

Native installation

  • Node.js 24 LTS
  • MongoDB
  • Redis
  • FFmpeg and FFprobe for audio/video processing

Native install is from source. v1.0.1 was released on 2026-12-05 (tag v1.0.1, GitHub Release, published image ghcr.io/leviro/relay:1.0.1), but a native install still needs the source tree — clone the repository first, as the commands below will not work without it (.env.example lives in it).

Terminal window
git clone https://github.com/leviro/relay.git
cd relay
cp .env.example .env
npm ci
npm start

npm start builds the frontend and launches the API and worker together as separate processes. Ensure MONGODB_URI, REDIS_HOST, and REDIS_PORT in .env point to reachable services. Production startup validates the configuration and refuses to start with placeholder secrets, equal JWT_SECRET/SESSION_SECRET values, or a missing APP_BASE_URL.

MONGODB_URI and REDIS_HOST are required in production — there is no localhost default there. APP_BASE_URL must be a bare origin (scheme + host, no path/query/fragment/userinfo) and is required in production; APP_BIND_ADDRESS (new) wins over HOST when set, and the default bind is loopback-only.

For a single-process installation:

Terminal window
npm run start:single

For development with file watching:

Terminal window
npm run dev
Mode Command When to use
Separate (recommended) npm start Production — restarting the API never drops the WhatsApp connection
Single npm run start:single Small installs and local troubleshooting

Do not launch src/worker.js alongside WORKER_MODE=single; that would create two consumers and two WhatsApp connections. Run exactly one worker per WhatsApp account/session.

For systemd/supervisord, run the two roles explicitly: WORKER_MODE=separate node src/index.js plus WORKER_MODE=separate node src/worker.js.