Setting up Flutter Environment on a Linux system

A comprehensive guide to set up Flutter on a Linux system.

Pratik Singhal
Fnplus Club
3 min readSep 25, 2019

--

This article is the second part of the Flutter set up series. In this article, we’ll cover how to set-up flutter for a Linux System.

Flutter + Linux

Prerequisites:
1. Flutter SDK from flutter.dev
2. VS Code (the URL is for 64bit system). For others, please refer here.
3. Android Studio (version 3.5)

Install and set the path for Flutter in Linux:

  1. Go to the desired folder where you want to install Flutter in your system.
  2. If you wish to install Flutter in the home directory, then jump to step 4.
  3. After finishing Step-1, open the terminal in your folder (right-click at any empty space and click on Open in Terminal )
  4. In the terminal type the following command:
    tar xf ~/Downloads/flutter_linux_v1.9.1+hotfix.2-stable.tar.xz
    Here, Downloads is the directory, where Flutter was downloaded. You can change it according to your download location.
    Note: If you followed step-3, this command should be executed after opening the terminal in your desired folder where you want to extract flutter.
  5. Make sure, your flutter SDK was extracted by checking the extraction location. A new folder named flutter would have appeared after the extraction is finished. But do not close this terminal just yet.

Setting up the path for Flutter:

  • First, let us set the path for the current terminal so that we can verify the flutter installation.
Flutter SDK extracted in a folder named Flutter.
  • To set up a path for the current terminal, type the following command:
    export PATH="$PATH:`pwd`/flutter/bin"
    Note: This command should be executed from the folder where the flutter folder was extracted.
  • Now to verify the same, run flutter doctor in the same terminal.
  • Output screen should be like:
My flutter installation is under the folder Flutter.
  • Let us set up a permanent path for Flutter so that we can use it anytime and anywhere.
  • Press Ctrl+H on your keyboard to reveal the hidden files in the Files Application.
  • Search for a file named ‘.bashrc’ and open it using any file editor software.
  • Now, go to the end of the file and add the path to flutter/bin to this file and save the file. The permanent path is set for your system.
    (refer the image below for reference)
The path to ‘flutter/bin’ folder is added to the end of the .bashrc file
  • Let's verify the permanent path set-up. Fire up at the new terminal and again run flutter doctor command.
Output for flutter doctor after the path is set. If you receive output screen similar to this, the path for flutter is set. If terminal shows command not found an error that means there was some error setting up the path and you need to check the path again.
Yay! We have successfully set up the flutter path in Linux System.
  • If you want to set-up the VS Code and Android Studio for Flutter environment, please refer to this article. It has the setup for VS Code and Android Studio since they both are same for Windows and Linux OS.

So you are now ready to dive into the magical world of Flutter. Make awesome apps in a short amount of time and amaze your friends!

Hope this article was helpful. Share it with your friends who might find it useful. Also, do you know that you can clap 50 times for a single article?
Try it out.
Also, do follow since another article for MacOS setup is also coming soon.

Till then, Happy Fluttering!

--

--

Pratik Singhal
Fnplus Club

Fluttering all the way in to tech world | Flutter Enthusiast | Final Year Engineering Student at S.R.M. I.S.T. | Always Available |