Prepare a macOS development environment
Install on macOS, Apple silicon or Intel, the container engine, Node.js, Yarn, Python and Java versions that the OpenCTI and OpenAEV source code requires.
This page installs on macOS the tools you need to run OpenCTI or OpenAEV from source: a container engine for their services, and the exact Node.js, Yarn, Python and Java versions their code requires. It works on Apple silicon and on Intel Macs, with Homebrew. When the tools are in place, continue with Build and run from source.
- Browser → Front end: opens
- Front end → Back end: proxies API calls
- Worker → Back end: API calls
- Back end → Elasticsearch: indexes
- Back end → Redis: streams and cache
- Back end → RabbitMQ: queues bundles
- Worker → RabbitMQ: consumes
- Back end → Silo: stores files
Before you start
- A recent macOS, with administrator rights, and Homebrew installed.
- Enough memory to give the Linux virtual machine of the container engine 8 GB: the development services run in it, and Elasticsearch alone starts with a 2 GB Java heap in both modules.
- The versions below come from the code of OpenCTI 7.261030 and OpenAEV 3.261029. Contributions go to the default branches,
masterfor OpenCTI andmainfor OpenAEV.
| Tool | OpenCTI | OpenAEV | Where the code sets it |
|---|---|---|---|
| Node.js | 22.18.0 or later; the images and CI run Node.js 22 | 24.11.0 or later | engines in package.json |
| Yarn | 4.18.1, through Corepack | 4.18.1, through Corepack | packageManager in package.json |
| Python | 3.12 | Not needed | Images node:22-alpine3.23 and python:3.12-alpine |
| Java | Not needed | 21 | java.version in pom.xml |
| Maven | Not needed | 3.9 or later | OpenAEV development guide |
| Container engine | Docker Desktop or Colima, with Compose | Docker Desktop or Colima, with Compose | opencti-dev and openaev-dev |
Install the shared tools
-
Install the Xcode Command Line Tools, which bring Git and the C and C++ compiler:
xcode-select --installOpenCTI compiles two native Node.js modules at install time,
re2andnode-calls-python: they need the compiler. -
Install a container engine with Compose. Pick one.
Docker DesktopInstall Docker Desktop for Mac, start it and wait until the engine runs. In Settings > Resources, give its virtual machine at least 8 GB of memory. Docker Desktop is free for personal use, education and small businesses; larger organizations need a paid subscription.
ColimaInstall Colima, the Docker command line and Compose, then start a virtual machine large enough for Elasticsearch:
brew install colima docker docker-compose colima start --cpu 4 --memory 8 --disk 40Homebrew installs Compose as a plugin of the Docker command line. Add its folder to
~/.docker/config.jsonso thatdocker composefinds it:{ "cliPluginsExtraDirs": ["/opt/homebrew/lib/docker/cli-plugins"] }On an Intel Mac, the folder is
/usr/local/lib/docker/cli-plugins. Ifdocker compose pullthen fails ondocker-credential-desktop, remove the"credsStore": "desktop"line that Docker Desktop left in the same file. -
Check the memory map limit of the virtual machine, which Elasticsearch needs at 262144 or more:
docker run --rm alpine cat /proc/sys/vm/max_map_countWith Colima, raise it when it is lower, after each start of the virtual machine:
colima ssh -- sudo sysctl -w vm.max_map_count=262144 -
Install nvm, the Node.js version manager, with the install script of its README, then open a new terminal.
Install the tools for OpenCTI
-
Install Python 3.12:
brew install python@3.12Create the virtual environment of Build and run from source with this version,
python3.12 -m venv ../.python-venv: the back end reads its packages from thepython3.12folder of the environment. -
Install Node.js 22 and make it the default:
nvm install 22 nvm alias default 22 -
Install Corepack, which fetches the Yarn version that
package.jsonpins when you runyarnin the repository:npm install -g corepacknvm keeps global packages per Node.js version: install Corepack again for each version you add.
node --version
python3.12 --version
docker compose version
Node.js prints v22.18.0 or later, Python prints Python 3.12, and Compose prints its version. In your OpenCTI clone, yarn --version prints 4.18.1.
The Elasticsearch service of opencti-platform/opencti-dev/docker-compose.yml sets ES_JAVA_OPTS=-Xms2G -Xmx2G and nothing for Apple silicon. If it stops at start on an Apple silicon Mac, add -XX:+IgnoreUnrecognizedVMOptions -XX:UseSVE=0 to ES_JAVA_OPTS in a Compose override file of your own, as OpenAEV's development stack does.
Install the tools for OpenAEV
-
Install Java 21 and Maven:
brew install openjdk@21 maven -
openjdk@21is not linked into your path by Homebrew. Add it to~/.zshrc, then open a new terminal:export JAVA_HOME="$(brew --prefix openjdk@21)" export PATH="$JAVA_HOME/bin:$PATH"Without it,
java -versionanswersUnable to locate a Java Runtime. -
Install Node.js 24 and Corepack for it:
nvm install 24 nvm use 24 npm install -g corepack corepack enableNode.js 24 also meets the OpenCTI requirement, but OpenCTI is built and tested on Node.js 22. Switch with
nvm use 22andnvm use 24when you move from one repository to the other.
java -version
mvn -version
node --version
Java and Maven report Java 21, Maven reports 3.9 or later, and Node.js prints v24.11.0 or later.
The Elasticsearch and OpenSearch services of openaev-dev/docker-compose.yml already pass -XX:UseSVE=0 for Apple silicon: you change nothing there.
A developer at Example CERT gets a MacBook with Apple silicon to fix how OpenAEV shows the results of the Velvet Harbor simulation on the front desks of Grand Meridian Hotels. They only need the OpenAEV tools, with Colima:
xcode-select --install
brew install colima docker docker-compose openjdk@21 maven
colima start --cpu 4 --memory 8 --disk 40
colima ssh -- sudo sysctl -w vm.max_map_count=262144
echo 'export JAVA_HOME="$(brew --prefix openjdk@21)"' >> ~/.zshrc
echo 'export PATH="$JAVA_HOME/bin:$PATH"' >> ~/.zshrc
# after installing nvm and opening a new terminal
nvm install 24
npm install -g corepack
corepack enable
java -version reports Java 21 and docker compose version answers, and they continue with Build and run from source.
Choose an editor
The repositories carry run configurations for IntelliJ IDEA: opencti-platform/opencti-dev/*.run.xml for OpenCTI, openaev-dev/*.run.xml for OpenAEV. IntelliJ IDEA detects them when you open the repository root. Visual Studio Code works too, without these configurations.
What's next
- Build and run from source: clone, configure, start the services and the platform, run the tests.
- Prepare an Ubuntu development environment, for a Linux workstation.
- Prepare a Windows development environment, for a Windows workstation.