How to install Falsk on CentOS 8

How To Install Flask On CentOS 8

In this article we will show you how to install Flask on CentOS 8 operating system.


Flask is a popular Python web framework that provides a simple and easy-to-use interface for building web applications. It is designed to be lightweight and modular, making it easy to add new features and functionality as needed.

Here are some of the key features and characteristics of Flask:

  • Micro framework: Flask is a “micro” framework, which means that it provides only the basic functionality needed to build web applications. This makes it lightweight and easy to use, but also means that it may not be suitable for very complex or large-scale applications.
  • Routing: Flask provides a simple routing system that maps URLs to specific Python functions, making it easy to create dynamic web pages.
    Templating: Flask includes a built-in templating engine that allows developers to create dynamic HTML pages with placeholders for dynamic content.
  • Flask extensions: Flask has a wide range of third-party extensions that can be used to add additional functionality to the framework, such as support for database integration, user authentication, and more.
  • RESTful support: Flask includes built-in support for creating RESTful APIs, making it easy to build web services that can be used by other applications.
  • Jinja2 template engine: Flask uses the Jinja2 template engine, which is a powerful and flexible templating language that allows developers to create dynamic HTML pages with ease.

Flask Installation On CentOS 8


Before we proceed to the Flask installation process, there are several prerequisites that must be met, namely :

  • A server running one of the following operating systems: CentOS 8.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A root user access or normal user with administrative privileges.

The Flask installation will be consiste of several steps, as mentioned below :

  1. Update CentOS 8 System
  2. Creating Virtual Environment
  3. Installing Flask
  4. Verifying Flask


1. Update CentOS 8 System

The first is to update our CentOS 8 system, this task is to make sure if we are accessing the latest packages versions. This task will cut down the installation time.  To update our packages software we will use command line :

$ sudo dnf update -y

2. Creating Virtual Environment

In this step, we will create Python3 virtual environment where Flask will be lived in. For this purpose we will submit the following command line :

# python3 --version
# mkdir projekgue
# cd projekgue/
# python3 -m venv venv
# . venv/bin/activate

The output will be as shown below :

[root@otodiginet ~]# python3 --version
Python 3.6.8
[root@otodiginet ~]# mkdir projekgue
[root@otodiginet ~]# cd projekgue/
[root@otodiginet projekgue]# python3 -m venv venv
[root@otodiginet projekgue]# . venv/bin/activate

3. Installing Flask

Within the activated environment, we will use the following command to install Flask :

(venv) [root@otodiginet projekgue]# pip install Flask

Output :

(venv) [root@otodiginet projekgue]# pip install Flask
Collecting Flask
Downloading (94kB)
100% |████████████████████████████████| 102kB 1.2MB/s 
Collecting Jinja2>=2.10.1 (from Flask)
Downloading (125kB)
100% |████████████████████████████████| 133kB 1.4MB/s 
Collecting Werkzeug>=0.15 (from Flask)
Downloading (298kB)
100% |████████████████████████████████| 307kB 625kB/s 
Collecting itsdangerous>=0.24 (from Flask)
Collecting click>=5.1 (from Flask)
Downloading (82kB)
100% |████████████████████████████████| 92kB 1.1MB/s 
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10.1->Flask)
Installing collected packages: MarkupSafe, Jinja2, Werkzeug, itsdangerous, click, Flask
Successfully installed Flask-1.1.2 Jinja2-2.11.3 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 itsdangerous-1.1.0
You are using pip version 9.0.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

3.1. Upgrading pip

At this point, we have successfully installed Flask, according to the recommendations above, we will upgrade pip to version 21 using the command line.

(venv) [root@otodiginet projekgue]# pip install --upgrade pip

Output :

(venv) [root@otodiginet projekgue]# pip install --upgrade pip
Collecting pip
Downloading (1.5MB)
100% |████████████████████████████████| 1.5MB 320kB/s 
Installing collected packages: pip
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
Successfully installed pip-21.0.1

4. Verifty Flask Installation

At this step, we will verify the installation with the following command which will print the Flask version:

(venv) [root@otodiginet projekgue]# python -m flask --version

Output :

(venv) [root@otodiginet projekgue]# python -m flask --version
Python 3.6.8
Flask 1.1.2
Werkzeug 1.0.1

Install Flask on CentOS 8


In this tutorial we have learned how to install Flask on CentOS 8. I hope this tutorial will be helpful.

(Visited 312 times, 1 visits today)


No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *