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_URLmust reach all replica-set members from the containers and select the application database. The logs service appends_logsfor its own database.REDIS_HOSTandREDIS_PORTconfigure the shared Redis client;REDIS_URLdoes not. SetREDIS_PASSWORDwhen Redis requires authentication.DOMAINis the frontend origin;REACT_APP_API_URLandGATEWAY_URLmust point to the reachable gateway prefix.JWT_TOKEN_SECRETsigns team-member sessions, portal tokens, and agent-tools auth. Generate a private value and keep it consistent across backend services.VERSION=osselects 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) andREACT_APP_WIDGETS_URL(public widgets base without trailing slash). - Client portal, help center, POS client: their
NEXT_PUBLIC_*gateway variables or runtimeenv.jsinjection, 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?