Skip to content

Installing Dojo

Dojo's installation process was designed to be idiomatically consistent with its dependencies, Rust and Cairo. You can get up-and-running in just a few steps, and be building provable games in no time.

Windows Users: Windows is not natively supported. We recommend WSL for Windows development.

Quick Start

For existing Cairo developers, the fastest way to get started is with dojoup:

# Install dojoup
curl -L https://install.dojoengine.org | bash
 
# Restart your terminal, then install Dojo
dojoup install

This will install all necessary dependencies and tools. Skip to Verification to test your installation.

Detailed Installation

Prerequisites

Before installing Dojo, you'll need these foundational tools:

1. Install Rust with rustup

Rust is required for Dojo's infrastructure tools (Katana and Torii).

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

This installs Rust's executables, including the cargo package manager, in the ~/.cargo directory.

Verify installation:
cargo --version
# Should output: cargo 1.87.0 (or similar)

For more information, see the Rust installation guide.

2. Install Cairo with starkup

Dojo is written in Cairo, StarkWare's language for creating provable programs.

curl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.sh | sh

This installs Cairo's toolchain, including the scarb package manager and build tool, in the ~/.asdf directory.

Note: asdf does not automatically add itself to your path. Consider appending ~/.asdf/shims to your terminal's $PATH variable to simplify development.

Verify installation:
scarb --version
# Should output: scarb 2.11.4 (or similar)

For more information, see the starkup documentation.

Installing Dojo

Option 1: Using dojoup (Recommended)

dojoup is the preferred way to install and manage Dojo installations:

Install dojoup

curl -L https://install.dojoengine.org | bash

This command installs dojoup in the ~/.dojo directory and adds it to your shell profile.

Important: You need to restart your terminal for the dojoup command to be available.

Install Dojo

In a new terminal window, run:

dojoup install

This installs katana, torii, and sozo in the ~/.dojo directory.

Advanced Usage

# Install a specific version
dojoup install 1.5.0
 
# Get help
dojoup --help

Option 2: Using asdf

You can alternatively use asdf for more advanced version management:

Install asdf

Follow the asdf installation instructions for your platform, if not already installed.

Add the asdf-dojo plugin

asdf plugin add dojo https://github.com/dojoengine/asdf-dojo

Install Dojo

# Install the latest version
asdf install dojo latest
 
# Install a specific version
asdf install dojo 1.0.0
 
# List available versions
asdf list all dojo

Set the version

# Set version locally (in project directory)
asdf set dojo latest
 
# Set version globally (in user's home directory)
asdf set --home dojo latest

Verification

After installation, verify that all tools are working correctly:

Check Dojo Tools

# Check Sozo (CLI tool)
sozo --version
# Should output: sozo 1.0.0 (or similar)
 
# Check Katana (sequencer)
katana --version
# Should output: katana 1.0.0 (or similar)
 
# Check Torii (indexer)
torii --version
# Should output: torii 1.0.0 (or similar)

Test Your Installation

Create a simple test project to verify everything works:

# Clone the dojo-intro repository
git clone https://github.com/dojoengine/dojo-intro
 
# Navigate to the contracts
cd dojo-intro/contracts
 
# Build the project
sozo build
 
# Test successful if no errors appear

Code Editor Support

Visual Studio Code

Install the Cairo 1.0 extension for:

  • Syntax highlighting
  • Error detection
  • Auto-completion
  • Code formatting

Getting Help

If you run into problems getting started with Dojo, join our Discord and ask for help.

Next Steps

With Dojo installed, you're ready to start building: