Install Rust on Ubuntu Linux with rustup and VS Code
November 10, 2026
Welcome to episode 1 of Rust for Beginners, a series for complete beginners (no programming experience needed). In this video we install Rust on Ubuntu Linux with rustup, install VS Code, add the rust-analyzer extension and run our first program. Every command below is the exact command from the video, ready to copy.
- All episodes are in the Rust Tutorial for Beginners playlist.
- Versions used: Rust 1.99.1 on Ubuntu, VS Code with rust-analyzer.
1. Get the install command
Open your browser and search for: install rust. Click the link that starts with rust-lang.org, scroll down a little, and you will find the install command. Copy it.
2. Install Rust with rustup
Open the terminal with Ctrl + Alt + T, paste the command and press Enter.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shIf it says curl is not installed, install curl first, type your password, and then run the Rust command again:
sudo apt install curlKeep the default option and press Enter. Rust takes a little time to install.
3. Set up the environment variable
So that the terminal can find the Rust tools, copy and paste this command:
. "$HOME/.cargo/env"Check that it works:
rustc --version4. Install VS Code
sudo snap install code --classicEnter your password. This also takes a little time.
5. Create a folder for our code
mkdir lce
cd lce
code .Tick "Trust the authors of all files" and click Yes.
6. Install the rust-analyzer extension
Click Extensions, search for rust-analyzer, select the first result, click Install, then Trust Publisher and Install.
7. Write Hello World
Click the New File icon and name the file hello.rs. Write a Hello World program, and do not forget the semicolon at the end:
fn main() {
println!("Hello World");
}8. Compile and run
Open a terminal from the menu (Terminal, then New Terminal) or with the shortcut Ctrl + Shift + backtick. Compile the code with rustc and the file name, then run it with the file name without the extension:
rustc hello.rs
./helloHello WorldRecap
Rust is installed, VS Code is ready, and our first program printed Hello World. In the next video we learn Cargo.