Flutter is one of the most popular frameworks for building cross-platform apps. With a single codebase, you can build apps for Android, iOS, Linux, macOS, Windows, and even the web. If you’re using Ubuntu, setting up Flutter is straightforward once you know the steps.
This guide walks you through installing Flutter on Ubuntu, configuring your environment, and getting ready to build your first app.
Step 1: Update Your System
Before installing anything, make sure your system is up to date. Open a terminal and run:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Dependencies
Flutter relies on a few system packages. Install them with:
sudo apt install git curl unzip xz-utils zip libglu1-mesa -y
These tools ensure Flutter and the Android SDK can run smoothly.
Step 3: Download the Flutter SDK
Navigate to your Downloads folder (or any location you prefer):
cd ~/Downloads
Download the latest stable Flutter SDK from Google’s servers. At the time of writing, the latest stable release is 3.24.3:
curl -O https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.3-stable.tar.xz
If you want the most up-to-date link, check the Flutter installation page.
Step 4: Extract the SDK
Unpack the Flutter archive:
tar xf flutter_linux_3.24.3-stable.tar.xz
Move it to /opt for system-wide use:
sudo mv flutter /opt/
Step 5: Add Flutter to Your PATH
To use the flutter command globally, add it to your PATH. Edit your shell configuration file:
nano ~/.bashrc
At the bottom, add:
export PATH="$PATH:/opt/flutter/bin"
Save and exit (CTRL + O, then CTRL + X), then reload the file:
source ~/.bashrc
Step 6: Verify Installation
Check that Flutter is available by running:
flutter doctor
This will scan your system for required tools and show any missing components.
Step 7: Set Up an Editor
Flutter works best with either Android Studio or Visual Studio Code.
- Android Studio: Provides a full IDE with Flutter and Dart plugins, plus an Android emulator.
- VS Code: Lightweight, with extensions for Flutter and Dart.
If you’re just starting, I recommend Android Studio since it comes with the Android SDK and device emulator.
Step 8: Install Android Tools
To run your apps on Android, install the Android SDK and platform tools. If you installed Android Studio, you can configure this from Preferences > Appearance & Behavior > System Settings > Android SDK.
Alternatively, you can install ADB directly:
sudo apt install adb
Step 9: Create and Run a New Flutter Project
Once everything is installed, you’re ready to build your first Flutter app.
flutter create my_app
cd my_app
flutter run
If you have an Android emulator or a real device connected, your app will launch.
Troubleshooting
- If
flutter doctorshows missing dependencies, follow the suggested fixes. - If Android Studio doesn’t detect Flutter, make sure the Flutter and Dart plugins are installed under Preferences > Plugins.
- For web development, enable web support with:
flutter config --enable-web
Final Thoughts
That’s it! You now have Flutter installed and running on Ubuntu. From here, you can start exploring widgets, layouts, and plugins to bring your ideas to life.
Whether you’re targeting Android, iOS, or even desktop platforms, Flutter gives you the tools to build fast, beautiful apps with a single codebase.