If you use Linux or macOS, there are two different ways to install Foundry.
This is the easiest option for Linux and macOS users.
Open your terminal and type in the following command:
curl -L https://foundry.paradigm.xyz | bash
This will download
foundryup. Then install Foundry by running:
If everything goes well, you will now have three binaries at your disposal:
If you use macOS and display below error, you need type
brew install libusb to install Library
dyld: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
foundryupafter installation, simply run
foundryupagain, and it will update to the latest Foundry release. You can also revert to a specific version of Foundry with
foundryup -v $VERSION.
To build from source, you need to get Rust and Cargo. The easiest way to get both is by using
On Linux and macOS, this is done as follows:
curl https://sh.rustup.rs -sSf | sh
It will download a script and start the installation.
If you use Windows, you need to build from source to get Foundry.
Download and run
rustup-init from rustup.rs. It will start the installation in a console.
If you encouner an error, it is most likely the case that you do not have the VS Code Installer which you can download here and install.
After this, run the following to build Foundry from source:
cargo install --git https://github.com/foundry-rs/foundry foundry-cli anvil --bins --locked
To update from source, run the same command again.
Foundry can also be used entirely within a Docker container. If you don't have it, Docker can be installed directly from Docker's website.
Once installed, you can download the latest release by running:
docker pull ghcr.io/foundry-rs/foundry:latest
It is also possible to build the docker image locally. From the Foundry repository, run:
docker build -t foundry .
Some machines (including those with M1 chips) may be unable to build the docker image locally. This is a known issue.