Back to Blog

Rust Tutorial for Beginners | Install, Write & Run Your First Program (2026)

Sandy LaneSandy Lane

Video: Rust Tutorial for Beginners | Install, Write & Run Your First Program (2026) by Taught by Celeste AI - AI Coding Coach

Watch full page →

Rust Tutorial for Beginners: Install, Write & Run Your First Program

This tutorial guides you through installing Rust, writing a simple "Hello, World!" program, and compiling it to a native executable. You'll learn how to verify your Rust installation, understand the basic structure of a Rust program, and run your compiled code.

Code

fn main() {
  // The main function is the entry point of a Rust program
  println!("Hello, World!");  // Prints text to the console
}

Key Points

  • Check Rust installation using rustc --version and cargo --version.
  • Install Rust easily with rustup by running curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh.
  • The fn main() function is the starting point of every Rust program.
  • Use println! macro to output text to the console.
  • Compile your program with rustc main.rs and run the resulting executable with ./main.