Skip to content

Environments

Melvin PETIT edited this page Jun 17, 2026 · 1 revision

Environments

Medusa isolates each working context in a named environment. An environment is a directory under medusa_deployments/<env_name>/ holding one sub-directory per deployed tool, with its compose file, .env and credentials.txt. Two environments never share compose files, volumes or credentials.

This lets you keep separate contexts side by side: a SOC lab, a client audit, a training session, a throwaway test, each with its own tools and data.

Choosing an environment (interactive)

At startup Medusa shows existing environments (name, size, tool count, last modified) and offers three options:

Option Behaviour
1 New environment Prompt for a custom name. The name is sanitized: spaces become _, and any character outside [a-zA-Z0-9_-] is stripped. If the name already exists, you are asked whether to continue with it.
2 Continue existing Pick from a numbered list of existing environments.
3 Auto-generate Creates env_YYYYMMDD_HHMMSS.

Examples of useful names: lab_soc, audit_client_2026, test_grc.

Choosing an environment (CLI)

CLI mode does not prompt. Set ENV_NAME in the shell (defaults to default):

ENV_NAME=lab_soc        ./medusa.sh deploy wazuh
ENV_NAME=lab_soc        ./medusa.sh status
ENV_NAME=audit_client   ./medusa.sh deploy keycloak

All commands that touch deployments (deploy, start, stop, restart, status, logs, remove) honour ENV_NAME. The tools directory becomes medusa_deployments/$ENV_NAME/.

On-disk structure

medusa_deployments/
├── lab_soc/
│   ├── wazuh/
│   │   ├── docker-compose.yml
│   │   └── credentials.txt
│   └── opencti/
│       ├── docker-compose.yml
│       ├── .env
│       └── credentials.txt
└── audit_client/
    └── keycloak/
        ├── docker-compose.yml
        └── credentials.txt

The Configuration page (C in the menu) reports the active environment, its tool count and size, plus a count and total size of all environments. See Configuration.

Notes

  • medusa_deployments/ is git-ignored and must never be committed, it contains generated credentials.
  • Removing an environment is a manual rm -rf medusa_deployments/<env_name> after stopping its tools, Medusa does not delete whole environments for you.
  • Port collisions are per-host, not per-environment. Running the same Docker tool in two environments at once will conflict on its published ports. See Ports-Reference.

Next: Usage · Ports-Reference

Clone this wiki locally