There are six main ways to install medusa:
- Using Go Install
- Using Homebrew
- Using Nix
- Using Docker
- Building from source
- Using Precompiled binaries
If you have any difficulty with installing medusa, please open an issue on GitHub.
You need to have Go installed (version 1.26.10 or later). Use the latest patch release of a supported Go version. Installation instructions for Go can be found here.
Run the following command to install the latest version of medusa:
go install github.com/crytic/medusa@latestThis will download, compile, and install the medusa binary to your $GOPATH/bin directory. Make sure this directory is in your PATH environment variable.
Note that using Homebrew is only viable (and recommended) for macOS and Linux users. For Windows users, you must use one of the other installation methods.
Installation instructions for Homebrew can be found here.
Run the following command to install the latest stable release of medusa:
brew install medusaTo install the latest development version:
brew install --HEAD medusaMake sure nix is installed and that nix-command and flake features are enabled. The Determinate Systems nix-installer will automatically enable these features and is the recommended approach. If nix is already installed without these features enabled, run the following commands:
mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.confTo build medusa with nix:
# Clone the repository if you haven't already
git clone https://github.com/crytic/medusa
cd medusa
# Build medusa
nix buildThe resulting binary can be found at ./result/bin/medusa.
After building, you can add the build result to your PATH using nix profiles by running the following command:
nix profile install ./resultYou need to have Docker installed. Installation instructions for Docker can be found here.
Pull the latest Docker image from GitHub Container Registry:
docker pull ghcr.io/crytic/medusaRun medusa in a container:
docker run -it --rm -v $(pwd):/src ghcr.io/crytic/medusa <command>This will mount your current directory to /src in the container and run the specified medusa command.
Before building medusa from source, you will need:
- Go (version 1.26.10 or later, latest patch release recommended) - Installation instructions
crytic-compile- Installation instructions- Note that
crytic-compilerequires a Python environment - Python installation instructions
- Note that
slither(Optional) - For improved value generation we recommend also installing Slither
Run the following commands to build medusa (this should work on all OSes):
# Clone the repository
git clone https://github.com/crytic/medusa
# Build medusa
cd medusa
go build -trimpathYou will now need to move the binary (medusa or medusa.exe) to somewhere in your PATH environment variable so that
it is accessible via the command line. Please review the instructions
here (if you are a Windows user, we
recommend using the Windows GUI).
The precompiled binaries can be downloaded on medusa's GitHub releases page.
NOTE: macOS may set the quarantine extended attribute on the downloaded zip file. To remove this attribute, run the following command:
sudo xattr -rd com.apple.quarantine <my_file.tar.gz>.
Once downloaded, you will need to unzip the file and move the binary to somewhere in your $PATH. Please review the instructions
here (if you are a Windows user, we
recommend using the Windows GUI).