Prepare an Ubuntu development environment
Install on Ubuntu the container engine, Node.js, Yarn, Python and Java versions that the OpenCTI and OpenAEV source code requires.
This page installs on Ubuntu 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 is written for Ubuntu 24.04 LTS. 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
- Ubuntu 24.04 LTS, with
sudorights. Ubuntu 24.04 ships Python 3.12, the version the OpenCTI images and its continuous integration (CI) use. - At least 8 GB of memory for OpenCTI: its development Elasticsearch alone starts with a 2 GB Java heap (
ES_JAVA_OPTS=-Xms2G -Xmx2Ginopencti-platform/opencti-dev/docker-compose.yml). - 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. The LTS branches of OpenCTI use older tools.
| 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 or Podman, with Compose | Docker or Podman, with Compose | opencti-dev and openaev-dev |
Install the shared tools
-
Install Git, the C and C++ toolchain, and Python with its
venvand header packages:sudo apt-get update sudo apt-get install -y git curl build-essential python3 python3-venv python3-devOpenCTI compiles two native Node.js modules at install time,
re2andnode-calls-python: they needbuild-essentialandpython3-dev. Ubuntu 24.04 refusespip installoutside a virtual environment, so you needpython3-venv. -
Install a container engine with Compose. Pick one.
DockerInstall Docker Engine and its Compose plugin from the Ubuntu archive, then let your user run Docker without
sudo:sudo apt-get install -y docker.io docker-compose-v2 sudo usermod -aG docker "$USER"Log out and back in for the group to apply. Docker's own repository, described in Install Docker Engine on Ubuntu, gives more recent versions.
PodmanInstall Podman and a Compose provider:
sudo apt-get install -y podman podman-composeThe development stacks then start with
podman compose up -d. -
Raise the memory map limit that Elasticsearch needs, now and at every boot:
echo 'vm.max_map_count=262144' | sudo tee /etc/sysctl.d/99-elasticsearch.conf sudo sysctl --systemWithout it, the Elasticsearch container of the development stack can fail to start or stop under load.
-
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 Node.js 22 and make it the default:
nvm install 22 nvm alias default 22 -
Remove Yarn 1 if a global one is installed, then install Corepack. Corepack fetches the Yarn version that
package.jsonpins when you runyarnin the repository:npm uninstall -g yarn npm install -g corepacknvm keeps global packages per Node.js version: install Corepack again for each version you add.
node --version
python3 --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.
Install the tools for OpenAEV
-
Install Java 21 and Maven:
sudo apt-get install -y openjdk-21-jdk mavenUbuntu 24.04 ships Maven 3.8. If
mvn -versionreports a version older than 3.9, install Maven from maven.apache.org. -
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 (22.18.0 or later), 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.
A developer at Example CERT gets a fresh Ubuntu 24.04 laptop to fix how OpenCTI displays the reports on Velvet Harbor. They only need the OpenCTI tools, with Docker:
sudo apt-get update
sudo apt-get install -y git curl build-essential python3 python3-venv python3-dev docker.io docker-compose-v2
sudo usermod -aG docker "$USER"
echo 'vm.max_map_count=262144' | sudo tee /etc/sysctl.d/99-elasticsearch.conf
sudo sysctl --system
# after installing nvm and opening a new terminal
nvm install 22
nvm alias default 22
npm install -g corepack
After logging out and back in, docker compose version answers without sudo, 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 (1 - Backend start, 1 - Frontend start, Backend docker compose), openaev-dev/*.run.xml for OpenAEV (Backend start, Frontend start). 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 a Windows development environment, for a Windows workstation.
- Develop XTM Composer, for the Rust component that runs integrations.