Skip to content

We are working on this site. Want to help? Open an issue or a pull request on GitHub.

Installation

JavaScript developers are familiar with Node.js and npm for building JavaScript applications. Similarly, Rust has its own toolchain that we’ll install in this guide.

The recommended way to install Rust is through rustup:

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

Download and run the installer from rustup.rs.

After installation, verify that Rust is installed correctly:

rustc --version
cargo --version

To update Rust to the latest version:

rustup update

To uninstall Rust:

rustup self uninstall

Install the “rust-analyzer” extension for the best Rust development experience.

Install the “Rust” plugin for IntelliJ IDEA.

When you install Rust through rustup, you get several important tools:

  1. rustc: The Rust compiler (similar to Node.js’s V8 engine)
  2. cargo: Rust’s package manager and build system (similar to npm/yarn)
  3. rustup: The toolchain installer and manager itself
JavaScript EcosystemRust Ecosystem
noderustc
npm / yarncargo
nvmrustup
package.jsonCargo.toml
node_modules/target/
npxcargo run

Most JavaScript developers are used to excellent editor support. For Rust, the best experience is currently with:

If you’re already using VS Code for JavaScript, you can add Rust support:

  1. Install the rust-analyzer extension
  2. Optionally install CodeLLDB for debugging
  • JetBrains IDEs: Use the Rust plugin or the dedicated RustRover
  • Vim/Neovim: Use rust-analyzer with CoC or built-in LSP
  • Emacs: Use rust-analyzer with Eglot or LSP-mode

Now that you have Rust installed, you can create your first Rust project using Cargo!

If you’re on Windows and encounter errors about missing tools, you might need to install the Microsoft C++ Build Tools.

If you get “command not found” errors, ensure that ~/.cargo/bin is in your PATH.

If you encounter any issues, the Rust community is very helpful:

You’re now ready to start developing in Rust! Let’s move on to Hello, World!