M Logo
📁 Rust for Beginners · Part 1 of 22

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.

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.

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

If it says curl is not installed, install curl first, type your password, and then run the Rust command again:

bash
sudo apt install curl

Keep 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:

bash
. "$HOME/.cargo/env"

Check that it works:

bash
rustc --version

4. Install VS Code

bash
sudo snap install code --classic

Enter your password. This also takes a little time.

5. Create a folder for our code

bash
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:

rust
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:

bash
rustc hello.rs
./hello
text
Hello World

Recap

Rust is installed, VS Code is ready, and our first program printed Hello World. In the next video we learn Cargo.

© 2026 All Rights Reserved By Mahmudul Alam