Flutter – Install on Linux

To get started with Flutter on Linux, we should get Flutter SDK, Android SDK, setup and configure Android Studio for Flutter, setup the Android Device or Emulator. Also, to run Flutter, the computer should meet the minimum hardware and software requirements.

Hardware and Software Requirements

To install Flutter on your system running on Linux, following are the minimum hardware and software requirements

Operating SystemLinux (64 bit)
Disk Space600MB + Space for IDE and dependent Software Tools
Software Toolsbash, mkdir, rm, git, curl, unzip, which

Download Flutter SDK

  1. Open Flutter SDK Archive. [https://flutter.io/sdk-archive/#linux].
  2. Download the latest Flutter SDK. As on the date of writing this article, v0.3.2 is the latest in Beta channel. Click on the link provided for latest SDK tar file. (SDK has not yet matured to stable version)
  3. Extract the Flutter SDK. Navigate to the location of TAR file and run the following command.tar xf flutter_linux_v0.3.2-beta.tar.xz
  4. Add flutter/bin to PATH.To append complete path of flutter/bin to PATH variable, open .bash_profile  file in edit mode and add the following line at the end of the file. [PATH_TO_FLUTTER_SDK_DIRECTORY] =
    1. Get the complete path to flutter sdk directory. This value changes based on where you extracted the SDK. Right click and open a terminal from the window where you extracted flutter. You can get the whole path by running pwd command in that terminal. [PATH_TO_FLUTTER_SDK_DIRECTORY] = /media/arjun/0AB650F1B650DF2F/softs/flutter
    2. For UBUNTU, add the complete path of [PATH_TO_FLUTTER_SDK_DIRECTORY]/flutter/bin to PATH in.bashrc  file. Run the following command to open .bashrc file in edit mode. [You may also use vi or any other editor].~sudo nano ~/.bashrc Add the following line at the end of the file and save.export PATH="[PATH_TO_FLUTTER_SDK_DIRECTORY]/flutter/bin:$PATH" For Example :export PATH="/media/arjun/0AB650F1B650DF2F/softs/flutter/flutter/bin:$PATH"
    3. Restart the terminal and run following command.~echo $PATH Path to the flutter SDK bin folder should be echoed, along with the previous PATH value.
  5. Flutter SDK Setup is complete.

Android Studio Setup

Download Latest Android Studio[https://developer.android.com/studio/index.html] (3.0 or later) and follow the Wizard for installation. This will install the latest Android SDK, Android SDK Platform-Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android.

Install Flutter and Dart plugins

To install Flutter and Dart plugins in Android Studio.

  1. Open Android Studio and open an existing project or create a new one.
  2. Under Menu -> File -> Settings -> Plugins, search for flutter and click on “Search in repositories.”Flutter - Install on Ubuntu - Android Studio Click on Install button. Flutter Plugin Android StudioClick on Yes, to insert both Dart and Flutter plugins.Install Flutter, Dart Plugin in Android Studio
  3. Restart the Android Studio. In Menu, under File -> New, New Flutter Project should appear.

Run Flutter Doctor Command

To check if the installation is successful, run flutter doctor command as shown below :

Flutter SDK installation is good.

It is not able to find Android SDK. We have Android SDK already installed, so we shall go with the option of setting $ANDROID_HOME. Add the following line at the end of .bashrc file.

If you have IntelliJ IDEA installed, and would like to work with Flutter in IntelliJ IDEA, you should install the Dart and Flutter plugins in IntelliJ IDEA as well. The procedure for installing the plugins would be same as that of in Android Studio.

Enable Debugging Mode in Android Device and connect to the system.

If you face any other issues when you run flutter doctor command, the solution would be provided in the description itself. Get your hands dirty with setting up the environment and lets get started with creating and running a basic application with Flutter on Android Studio.

Once all the issues are resolved, flutter doctor command would output as shown below :

Conclusion

In this Flutter TutorialInstall Flutter on Linux, we have learnt to install Flutter SDK, configure Android Studio with Flutter and Dart.