Docker containers
Docker is a software that use OS-level virtualization to deliver software in packages called images and containers when running them. Containers bundle their own software and are isolated from the host system, this prevents conflicts with other installed software.
There are several implamentations to run Docker images but radare2 images only have been tested with docker, podman and nerdctl.
Available images
There are 2 mantained docker images, one for the official releases and one targeted to be build locally from GIT. Both can be used similarly.
Stable version
This docker image can be found in Docker Hub and contain the latest radare2 stable version. This image is based on Ubuntu and the same radare2 snap build. The Dockerfile used to build it can be found in this dedicated repository.
The resulting build includes the following projects:
- radare2
- r2ghidra
- r2frida (only in supported platforms)
- r2dec
- r2yara
- r2ai
- r2mcp
- r2pipe (for Python)
- r2book (as info page)
To use this docker image you can use either:
docker run -ti radare/radare2
podman run -ti docker.io/radare/radare2
nerdctl run -ti radare/radare2
To use the docker image as one shot so it removes everything inside the container on exit just add --rm as follows:
docker run --rm -ti radare/radare2
Another example to use for debugging inside the docker:
docker run --tty --interactive --privileged --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined radare/radare2
GIT version
Alternatively there is a version from radare2 GIT aimed to be build locally, also called r2docker.
This will build an image using Debian with radare2 from GIT with latest changes.
The Dockerfile to build can be found inside the dist/docker directory in the radare2 source tree.
To build this other image run the following lines:
git clone https://github.com/radareorg/radare2.git
cd radare2
make -C dist/docker
This will build an image with the following plugins by default:
It is possible to specify more packages using the R2PM make variable:
make -C dist/docker R2PM=radius2
Also, you can select the architecture (amd64 / arm64) to compile the image by using the ARCH make variable.
This Dockerfile also used by Remnux distribution from SANS, and is available on the Docker Hub, but it might not contain latest changes.
Run a container as r2web server
By default both images are intended to be used in a interactive terminal.
But both can also be launched directly to use the radare2 web UI.
The do so it can be launched using the following command:
docker run -p 9090:9090 radare/radare2 r2 -c '=h' -
Or the following docker-compose structure:
version: "3.8"
services:
radare2:
image: radare/radare2
command: r2 -c '=h' -
network_mode: bridge
ports:
- "9090:9090"
Or if debugging functionality is required:
version: "3.8"
services:
radare2:
image: radare/radare2
command: r2 -c '=h' -
network_mode: bridge
ports:
- "9090:9090"
privileged: true
cap_add:
- SYS_PTRACE
security_opt:
- "seccomp=unconfined"
- "apparmor=unconfined"
Run a container as MCP server
Claude Desktop Integration
In the Claude Desktop app, press CMD + , to open the Developer settings. Edit the configuration file and restart the client after editing the JSON file as explained below:
-
Locate your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the following to your configuration file:
{
"mcpServers": {
"radare2": {
"command": "docker",
"args": ["run", "--rm", "-i", "-v", "/tmp/data:/data", "--entrypoint", "r2mcp", "radare/radare2"]
}
}
}
VS Code Integration
To use r2mcp with GitHub Copilot Chat in Visual Studio Code by adding it to your user configuration (see also add an mcp server to vscode):
- Open the Command Palette with
CMD + Shift + P(macOS) orCtrl + Shift + P(Windows/Linux). - Search for and select
Copilot: Open User Configuration(typically found in~/Library/Application Support/Code/User/mcp.jsonin macOS). - Add the following to your configuration file:
{
"servers": {
"radare2": {
"type": "stdio",
"command": "docker",
"args": ["run", "--rm", "-i", "-v", "/tmp/data:/data", "--entrypoint", "r2mcp", "radare/radare2"]
}
},
"inputs": []
}
Zed Integration
You can use r2mcp with Zed as well by adding it to your configuration:
- Open the command palette:
CMD + Shift + P(macOS) orCtrl + Shift + P(Windows/Linux).1ยบ - Search of
agent: open configurationor search ofsettings. - Add your server as such:
"context_servers": {
"r2-mcp-server": {
"source": "custom",
"command": "docker",
"args": ["run", "--rm", "-i", "-v", "/tmp/data:/data", "--entrypoint", "r2mcp", "radare/radare2"],
"env": {}
}
}
Note: you will need another LLM agent, such as Claude, Gemini or else to be able to use it.