Deploy & Operate
Deploy erxes on your own infrastructure and keep it running: installation, environment variables, database migrations, upgrades, and troubleshooting. For running the source on a laptop instead, use Local Setup.
The reference deployment is a single-server Docker Compose stack (Core UI, Core API, gateway, logs-service, and Redis) behind an Nginx HTTPS proxy, backed by a MongoDB replica set you provision yourself. The repository includes Dockerfiles and CI workflows but no Compose file or installer; Deployment derives a working template from them, and the remaining guides cover the lifecycle after first boot.
Before you deploy
- MongoDB replica set. Required, not optional: plugins use sessions and transactions (some wrap writes in
startSession). YourMONGO_URLmust resolve every advertised replica member from inside the containers and grant access to both the application database and its<db>_logsdatabase, which the logs service writes to. - Redis. A persistent
redis:7instance on the private network (the template enables AOF andnoeviction). Redis holds service-discovery keys, user session tokens, and all BullMQ queues; losing it drops queued work and logs everyone out. There is noREDIS_URL; services readREDIS_HOST/REDIS_PORT/REDIS_PASSWORD. DOMAINandGATEWAY_URL. Set tohttps://<host>andhttps://<host>/gateway. They set the gateway's CORS allow-list and the links the platform generates. The Core UI container needsREACT_APP_API_URLpointed at the same gateway URL.JWT_TOKEN_SECRET. One random value, identical on the gateway, Core API, every plugin API, and the background services; it signs team-member sessions, portal tokens, and app tokens. A mismatch silently invalidates logins.- Pinned image tags. Prefer
:<version>release tags orrepository@sha256:digests over floatinglatestfor theerxes/erxes-next-*images, so rollback is a config change. The release workflow re-tags the image matrix on each release tag.erxes/erxes-next-migrationsis not in that matrix; pin it bylatestor digest. LOAD_BALANCER_ADDRESSper service. Without it a production service registershttp://plugin-<name>-api:<port>in Redis, which must resolve inside your Docker network.ENABLED_PLUGINSon both Core API and the gateway. Comma-separated base names (sales,operation). The gateway waits for every listed API to register and serve its subgraph before it listens. Deploy every listed plugin, or remove it from the list.
Guides
DeploymentDeploy erxes on your own server with Docker Compose: requirements, images, and first runConfigurationEnvironment variables behind the deployment templateDatabase MigrationsBack up and migrate MongoDB across versionsUpgradesChoose compatible images and roll back safelyLogs & TroubleshootingDiagnose health, composition, and plugin loading
Was this helpful?