Before writing any Rust code, you need to understand the basic concepts of systems programming, static typing, and the command line. In this episode you set up the official Rust toolchain with rustup, an editor with rust-analyzer, and Git, then verify the environment with your first cargo project.

Welcome to the Learning Rust series! This series will take you from mastering Rust — a safe, fast, and concurrent systems programming language — from foundational concepts to production readiness. In total there are 19 episodes organized into six learning phases.
But before writing a single line of Rust code, there are several basic skills and software tools you must have. Why are these pre-requisites important? Because Rust demands a clear understanding of memory, types, and how the compiler works. The Rust compiler is indeed strict, but that is exactly where the learning value lies: compile-time errors are far cheaper than bugs in production.
Episode 0 is your roadmap: making sure you have the basic skills, setting up the official Rust toolchain, editor, and Git, and then verifying your environment with your first cargo project. Once this episode is complete, the entire series can be followed comfortably.
Rust is a systems language with static typing: the type of every value is known at compile time. Before diving in, make sure you understand the concepts of the stack and the heap, because these are the main stage of every Rust program. Understand that the type determines how much memory is used and how a value is interpreted.
The concept that most distinguishes Rust from other languages is ownership: every value has exactly one owner, and memory is freed automatically when the owner goes out of scope. Pointers, references, and aliasing will become your daily companions. If these concepts still feel foreign, don't worry — episodes 2 and 6 will break them down slowly.
The entire Rust workflow revolves around the terminal: cargo build, cargo run, cargo test, and cargo add. Get used to navigating directories, reading error output, and using Git. If you are already comfortable with bash and the command line, episode 7 on dependency management will feel light.
rustup is the official Rust toolchain installer: it manages rustc, cargo, and other components in one place. Install it with the official script:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"After that, make sure the default toolchain is on the latest stable release:
rustup default stable
rustup updaterustup default stable selects the stable release as the default, and rustup update updates to the latest version. Rust uses a six-week release model with edition 2024 as the latest edition at the time of writing this series.
Check the three main components:
rustc --version
cargo --version
rustup showOutput must show the same rustc and cargo version, for example 1.85.0. rustup show displays the active toolchain, installed targets, and components such as rust-analyzer. All subsequent episodes use cargo as the main driver.
rust-analyzer is the official language server for Rust: autocomplete, go-to-definition, rename, and real-time diagnostics. Install it as a rustup component and then enable it in your editor:
rustup component add rust-analyzerIn VS Code, install the official rust-lang.rust-analyzer extension:
code --install-extension rust-lang.rust-analyzerAlternatives: IntelliJ Rust for JetBrains users, or Neovim with the lspconfig plugin. Pick one editor and use it consistently throughout the series.
Every Rust project is managed as a Git repository. Cargo even reads Git metadata to produce more accurate versions. Verify Git is installed and set up your identity:
git --version
git config --global user.name "Nama Kalian"
git config --global user.email "email@contoh.com"cargo new creates a complete binary crate structure: Cargo.toml as the manifest and src/main.rs as the entry point:
cargo new belajar-rust
cd belajar-rustThe resulting structure is simple: one source file and one manifest. The src directory is where all code lives, and Cargo.toml contains metadata, dependencies, and the edition.
Look at the contents of src/main.rs — by default it is already a valid program:
cat src/main.rsThe code inside is a fn main function that prints text to the screen. Run it with cargo run:
cargo runcargo run compiles the binary and then executes it. If Hello, world! appears and the process exits without error, your environment is fully functional.
Before moving on to episode 1, run a full verification:
rustc --version
cargo --version
rustup show
cargo runAll commands must run without error. Note down your rustc version, because episode 18 will discuss the tooling and newest features that appear in upcoming releases.
Key takeaways:
rustup manages rustc, cargo, and components such as rust-analyzer.rust-analyzer is the primary language server for your editor.cargo new creates a binary crate with src/main.rs and Cargo.toml.cargo run compiles and runs a program in a single step.In the next episode 1 we will discuss the history, background, and why Rust is needed — its origins at Mozilla, the philosophy of safety, concurrency, performance, and productivity, its comparison with C and C++, and when Rust becomes the right choice. Make sure your environment is ready, because the Learning Rust journey is just beginning!