Installing Dart SDK (Windows/Mac/Linux)
Installing Dart SDK (Windows / Mac / Linux)
Before you write a single line of Dart code, you need the Dart SDK installed on your machine. The SDK (Software Development Kit) contains everything you need: the Dart runtime, the dart command-line tool, the package manager (pub), and the compiler.
In this lesson, we'll walk through installation on all three major operating systems — step by step — and make sure everything is working correctly.
What is the Dart SDK?
The Dart SDK is a collection of tools and libraries that allow you to:
- Run Dart programs (
dart run) - Compile Dart to native executables (
dart compile exe) - Analyze your code for errors (
dart analyze) - Format your code (
dart format) - Manage packages via
pub(dart pub get)
Tip: If you're planning to use Flutter, the Flutter SDK already bundles the Dart SDK — you won't need a separate installation. However, for pure Dart development, install it independently.
🪟 Installation on Windows
You have two options on Windows: using winget (recommended, fast) or downloading manually from the official website.
Option 1 — winget (Recommended)
winget is Windows' built-in package manager available on Windows 10 (v1709+) and Windows 11.
Open PowerShell or Command Prompt as Administrator and run:
powershellwinget install Dart.Dart
That's it! winget will download and install the latest stable Dart SDK and automatically add it to your system PATH.
Option 2 — Chocolatey
If you use the Chocolatey package manager:
powershellchoco install dart-sdk
Option 3 — Manual Download
- Go to https://dart.dev/get-dart
- Click Download the Dart SDK under Windows
- Extract the ZIP file to a directory like
C:\dart-sdk\ - Add
C:\dart-sdk\binto your system PATH manually (see below)
Setting PATH on Windows (Manual Install Only)
If you installed manually, you need to add the Dart bin folder to your PATH:
- Open Start Menu → search for "Environment Variables"
- Click "Edit the system environment variables"
- Click "Environment Variables..."
- Under "System variables", find and select Path, then click Edit
- Click New and add:
C:\dart-sdk\bin - Click OK on all dialogs
- Restart your terminal
🍎 Installation on macOS
The easiest way to install Dart on macOS is via Homebrew.
Step 1 — Install Homebrew (if not already installed)
bash/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 2 — Tap the Dart Repository
bashbrew tap dart-lang/dart
Step 3 — Install Dart
bashbrew install dart
Homebrew will automatically handle PATH configuration.
Upgrading Dart on macOS
To update Dart to the latest version in the future:
bashbrew upgrade dart
Install a Specific Version (macOS)
bashbrew install dart@3.0
🐧 Installation on Linux
Option 1 — apt (Debian/Ubuntu)
bash# Step 1: Install dependencies sudo apt-get update -y sudo apt-get install apt-transport-https -y # Step 2: Add Google's signing key wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub \ | sudo gpg --dearmor -o /usr/share/keyrings/dart.gpg # Step 3: Add the Dart repository echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' \ | sudo tee /etc/apt/sources.list.d/dart_stable.list # Step 4: Install Dart SDK sudo apt-get update -y sudo apt-get install dart -y
Option 2 — yum / dnf (Fedora / RHEL / CentOS)
bash# Add the repository sudo rpm --import https://dl.google.com/linux/linux_signing_key.pub sudo curl https://storage.googleapis.com/download.dartlang.org/linux/rpm/dart_stable.repo \ -o /etc/yum.repos.d/dart_stable.repo # Install sudo yum install dart # or on Fedora: sudo dnf install dart
Option 3 — Snap (Any Linux Distro)
bashsudo snap install dart --classic
Setting PATH on Linux (if needed)
After installation, if dart isn't found, add it to your PATH in ~/.bashrc or ~/.zshrc:
bashexport PATH="$PATH:/usr/lib/dart/bin"
Then apply the changes:
bashsource ~/.bashrc # or for zsh: source ~/.zshrc
Verifying the Installation
Once installed on any platform, open a fresh terminal and run:
bashdart --version
You should see output similar to:
Dart SDK version: 3.x.x (stable) (...)
Also verify that the package manager works:
bashdart pub --version
And check what tools are available:
bashdart help
A command-line utility for Dart development.
Usage: dart <command|dart-file> [arguments]
Available commands:
analyze Analyze Dart code in a directory.
compile Compile Dart to various formats.
create Create a new Dart project.
format Idiomatically format Dart source code.
pub Work with packages.
run Run a Dart program.
test Run tests for a project.
Common Installation Errors & Solutions
Error: dart is not recognized as an internal or external command
Cause: The Dart bin directory is not in your PATH.
Fix (Windows):
powershell# Check current PATH in PowerShell $env:PATH -split ";" # Manually add temporarily to test: $env:PATH += ";C:\dart-sdk\bin" dart --version
Fix (Mac/Linux):
bash# Find where dart was installed which dart # Add to PATH (replace with your actual path) export PATH="$PATH:/path/to/dart/bin"
Error: winget command not found (Windows)
Fix: Update Windows to the latest version or install the App Installer package from the Microsoft Store.
Error: brew: command not found (macOS)
Fix: Install Homebrew first:
bash/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Error: Certificate / SSL errors during Linux apt install
Fix:
bashsudo apt-get install ca-certificates -y sudo update-ca-certificates
Error: Permission denied (Linux)
Fix: Use sudo for all installation commands, or fix permissions:
bashsudo chmod -R 755 /usr/lib/dart/bin
Error: Old Dart version after update
Fix:
bash# macOS brew upgrade dart # Linux (apt) sudo apt-get update && sudo apt-get upgrade dart # Verify dart --version
Quick Reference — All Platforms
| Platform | Command |
|---|---|
| Windows (winget) | winget install Dart.Dart |
| Windows (choco) | choco install dart-sdk |
| macOS (brew) | brew tap dart-lang/dart && brew install dart |
| Ubuntu/Debian | sudo apt-get install dart |
| Fedora/RHEL | sudo dnf install dart |
| Any Linux | sudo snap install dart --classic |
| Verify | dart --version |
Summary
In this lesson, you learned how to:
- Install Dart SDK on Windows using
wingetor manual download - Install Dart SDK on macOS using Homebrew
- Install Dart SDK on Linux using
apt,yum, orsnap - Configure PATH when needed for all platforms
- Verify the installation with
dart --version - Diagnose and fix common installation errors
Next Up: Now that Dart is installed, let's set up your IDE — VS Code or Android Studio — for a productive Dart development experience.