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 erxes
Important
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 docker
Create 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: bridge
Start Docker Services
Run the following command to start all services in detached mode:
docker-compose up -d
Setup erxes
Clone the repository
git clone git@github.com:erxes/erxes-next.git
git clone https://github.com/erxes/erxes-next.git
Copy the environment variables
cp .env.example .env
Configure 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=yourpluginname
Important
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 install
Start erxes
Run the frontend
pnpm dev:uis
Run the backend
pnpm dev:apis
Access 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