Flutter

Flutter Installation - Step by Step Guide for Windows, Mac and Linux

Flutter is a framework that allows you to develop apps and web apps (and now even Mac/Windows apps). The special thing is, you only have one codebase for all operating systems. If you haven’t worked with it yet, you’re in the right place. In my Blog I write about app and web development and my experiences with it. But now let’s get to the Flutter installation.

In many tutorials, you’re referred to the official Flutter installation page. However, what I can recommend is installing Flutter via the Flutter Version Manager (FVM). This allows you to manage different Flutter versions and use a specific version for each project.

Therefore, my suggestion is to install FVM directly and then use Flutter through it.

Installing Flutter on Windows

To be honest, I’m not a big fan of Windows and the whole development experience. Therefore, I can recommend switching to Linux or Mac. Ok, just kidding. You don’t have to switch right away, but it doesn’t hurt to take a look. :D

Step 1: Install Chocolatey

To ensure a clean installation, I recommend installing Chocolatey. If you haven’t installed Chocolatey yet, open a PowerShell as Administrator and run:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Wait until the installation is complete and then start a new PowerShell window. If you now type choco, you should see a list of commands.

Step 2: Install FVM

Flutter Version Manager (FVM) helps you manage different Flutter versions. With Chocolatey you can easily install FVM:

choco install fvm

That’s it, nothing more. Wait for the installation to complete and start a new PowerShell window. When typing fvm, you should also see a list of commands.

Step 3: Install Flutter

Now you can install Flutter via FVM. To install the latest stable version, run:

fvm install stable

This installs the latest version of Flutter. All settings are also made so that you can use Flutter directly. For Flutter to be available globally, you can set the stable version as global and thus define it as the default version.

fvm global stable

If you want to install a specific version, you can simply specify the version number, e.g.:

fvm install 3.32.0
fvm global 3.32.0

Step 4: Set up Flutter

With fvm flutter doctor -v you can check if everything is installed correctly. If everything is green there, you’re done. But usually a few tools are still missing that you need for development. Usually the Android SDK or Xcode (on macOS) is still missing.

For the Android SDK installation, I recommend installing Android Studio. Everything is installed directly there. You can download Android Studio here.


Installing Flutter on macOS

On macOS and Linux, the installation is quite similar. Therefore, I’ll only explain the macOS installation here. In both cases, we use Homebrew as a package manager. I’m quite a fan of Homebrew and I feel like I install everything through it. So let’s start with the Homebrew installation.

Step 1: Install Homebrew

At https://brew.sh/ you’ll find the installation command for Homebrew. Open the Terminal and paste the command there:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 2: Install FVM

After Homebrew is installed, you can install FVM (Flutter Version Manager) directly via Homebrew:

brew tap leoafarias/fvm
brew install fvm

Step 3: Install Flutter

Just like on Windows, you can now install Flutter via FVM. With FVM you can manage different Flutter versions and use a specific version per project. But first, let’s install the latest stable version of Flutter and set it as globally available version:

fvm install stable
fvm global stable

If you want to install a specific version, you can specify the version number, e.g.:

fvm install 3.32.0
fvm global 3.32.0

Step 4: Set up Flutter

With fvm flutter doctor -v you can check if everything is installed correctly. All checkmarks should be green. Usually something is still missing and you need to install a few more tools. For macOS, Xcode is important if you want to use the iOS simulator.

You can install it via the Mac App Store: Xcode in Mac App Store Don’t be surprised, Xcode usually takes hours to install completely.

We also need CocoaPods for iOS. You can also install this via Homebrew:

brew install cocoapods

Then just run this line to configure xcode:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

Create First Flutter App

After Flutter is successfully installed, test the installation with a test app:

fvm flutter create my_first_app
cd my_first_app
fvm flutter run

Set Flutter Environment Variables (optional)

If you find fvm flutter too cumbersome, you can also set the environment variable so that flutter works directly.

The path to your FVM Flutter version may vary depending on where you installed FVM. Add the following line to your ~/.bashrc, ~/.zshrc or ~/.profile file.

export PATH="$PATH":"$HOME/fvm/default/bin"

After that, you can simply use flutter in the terminal without having to write fvm before it.

Next Steps

After successful installation I recommend:

  1. Set up IDE: Install VS Code or Android Studio with Flutter Plugin
  2. Learn Flutter Basics: Go through the official Flutter Codelabs or check out my other blog articles
  3. Test Hot Reload: Change something in your test app and save - Flutter automatically reloads the app
  4. Create First Widget: Create your first Custom Widget

Conclusion

Flutter is relatively easy to install on all three platforms. The flutter doctor command is your best friend - it shows you exactly what’s still missing or needs to be configured.

Having problems with the installation? Feel free to send me a message!


Further Articles: