Skip to main content

Installation

Setting up your Rust environment for Actix.

Actix 4.9+ 2 min read

# Installing Actix Web

Before writing your Actix Web application, you must install the Rust toolchain. Rust provides a tool called rustup which manages versions and associated tools (like cargo, the package manager).

##Installing Rust

If you do not have Rust installed, the easiest way to install it is via rustup. On macOS, Linux, or Unix-like environments, run:

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

On Windows, download the rustup installer from the official Rust website.

##Adding Actix Web to your Project

Once Rust is installed, you can create a new project:

terminalbash
cargo new actix_tutorial
cd actix_tutorial

Then, add Actix Web as a dependency. In your Cargo.toml, add:

code_blockstoml
[dependencies]
actix-web = "4"

You are now ready to start coding. Make sure your Rust compiler is reasonably up-to-date (1.80+ recommended) as Actix Web frequently benefits from standard library and language improvements.

Was this page helpful?

Reference Implementation

The following code snippet demonstrates the authoritative pattern for this documentation.

Cargo.toml
1[package]
2name = "actix_tutorial"
3version = "0.1.0"
4edition = "2021"
5
6[dependencies]
7actix-web = "4"
Was this page helpful?