Ready to try it? Start the local lab with one command.
Once Docker, Compose and the required resources are ready, use the bundled startup script. It checks your local Docker engine, creates first-use secrets, validates the configuration, starts the eight core services and tests the home page, password sign-in and an authenticated query. You do not have to assemble the startup sequence yourself, but you should still understand the services and data-preservation steps below.
This is a local learning environment, pinned to OpenCTI 7.261124.0 with the web port bound only to 127.0.0.1:18080. It is not a one-command public multi-user deployment. Continue to the security and operations chapters for HTTPS, account governance, backups and capacity planning.
Get the tutorial project
Download the repository in a terminal and enter its root directory. If you already have this project, use your existing checkout rather than creating another installation and copying old secrets into it.
First downloadgit clone https://github.com/stwater20/opencti-tutorial.git cd opencti-tutorialStart Docker, then run the startup script
Start Docker Desktop or your local Docker engine first. The script requires Python 3 and Docker Compose v2 with support for
up --wait --wait-timeout.Run from the repository rootbash lab/start.shFor this handbook's dedicated Colima environment, start its profile and specify the context explicitly. This affects only the command, not your global Docker context.
The handbook's Colima environmentcolima start --profile opencti-tutorial OPENCTI_DOCKER_CONTEXT=colima-opencti-tutorial bash lab/start.shWait for READY, then sign in
Before displaying
READY: http://localhost:18080, the script verifies HTTP access and password sign-in. Privately openlab/.envin a local editor, readOPENCTI_ADMIN_EMAILandOPENCTI_ADMIN_PASSWORD, then sign in through your browser. Do not paste this file into reports, chats or a public Git repository.First use creates unique secrets in a file with
0600permissions. An existing.envis kept intact, including the encryption key. The script does not regenerate credentials to hide a login failure. Workers and connectors are started, but intelligence imports still need the configuration and verification described in later chapters.
Stop the lab and return later
Run these commands from the same repository root. Stopping preserves configuration, containers and named volumes. Use the same startup command next time. If you selected a dedicated context, include the same setting on both commands.
bash lab/stop.sh
bash lab/start.shOPENCTI_DOCKER_CONTEXT=colima-opencti-tutorial bash lab/stop.sh
OPENCTI_DOCKER_CONTEXT=colima-opencti-tutorial bash lab/start.shOptional public-source connectors belong to their own overlays. Stop them separately with the commands in the source chapter so they do not continue retrying while the platform is down. Do not remove volumes to fix an ordinary startup error.
If startup stalls or fails
| Message or symptom | What to check |
|---|---|
| Docker, Python or Compose is missing | Complete environment preparation first. The script stops without installing software or changing host settings. |
| Docker is not reachable | Start Docker Desktop or the selected Colima profile, check the context name and rerun the same command. |
| A remote Docker engine is selected | This entry point accepts only local Unix or Windows named-pipe sockets. Select a local context rather than accidentally deploying lab settings to a remote host. |
| Compose configuration validation fails | Check whether the existing .env is complete. Keep its original keys; do not delete and regenerate secrets for an existing platform. |
| Port 18080 is occupied, or a service is unhealthy | Check the process using the port, available Docker memory and disk space, then inspect containers using this chapter's troubleshooting steps. Containers already started may remain running after a failure. |
| Health waiting times out | The default health wait is 600 seconds. Set OPENCTI_WAIT_SECONDS=900 to change it; values from 1 to 3600 are accepted. Image-download time is outside the health-wait limit. Waiting longer does not repair a configuration error. |
| Containers are healthy but sign-in verification fails | Check the saved password against the current database account, platform version and status. The script exits with failure rather than treating a reachable home page as a complete deployment check. |
On 2026-12-02, two runs against the existing Colima Docker lab passed home-page access, password sign-in and authenticated session queries. The .env file remained byte-for-byte identical, and a read-only persistence check found the existing teaching data. Isolated tests additionally exercised daemon, Compose-version, remote-context, configuration and startup failures. This run did not install Docker on a clean host or test Windows/WSL or Linux hosts. The final scripts also passed a real stop/start cycle, sign-in and read-only persistence checks with unchanged credentials. Read the original verification record.
Start with a reproducible environment before deciding how much data to import.
This chapter has a straightforward goal: build a locally accessible OpenCTI lab using a version-pinned Compose example with independently generated secrets. You will know what to expect at each step, instead of pasting a long command sequence and hoping it succeeds.
The handbook provides a compact teaching configuration based on the official deployment approach; it is not an unchanged copy of the official Compose file. The platform, worker, and two STIX connectors are all pinned to 7.261124.0; dependency images also use fixed tags. You can inspect the complete file by downloading the Compose example. Configuration choices and test results are documented in the verification chapter.
Get the example and confirm your working directory.
git clone https://github.com/stwater20/opencti-tutorial.git
cd opencti-tutorial
python3 lab/init-env.py
cd labIf you already have the repository, do not clone it again; enter your existing repository root. The initialization script creates lab/.env, generates the administrator password, token, encryption key, and service passwords, and restricts the file to owner read/write access. If the file already exists, it stops and preserves the current values.
That is intentional. Regenerating secrets without planning can leave existing data incompatible with the new configuration. After successful initialization, keep .env as a lab secret: do not commit it to Git, include it in an article, or attach it to a public issue. You can inspect the initialization script directly.
Run the following docker compose commands from the lab directory. If you work from the repository root, use docker compose -f lab/compose.yaml … instead. Do not mix the two forms or create another lab project with the same name.
Validate the configuration first.
docker compose config --quiet
docker compose config --servicesThe first command normally produces no output on success and should return exit code 0. The second lists the lab's eight services. Resolve missing variables, YAML indentation problems, and syntax errors here. Do not post the full output of docker compose config publicly to demonstrate that the configuration works: expanded variables can include passwords.
This configuration limits the JVM heap for the search engine and the Node.js heap for the platform. These are not hard memory limits for the entire containers. Leave host capacity for the operating system, other services, and caches. Validate a small dataset first, then use monitoring results to guide expansion.
Pull the images and wait for services to become ready.
docker compose pull
docker compose up -d --wait --wait-timeout 600
docker compose pspull retrieves images; up creates services; --wait makes Compose wait for health checks or running states. These steps answer different questions. An image finishing its download does not mean the platform is ready to use.
The first startup initializes storage structures and platform data, so it takes longer than subsequent restarts. If the wait times out, inspect docker compose ps, identify unhealthy or exited services, and then examine their logs:
docker compose logs --tail 80 elasticsearch
docker compose logs --tail 80 opencti
docker compose logs --tail 80 workerLogs can contain environment information. Redact credentials, tokens, and nonpublic data before sharing them. Do not delete all volumes simply because startup is slow: that can erase both the evidence of the problem and the data you need to recover.
Know where the data lives and who can reach the services.
Compose creates named volumes for Elasticsearch, Redis, RabbitMQ, and object storage, plus a separate lab snapshot volume. Recreating a container normally does not delete these volumes. However, they remain on the same host and do not become an off-site backup if the host fails.
docker compose ps
docker volume ls --filter label=com.docker.compose.project=sectools-opencti-labThe platform publishes only 127.0.0.1:18080. Its dependencies remain inside the Compose network. This lab uses Silo for S3-compatible storage, but the service is still named minio to match OpenCTI's configuration keys. A service name is not a product version; check the Compose image field.
Images referenced in older articles may no longer be available. If a pull fails, distinguish network issues, authentication, missing tags, and incompatible CPU architectures. Do not simply change every version to latest. Compare the official deployment repository with the tested configuration before changing components individually.
Finish the session carefully, too.
docker compose stop
# 下次繼續:
docker compose up -d --wait --wait-timeout 600To remove the lab's containers and network, use docker compose down; named volumes are preserved by default. Do not add an option that deletes volumes unless you understand exactly what will be removed, no longer need it, and have a backup. Colima users can stop the containers and then run colima stop --profile opencti-tutorial to release the virtual machine's resources.
This chapter is complete when configuration validation succeeds, services start normally, and you understand the data locations. Login and data processing still need to be verified before the deployment can be considered usable.
Further reading: Official OpenCTI installation guide, Compose startup order, Docker Volume. For more hands-on security tools, continue exploring SecTools.tw.
Finished this chapter?
Mark it when you are ready. Opening or scrolling through a chapter does not complete it automatically. You can undo your choice.
Record what you have actually done.
These are self-assessments. This site does not connect to OpenCTI to verify your work or certify your skills.
Progress is saved only in this browser. No account or automatic device sync. Clearing site data also removes progress.