Self-Hosting Configuration

Environment variables and Compose settings behind the Deployment template. This guide follows version 3.1.7 (03acdf712c).

For source development, use Local Setup instead.

Required settings

NODE_ENV=production
VERSION=os
MONGO_URL=mongodb://<user>:<password>@<hosts>/erxes?replicaSet=<rs>&authSource=admin
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=<if-required>
DOMAIN=https://erxes.example.com
REACT_APP_API_URL=https://erxes.example.com/gateway
GATEWAY_URL=https://erxes.example.com/gateway
JWT_TOKEN_SECRET=<openssl rand -hex 32>
  • MONGO_URL must reach all replica-set members from the containers and select the application database. The logs service appends _logs for its own database.
  • REDIS_HOST and REDIS_PORT configure the shared Redis client; REDIS_URL does not. Set REDIS_PASSWORD when Redis requires authentication.
  • DOMAIN is the frontend origin; REACT_APP_API_URL and GATEWAY_URL must point to the reachable gateway prefix.
  • JWT_TOKEN_SECRET signs team-member sessions, portal tokens, and agent-tools auth. Generate a private value and keep it consistent across backend services.
  • VERSION=os selects the open-source asset path used by plugin discovery.

Plugin and service selection

ENABLED_PLUGINS=sales,operation
ENABLED_PLUGINS_ONLY_API=posclient
ENABLED_SERVICES=automations,logs

Use base plugin names without _api/_ui suffixes. ENABLED_PLUGINS_ONLY_API adds backend-only plugins without frontend remotes. Only list plugins present in your checkout and whose images you deploy.

Frontend build-time values

The widget and standalone apps bake public URLs at build time:

  • Frontline widgets: REACT_APP_API_URL (gateway) and REACT_APP_WIDGETS_URL (public widgets base without trailing slash).
  • Client portal, help center, POS client: their NEXT_PUBLIC_* gateway variables or runtime env.js injection, depending on the app. See Client Portal and Messenger Installation.

Rebuild and redeploy after changing a build-time URL; a container environment override alone does not rewrite baked assets.

Source references

Was this helpful?