If you are learning Dart programming or planning to develop applications with Flutter, one of the first things you need to do is install the Dart SDK on your computer.
Dart is a modern programming language developed by Google. It is best known as the programming language behind Flutter, but Dart can also be used for command-line applications, server-side development, web applications, and other software projects.
Installing Dart is straightforward, but the process is slightly different depending on whether you are using Windows, macOS, or Linux.
In this complete beginner-friendly guide, you will learn:
- What Dart SDK is
- Dart system requirements
- How to install Dart on Windows
- How to install Dart on macOS
- How to install Dart on Linux
- How to verify the installation
- How to configure PATH
- How to update Dart
- How to uninstall Dart
- How to troubleshoot common installation problems
- How to create and run your first Dart program
By the end of this guide, you should have Dart installed and ready to use.
What Is Dart?
Dart is a general-purpose programming language developed by Google.
It is especially popular because it is used by Flutter for building applications.
Dart can be used to create:
- Mobile applications
- Web applications
- Desktop applications
- Command-line applications
- Backend applications
- Cross-platform applications
Dart has a syntax that is relatively easy to learn, especially if you already know languages such as Java, JavaScript, C#, or C++.
A simple Dart program looks like this:
void main() {
print('Hello, Dart!');
}
When you run this program, it prints:
Hello, Dart!
What Is the Dart SDK?
Before installing Dart, it is important to understand what the Dart SDK is.
SDK stands for Software Development Kit.
The Dart SDK contains the tools required to develop and run Dart applications.
It includes tools such as:
- Dart compiler
- Dart runtime
- Dart command-line interface
- Dart package tools
- Dart analyzer
- Dart formatter
- Development utilities
When you install the Dart SDK, you get the dart command that you can use from your terminal.
For example:
dart --version
This command displays the installed Dart version.
Dart SDK vs Flutter SDK
If you are learning Flutter, you may wonder whether you need to install Dart separately.
The answer is usually no.
The Flutter SDK includes the Dart SDK.
When you install Flutter, Dart is included with it.
You can verify the Dart version used by your Flutter installation with:
flutter --version
You can also run:
dart --version
If Flutter has been correctly configured, the Dart command should be available through the Flutter installation.
When should you install Dart separately?
Installing Dart independently can be useful when:
- You are learning Dart without Flutter.
- You want to create Dart CLI applications.
- You are developing server-side Dart applications.
- You want a standalone Dart development environment.
- You do not need Flutter.
If your main goal is Flutter development, installing Flutter is generally the more relevant setup.
Dart Installation Requirements
Dart is lightweight and does not require a high-end computer.
Before installation, make sure you have:
- A supported Windows, macOS, or Linux system
- Internet access
- Permission to install software
- A terminal or command prompt
- Sufficient storage space
You should also use a currently supported Dart SDK release.
Because Dart versions and operating-system support can change over time, always check the official Dart installation documentation before installing a specific release.
How to Install Dart on Windows
There are several ways to install Dart on Windows.
For most beginners, the easiest approaches are:
- Using the official Dart installer
- Using Chocolatey
- Using the Windows package manager
The exact installation method you choose depends on your preferences.
Method 1: Install Dart Using the Official Installer
The official Dart SDK distribution provides Windows installation options.
Step 1: Download Dart
Visit the official Dart website and open the Dart installation section.
Download the Windows version of the Dart SDK.
Choose the version appropriate for your system.
Step 2: Install the Dart SDK
After downloading the installer or package:
- Open the downloaded file.
- Follow the installation instructions.
- Select the installation location if prompted.
- Complete the installation.
The installer places Dart on your computer.
Step 3: Configure PATH
For the dart command to work from Command Prompt or PowerShell, Dart needs to be available through your system’s PATH.
If the installer configures PATH automatically, you may not need to do anything else.
If it does not, you need to add Dart’s bin directory to the Windows PATH environment variable.
The PATH allows Windows to locate executable commands without requiring you to type their full location.
Step 4: Open a New Terminal
After changing PATH, close your existing Command Prompt or PowerShell window.
Open a new terminal.
This is important because an already-open terminal may not immediately recognize updated environment variables.
Step 5: Verify Dart Installation
Run:
dart --version
You should see output containing the installed Dart SDK version.
For example:
Dart SDK version: 3.x.x
The exact version will depend on the current Dart release.
Method 2: Install Dart Using Chocolatey
If you already use Chocolatey on Windows, you can install Dart through it.
Open PowerShell or Command Prompt with the appropriate permissions and run:
choco install dart-sdk
After installation, restart your terminal and check:
dart --version
If the command displays the Dart version, the installation was successful.
Method 3: Install Dart Using Windows Package Manager
Windows systems may also use package-management tools such as winget.
If the Dart package is available through your configured package sources, you can search for it using:
winget search Dart
Then install the appropriate Dart package shown by the search results.
After installation:
dart --version
Package availability can change, so the search result should be treated as the current source of truth.
How to Install Dart on macOS
macOS provides several ways to install Dart.
For developers, using Homebrew is one of the most convenient approaches.
You can also install Dart through the official distribution.
Method 1: Install Dart Using Homebrew
Homebrew is a popular package manager for macOS.
If Homebrew is already installed, you can use it to install Dart.
Step 1: Open Terminal
Open:
Applications → Utilities → Terminal
Or press:
Command + Space
and search for:
Terminal
Step 2: Check Homebrew
Run:
brew --version
If Homebrew is installed, you will see its version.
If the command is not found, install Homebrew first from its official website.
Step 3: Install Dart
Run:
brew tap dart-lang/dart
Then:
brew install dart
Homebrew will download and install Dart.
Step 4: Verify Dart
Run:
dart --version
If everything is configured correctly, the terminal will display your Dart SDK version.
Installing Dart on Apple Silicon Macs
Modern Macs use Apple Silicon processors such as:
- M1
- M2
- M3
- M4
Homebrew handles architecture-specific installation in most cases.
You can check your Mac architecture using:
uname -m
You may see:
arm64
for Apple Silicon.
An Intel-based Mac typically reports:
x86_64
You generally do not need to manually change Dart configuration based solely on this result when using an appropriate package manager installation.
Method 2: Install Dart Manually on macOS
You can also download Dart from the official Dart distribution and install it manually.
The general process is:
- Open the Dart website.
- Go to the installation section.
- Select macOS.
- Download the appropriate SDK.
- Extract or install the SDK.
- Add Dart’s
bindirectory to PATH. - Restart the terminal.
- Run
dart --version.
Manual installation can be useful when you need a specific SDK version or want more control over where the SDK is installed.
How to Add Dart to PATH on macOS
If Dart is installed but this command:
dart --version
returns:
command not found
Dart may not be included in your PATH.
Your shell configuration file may be:
~/.zshrc
for modern macOS systems using Zsh.
Depending on where Dart was installed, you can add its bin directory to PATH.
The general syntax is:
export PATH="/path/to/dart-sdk/bin:$PATH"
Then reload your shell:
source ~/.zshrc
Finally, test:
dart --version
The exact Dart SDK path depends on your installation method.
How to Install Dart on Linux
Dart can be installed on many Linux distributions.
The installation process depends on the distribution you are using.
Common Linux distributions include:
- Ubuntu
- Debian
- Linux Mint
- Fedora
- Arch Linux
The official Dart documentation provides installation instructions for supported Linux distributions.
Installing Dart on Ubuntu and Debian
For Debian-based systems, Dart can be installed through the official Dart package repository.
The general process involves:
- Updating package information.
- Installing required tools.
- Adding the Dart package repository.
- Installing the Dart SDK.
- Verifying the installation.
A typical package-based installation uses commands similar to:
sudo apt-get update
Then install the Dart package:
sudo apt-get install dart
Depending on your system configuration, you may first need to configure the official Dart repository.
Always use the current repository instructions from the official Dart documentation because repository setup commands can change.
Installing Dart on Fedora
Fedora users can install Dart using the appropriate package management tools and repository configuration.
Depending on the current Dart distribution, the process may involve configuring the Dart repository and then installing the package.
After installation, verify it with:
dart --version
Installing Dart on Other Linux Distributions
If you are using another Linux distribution, check the official Dart installation documentation for the currently supported installation method.
This is important because:
- Package names may differ.
- Repository configuration may differ.
- Package managers differ.
- Architecture requirements may differ.
For example:
Ubuntu/Debian → apt
Fedora → dnf
Arch → pacman
The preferred Dart installation method may vary by distribution.
Verify Dart Installation on Any Operating System
After installing Dart, always verify the installation.
Open your terminal or command prompt and run:
dart --version
If Dart is correctly installed, you should see something similar to:
Dart SDK version: 3.x.x
The exact version will vary.
Check the Dart Executable Location
You can also check where Dart is installed.
Windows
Run:
where dart
macOS/Linux
Run:
which dart
This can be useful when troubleshooting multiple Dart installations.
For example, if you have multiple SDKs installed, the command shows which Dart executable your terminal is currently using.
Check Dart Information
You can use:
dart --help
to see available Dart commands and options.
For example:
dart --help
provides information about commands such as:
run
compile
create
pub
analyze
format
test
Create Your First Dart Project
Once Dart is installed, you can create your first Dart project.
Open your terminal and run:
dart create hello_dart
This creates a new Dart project named:
hello_dart
Move into the project:
cd hello_dart
Then run:
dart run
You should see the project’s output in the terminal.
Understanding the Dart Project Structure
A newly created Dart project can contain files and directories such as:
hello_dart/
├── bin/
│ └── hello_dart.dart
├── test/
├── pubspec.yaml
├── CHANGELOG.md
└── README.md
The exact generated structure can vary depending on the Dart SDK version and project template.
Let’s understand the important files.
bin Directory
The bin directory commonly contains executable Dart applications.
For example:
bin/hello_dart.dart
may contain:
void main() {
print('Hello world!');
}
What Is pubspec.yaml?
The pubspec.yaml file is an important Dart project configuration file.
It can define:
- Project name
- Description
- Version
- Dependencies
- Development dependencies
- SDK constraints
For example:
name: hello_dart
description: A simple Dart application
Dart projects use the pub package management system to manage dependencies.
How to Add a Dart Package
Dart has a large ecosystem of packages.
Packages are commonly published through pub.dev.
You can add a dependency to your project using:
dart pub add package_name
For example:
dart pub add http
This updates your project’s dependency configuration.
You can then retrieve dependencies using:
dart pub get
Run a Dart File Directly
You don’t always need to create a complete project.
You can create a file such as:
main.dart
Add:
void main() {
print('Hello Dart!');
}
Then run:
dart run main.dart
The output should be:
Hello Dart!
Run Dart Code in Development
For simple programs, use:
dart run
If you want to run a specific Dart file:
dart run bin/main.dart
The exact path depends on your project structure.
Format Dart Code
Dart includes an official formatter.
You can format a Dart file with:
dart format main.dart
Or format an entire project:
dart format .
Formatting your code consistently makes projects easier to read and maintain.
Analyze Dart Code
Dart also includes a static analyzer.
Run:
dart analyze
The analyzer can detect various problems, such as:
- Syntax issues
- Type problems
- Unused code
- Potential programming mistakes
- Lint-related issues depending on project configuration
It is good practice to run the analyzer regularly while developing.
Test Dart Applications
Dart includes support for automated testing.
A Dart project can contain a test directory.
You can run tests with:
dart test
Automated testing helps ensure that your application behaves correctly as it evolves.
Update Dart
Dart is actively developed, so newer SDK versions are released over time.
If you installed Dart through a package manager, update it using that package manager.
Homebrew
On macOS:
brew update
brew upgrade dart
Chocolatey
On Windows:
choco upgrade dart-sdk
For other installation methods, follow the update procedure appropriate to that installation.
Before upgrading an important project, check the Dart SDK constraints and compatibility of the project’s dependencies.
How to Uninstall Dart on Windows
The uninstall process depends on how Dart was installed.
If you installed Dart using an installer:
- Open Windows Settings.
- Go to Apps.
- Find Dart.
- Select Uninstall.
- Follow the uninstall instructions.
If you installed Dart using Chocolatey, you can use:
choco uninstall dart-sdk
After uninstalling, verify:
dart --version
If Dart was completely removed from PATH, the command should no longer be available.
How to Uninstall Dart on macOS
If Dart was installed using Homebrew:
brew uninstall dart
You can then verify:
dart --version
If you manually installed Dart, remove the SDK directory and remove its PATH entry from your shell configuration file.
How to Uninstall Dart on Linux
If Dart was installed using a Debian-based package manager, you can typically remove it using:
sudo apt remove dart
If you configured an additional Dart repository, you may also want to remove the repository configuration if you no longer need it.
The exact uninstall process depends on your Linux distribution and installation method.
Common Dart Installation Problems
Even though Dart installation is usually simple, beginners may encounter a few common errors.
Problem 1: dart: command not found
If you see:
dart: command not found
Dart may not be installed or its bin directory may not be included in PATH.
Solution
Check whether Dart is installed.
Then check:
macOS/Linux
which dart
Windows
where dart
If nothing is returned, check your installation.
If Dart exists but isn’t found, update your PATH.
Problem 2: Dart Works in One Terminal but Not Another
This commonly happens after changing PATH.
Solution
Close the terminal completely.
Open a new terminal window.
Then run:
dart --version
Environment variables are generally loaded when a shell starts, so an existing terminal may still have the old PATH.
Problem 3: Multiple Dart Versions Are Installed
If you have installed Dart through multiple methods, you may have more than one Dart executable.
Check:
which dart
or on Windows:
where dart
You can then determine which installation is being used.
Problem 4: Dart Version Is Not Compatible With Your Project
A project can specify an SDK version constraint in pubspec.yaml.
For example:
environment:
sdk: ^3.0.0
If your installed Dart version doesn’t satisfy the project’s constraint, dependency installation or project execution may fail.
Check your version:
dart --version
Then inspect the project’s pubspec.yaml.
Problem 5: Permission Errors on Linux or macOS
Some installation locations may require administrative permissions.
You may see errors related to permissions when installing packages.
Use the installation instructions appropriate for your package manager and avoid changing permissions unnecessarily.
Problem 6: Package Installation Problems
If a Dart dependency isn’t installing correctly, try:
dart pub get
You can also inspect your pubspec.yaml for:
- Incorrect package names
- Invalid version constraints
- YAML formatting errors
- Unsupported SDK constraints
Dart Installation for Flutter Developers
If your goal is to learn Flutter, there is an important distinction.
You normally install the Flutter SDK, rather than installing Dart separately.
Flutter includes the Dart SDK.
After installing Flutter, you can check:
flutter --version
and:
dart --version
You can also run:
flutter doctor
flutter doctor checks your Flutter development environment and reports configuration issues.
For example, it can identify missing development tools, Android SDK configuration issues, or other setup requirements.
Recommended Tools for Dart Development
Once Dart is installed, you can use a code editor or IDE.
Popular options include:
Visual Studio Code
VS Code is lightweight and widely used for Dart and Flutter development.
With the appropriate Dart extension, it provides features such as:
- Syntax highlighting
- Code completion
- Debugging
- Formatting
- Error detection
- Refactoring
Android Studio
Android Studio is commonly used by Flutter developers.
With Flutter and Dart plugins configured, it can provide:
- Dart development
- Flutter development
- Debugging
- Android emulator integration
- Device management
- Code analysis
IntelliJ IDEA
IntelliJ IDEA can also be used for Dart and Flutter development with the appropriate plugins.
Dart Installation Checklist
Before starting Dart development, make sure:
- Dart SDK is installed.
dart --versionworks.- Dart is available in PATH.
- You can create a Dart project.
dart runworks.dart analyzeworks.dart formatworks.dart pub getworks.- Your code editor recognizes Dart.
If all of these work, your Dart development environment is ready.
Windows vs macOS vs Linux Dart Installation
The basic Dart installation process is similar across operating systems, but the tools differ.
| Feature | Windows | macOS | Linux |
|---|---|---|---|
| Terminal | PowerShell / Command Prompt | Terminal | Terminal |
| Common package manager | Chocolatey / winget | Homebrew | apt / dnf / pacman |
| PATH configuration | Windows Environment Variables | Shell configuration | Shell configuration |
| Verify installation | dart --version | dart --version | dart --version |
| Locate executable | where dart | which dart | which dart |
| Project creation | dart create | dart create | dart create |
| Run application | dart run | dart run | dart run |
The Dart commands themselves are largely the same across platforms.
Frequently Asked Questions
Is Dart free to install?
Yes. The Dart SDK is available as a free, open-source development tool.
Do I need Flutter to use Dart?
No.
Dart can be installed and used independently.
Flutter uses Dart, but Dart itself is not limited to Flutter.
Can I install Dart without Android Studio?
Yes.
Android Studio is not required to write or run basic Dart applications.
It becomes more relevant when you are developing Android applications, especially with Flutter.
Can I use Dart on Windows?
Yes.
Dart supports Windows development, and you can install the Dart SDK and use it through PowerShell or Command Prompt.
Can I use Dart on macOS?
Yes.
Dart works on macOS, including modern Apple Silicon Macs and supported Intel-based systems.
Can I use Dart on Linux?
Yes.
Dart can be installed on supported Linux distributions using the appropriate installation method.
How do I check my Dart version?
Run:
dart --version
How do I check whether Dart is installed correctly?
Run:
dart --version
Then create a test project:
dart create hello_dart
cd hello_dart
dart run
If the project runs successfully, your Dart environment is working.
Do Flutter and Dart use the same SDK?
Flutter includes its own Dart SDK.
Therefore, Flutter developers generally don’t need a separate standalone Dart installation.
Final Thoughts
Installing Dart is the first step toward building applications with the Dart programming language.
Whether you use Windows, macOS, or Linux, the basic workflow is simple:
Install Dart → Configure PATH → Verify Dart → Create a Project → Run Your Code
The most important command to remember is:
dart --version
This confirms that your system can find the Dart SDK.
Once Dart is installed, start practicing with small programs and gradually learn:
- Variables
- Data types
- Functions
- Conditions
- Loops
- Lists
- Maps
- Classes
- Objects
- Null safety
- Exception handling
- Asynchronous programming
- Packages
- File handling
If your ultimate goal is Flutter development, your next step should be learning how Dart works with Flutter and then setting up the Flutter development environment.
Dart provides the programming foundation, while Flutter provides the framework for building cross-platform applications.
Quick Dart Installation Commands
Check Dart Version
dart --version
Create a Project
dart create my_app
Enter Project
cd my_app
Run Project
dart run
Add a Package
dart pub add package_name
Get Dependencies
dart pub get
Format Code
dart format .
Analyze Code
dart analyze
Run Tests
dart test
With these commands and the installation steps covered in this guide, you have everything you need to install Dart and begin developing your first Dart applications on Windows, macOS, or Linux.




