Local Setup
Learn how to set up erxes on your local machine
Prerequisites
Before you can install and use erxes, make sure you install the following on your computer:
Prepare the environment
Create a folder for erxes
cd erxesImportant
Make sure you are inside the erxes folder before proceeding with the installation steps. Being in the correct directory is crucial for the setup process to work properly.
Setup Database
Install MongoDB
Follow the instructions in the MongoDB documentation to install MongoDB on your system.
Install Redis
Follow the instructions in the Redis documentation to install Redis on your system.
Install Docker
First, you need to install Docker on your system. Follow the official installation guide for your operating system: Install Docker
Install Docker Compose
Docker Compose is required to run multiple containers. Install it following the official guide: Install Docker Compose
Create Docker Environment
Create a new directory for Docker configuration and navigate to it:
mkdir docker
cd dockerCreate docker-compose.yml
Create a new file named docker-compose.yml with the following configuration:
version: '3.6'
services:
mongo:
hostname: mongo
image: mongo:4.0.10
ports:
- "27017:27017"
networks:
- erxes-net
command: ["--replSet", "rs0", "--bind_ip_all"]
volumes:
- ./data/db:/data/db
redis:
image: 'redis'
ports:
- "6379:6379"
networks:
- erxes-net
networks:
erxes-net:
driver: bridgeStart Docker Services
Run the following command to start all services in detached mode:
docker-compose up -dSetup erxes
Clone the repository
git clone git@github.com:erxes/erxes-next.gitgit clone https://github.com/erxes/erxes-next.gitCopy the environment variables
cp .env.example .envConfigure the environment variables
# Database connection
MONGO_URL=mongodb://localhost:27017/erxes?directConnection=true
REDIS_URL=redis://localhost:6379
# Node.js configuration
NODE_OPTIONS=--max-old-space-size=1536
NODE_ENV=development
# Plugin configuration (optional) (if you want to enable a plugin)
ENABLED_PLUGINS=yourpluginnameImportant
If You are not using plugins, you can remove the ENABLED_PLUGINS line. If ENABLED_PLUGINS is null value it might break the setup process.
Install dependencies
pnpm installStart erxes
Run the frontend
pnpm dev:uisRun the backend
pnpm dev:apisAccess erxes Services
Once you've started both the frontend and backend services, you can access them at the following URLs:
Frontend
erxes frontend is available at http://localhost:3001
Backend Services
- erxes gateway is available at http://localhost:4000
- erxes graphql federation server is available at http://localhost:4000/graphql
- erxes core service is available at http://localhost:3300