Since you have landed on the tutorial to install Rust, you might already be aware of what Rust is. If you’re unfamiliar with Rust, here’s a quick overview. Rust is a modern systems programming language used to build high-performance software. Developers who need high performance, low-level hardware control, and reliability choose Rust. Big tech companies such as Microsoft, Google, AWS, Cloudflare, and Meta use Rust for performance-critical and security-sensitive software alongside languages like C and C++. Rust is widely used for AI infrastructure, embedded systems, IoT devices, operating systems, blockchain applications, game engines, and networking software. Basically, Rust is used where you need to control hardware or build software to control hardware securely and reliably. Rust includes Cargo by default, its official package manager and build system that helps you manage dependencies, libraries, and Rust projects.
If you are a student or a professional looking to install Rust on your system to build software, you can follow this tutorial. In this tutorial I will guide you to install Rust on Ubuntu 26.04 or on Debian 13 Trixie. We will use the recommended method “rustup” to install because this method makes it easy to keep Rust updated in the future. So let’s get going
Prerequisites
- A system or VM with Ubuntu 26.04 or Debian 13 installed.
- A user with sudo privileges
Step 1 – Update the System
As always, let’s first update our system
sudo apt update -y
sudo apt upgrade -y
Step 2 – Install Curl
The next step is to install curl. Curl comes preinstalled on Ubuntu. If it isn’t available on your system, install it using this command
sudo apt install curl -y
Let’s confirm if curl is installed by checking its version
curl --version
Some Rust projects compile native C/C++ code during the build process. Installing build-essential now helps avoid linker and compilation errors later.
sudo apt install build-essential -y
Step 3 – Install Rust
Next we will install Rust on our system using curl.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Note:- The installer will show some options, if you know what you're doing, configure the installation using those options, otherwise, you can just press "Enter" and continue with the default settings. Rust compiler, Cargo and rustup will be installed automatically with this installation
Step 4 – Load Rust Environment
After installation, load the Cargo environment into the current shell
source "$HOME/.cargo/env"
Note:- The environment will be loaded automatically when you open a new terminal.
let’s verify the installation by checking Rust’s version
rustc --version
You should see something as below
rustc 1.xx.x
You can also check the Cargo version
cargo --version
You should see something like this
cargo 1.xx.x
If version information is displayed, Rust has been installed successfully.
Step 5 – Create First Project
Now let’s create our first project
cargo new hi_rust
This will create a new directory for your project
Move into the project directory and build and run the project
cd hi_rust
cargo run
You should see the given below output
Compiling hi_rust v0.1.0
Finished dev profile [unoptimized + debuginfo]
Running `target/debug/hi_rust`
Hello, world!
Step 6 – Update Rust
You don’t need to do this right after the installation, but you should do this periodically as Rust receives regular updates with bug fixes, security patches, and new features. With just one command, you can update Rust.
rustup update
With this, Rust has been updated
Check Toolchains
Rustup allows you to manage multiple Rust toolchains. To see the installed and active toolchains, run
rustup show
The “rustup show” command displays the installed toolchains along with the currently active and default toolchain
Install Nightly Toolchain
The Nightly toolchain provides access to experimental language features and the latest compiler improvements. It is mainly intended for testing and development. You can install it simply by executing this
rustup toolchain install nightly
You can switch to nightly with this command
rustup default nightly
and switch back to stable release with this command
rustup default stable
Uninstall Rust
Someday, if you want to uninstall Rust and its add ons completely, you just have to execute this command
rustup self uninstall
and it will be uninstalled
Conclusion
With this, we have successfully installed Rust on our Ubuntu 26.04 or Debian 13 Trixie system. It only takes a few minutes to install the complete package of the Rust compiler, Cargo, and rustup on Linux.
Frequently asked questions
Is Rust free to use?
Yes. Rust is completely free and open-source. You can download, use, modify, and distribute it without paying any licensing fees.
What is the difference between Stable and Nightly Rust?
The Stable toolchain is recommended for most users because it is thoroughly tested and suitable for production environments. The Nightly toolchain includes experimental features and the latest compiler improvements intended primarily for testing and development.