Skip to main content

Installation

This guide will help you install Leo on your system. Leo is distributed through Cargo (Rust’s package manager) and can also be built from source.

System Requirements

Leo requires Rust 1.93.1 or later. Make sure you have Rust installed before proceeding.

Supported Platforms

  • macOS (Intel and Apple Silicon)
  • Linux (x86_64)
  • Windows (64-bit and 32-bit)

Install Rust

If you don’t have Rust installed, you’ll need to install it first using rustup.
1

Install Rust on macOS or Linux

Run the following command in your terminal:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
This will download and install rustup, which manages Rust versions.
2

Install Rust on Windows

Download and run the appropriate installer:Follow the on-screen instructions to complete the installation.
3

Verify Rust Installation

After installation, verify that Rust is installed correctly:
rustc --version
cargo --version
You should see version information for both commands.

Install Leo

There are two ways to install Leo: using Cargo or building from source.

Verify Installation

Once installed, verify that Leo is working correctly:
1

Check Leo is in your PATH

Run the following command:
leo
You should see the Leo help message with available commands.
2

Check Leo version

Verify which version of Leo you have installed:
leo --version
This will display the current version of Leo, for example: leo 3.4.0.

Update Leo

You can update Leo to the latest released version using the following command:
leo update
If you were using a prerelease version of Leo, this will overwrite that with the latest released version.

Command Line Options

Leo provides several global flags that can be used with any command:
leo [OPTIONS] <COMMAND>

Global Options

  • -d, --debug - Print additional information for debugging
  • -q, --quiet - Suppress CLI output
  • --json-output[=<PATH>] - Write results as JSON to a file
  • --disable-update-check - Disable Leo’s daily check for version updates
  • --path <PATH> - Path to Leo program root folder
  • --home <PATH> - Path to Aleo program registry

Troubleshooting

Leo command not found

If you get a “command not found” error, make sure Cargo’s bin directory is in your PATH:
export PATH="$HOME/.cargo/bin:$PATH"
Add this line to your ~/.bashrc, ~/.zshrc, or equivalent shell configuration file.

Installation fails during compilation

If installation fails with compilation errors:
  1. Make sure you have Rust 1.93.1 or later:
    rustup update
    
  2. Try cleaning the cargo cache:
    cargo clean
    
  3. Attempt the installation again

Permission denied errors

On Unix-like systems, you may need to make sure you have write permissions to Cargo’s installation directory, or use:
cargo install leo-lang --locked

Next Steps

Quick Start Tutorial

Create your first Leo program and learn the basics