If you face any issues while installing, check out the FAQ.
Foundryup is the Foundry toolchain installer. You can find more about it here.
Open your terminal and run the following command:
curl -L https://foundry.paradigm.xyz | bash
This will install Foundryup, then simply follow the instructions on-screen,
which will make the
foundryup command available in your CLI.
foundryup by itself will install the latest (nightly) precompiled binaries:
foundryup --help for more options, like installing from a specific version or commit.
On Windows, you will also need a recent version of Visual Studio, installed with the "Desktop Development With C++" Workloads option.
You can either use the different Foundryup flags:
foundryup --branch master foundryup --path path/to/foundry
Or, by using a single Cargo command:
cargo install --git https://github.com/foundry-rs/foundry --profile local --locked forge cast chisel anvil
Or, by manually building from a local copy of the Foundry repository:
# clone the repository git clone https://github.com/foundry-rs/foundry.git cd foundry # install Forge cargo install --path ./crates/forge --profile local --force --locked # install Cast cargo install --path ./crates/cast --profile local --force --locked # install Anvil cargo install --path ./crates/anvil --profile local --force --locked # install Chisel cargo install --path ./crates/chisel --profile local --force --locked
See the foundry-rs/foundry-toolchain GitHub Action.
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 .
For examples and guides on using this image, see the Docker tutorial section.
Some machines (including those with M1 chips) may be unable to build the docker image locally. This is a known issue.