{"id":3904,"date":"2023-09-20T13:14:37","date_gmt":"2023-09-20T10:14:37","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=3904"},"modified":"2023-09-20T13:14:48","modified_gmt":"2023-09-20T10:14:48","slug":"how-to-install-flask-on-ubuntu-and-centos","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/","title":{"rendered":"How to Install Flask on Ubuntu and CentOS"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" data-attachment-id=\"3909\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/attachment\/install-flask-on-ubuntu-and-centos\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Install-Flask-on-Ubuntu-and-CentOS\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?fit=300%2C169&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?fit=750%2C422&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?resize=750%2C422&#038;ssl=1\" alt=\"How to Install Flask on Ubuntu and CentOS\" class=\"wp-image-3909\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Flask-on-Ubuntu-and-CentOS.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Flask, a micro web framework written in <a href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-use-influxdb-with-python-on-ubuntu-22-04\/\">Python<\/a>, is an excellent tool for developers looking to create robust web applications. Its simplicity and flexibility make it a popular choice among developers worldwide. This article will guide you through the process of installing Flask on Ubuntu and CentOS.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Prerequisites\" title=\"Prerequisites\">Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Installing_Flask_on_Ubuntu\" title=\"Installing Flask on Ubuntu\">Installing Flask on Ubuntu<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Step_1_Update_Your_System\" title=\"Step 1: Update Your System\">Step 1: Update Your System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Step_2_Install_pip_for_Python_3\" title=\"Step 2: Install pip for Python 3\">Step 2: Install pip for Python 3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Step_3_Install_Flask\" title=\"Step 3: Install Flask\">Step 3: Install Flask<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Installing_Flask_on_CentOS\" title=\"Installing Flask on CentOS\">Installing Flask on CentOS<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Step_1_Update_Your_System-2\" title=\"Step 1: Update Your System\">Step 1: Update Your System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Step_2_Install_EPEL_Repository\" title=\"Step 2: Install EPEL Repository\">Step 2: Install EPEL Repository<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Step_3_Install_pip_for_Python_3\" title=\"Step 3: Install pip for Python 3\">Step 3: Install pip for Python 3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Step_4_Install_Flask\" title=\"Step 4: Install Flask\">Step 4: Install Flask<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Verifying_Flask_Installation\" title=\"Verifying Flask Installation\">Verifying Flask Installation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/#Final_Thoughts\" title=\"Final Thoughts\">Final Thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Make sure you have the following prerequisites before we start the installation process:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/virtono.com\/cloud-vps\" target=\"_blank\" rel=\"noopener\">A Virtono VPS<\/a> running either Ubuntu or CentOS.<\/li>\n\n\n\n<li>Basic knowledge of the Linux command line.<\/li>\n\n\n\n<li>Python 3 installed on your system. Flask is a Python framework, so Python is a must-have.<\/li>\n\n\n\n<li>Pip, the Python package installer.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Installing_Flask_on_Ubuntu\"><\/span>Installing Flask on Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Let&#8217;s start with Ubuntu. Here&#8217;s a step-by-step guide to installing Flask on an Ubuntu system:<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_1_Update_Your_System\"><\/span>Step 1: Update Your System<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>You must update your system packages first. Then, enter the following command into the terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt update &amp;&amp; apt upgrade -y<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_2_Install_pip_for_Python_3\"><\/span>Step 2: Install pip for Python 3<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Next, install pip for Python 3 using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt-get install python3-pip<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"251\" data-attachment-id=\"3905\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/attachment\/screenshot-2023-09-19-at-14-38-11\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?fit=2832%2C948&amp;ssl=1\" data-orig-size=\"2832,948\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-19-at-14.38.11\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?fit=300%2C100&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?fit=750%2C251&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?resize=750%2C251&#038;ssl=1\" alt=\"How to Install Flask on Ubuntu and CentOS\" class=\"wp-image-3905\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?resize=1024%2C343&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?resize=300%2C100&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?resize=768%2C257&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?resize=1536%2C514&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?resize=2048%2C686&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.38.11.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_3_Install_Flask\"><\/span>Step 3: Install Flask<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>You are now prepared to install Flask. To install Flask, use pip as shown below:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pip3 install Flask<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"398\" data-attachment-id=\"3906\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/attachment\/screenshot-2023-09-19-at-14-39-01\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?fit=2588%2C1376&amp;ssl=1\" data-orig-size=\"2588,1376\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-19-at-14.39.01\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?fit=300%2C160&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?fit=750%2C398&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?resize=750%2C398&#038;ssl=1\" alt=\"How to Install Flask on Ubuntu\" class=\"wp-image-3906\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?resize=1024%2C544&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?resize=300%2C160&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?resize=768%2C408&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?resize=1536%2C817&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?resize=2048%2C1089&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-14.39.01.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>That&#8217;s it, then! Your Ubuntu system now has Flask installed successfully. You could make a straightforward Hello World application to check the installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Installing_Flask_on_CentOS\"><\/span>Installing Flask on CentOS<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The process of installing Flask on CentOS is slightly different. Here&#8217;s how you can do it:<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_1_Update_Your_System-2\"><\/span>Step 1: Update Your System<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Just like with Ubuntu, the first step is to update your system packages. Open the terminal and type the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo yum update<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_2_Install_EPEL_Repository\"><\/span>Step 2: Install EPEL Repository<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>CentOS requires the EPEL repository for pip installation. Install it using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo yum install epel-release<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_3_Install_pip_for_Python_3\"><\/span>Step 3: Install pip for Python 3<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Now, install pip for Python 3:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo yum install python3-pip<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_4_Install_Flask\"><\/span>Step 4: Install Flask<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Finally, install Flask using pip:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pip3 install Flask<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"229\" data-attachment-id=\"3907\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/attachment\/screenshot-2023-09-19-at-15-55-56\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?fit=2872%2C878&amp;ssl=1\" data-orig-size=\"2872,878\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-19-at-15.55.56\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?fit=300%2C92&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?fit=750%2C229&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?resize=750%2C229&#038;ssl=1\" alt=\"How to Install Flask on CentOS\" class=\"wp-image-3907\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?resize=1024%2C313&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?resize=768%2C235&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?resize=1536%2C470&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?resize=2048%2C626&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.55.56.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Congratulations! Your CentOS system now has Flask installed. You can build a basic Hello World application to check the installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Verifying_Flask_Installation\"><\/span>Verifying Flask Installation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To verify the Flask installation on both Ubuntu and CentOS, you can create a simple Flask application. <\/p>\n\n\n\n<p>Here are the steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a new file named&nbsp;<code>app.py<\/code>&nbsp;using the following command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code><code>nano app.py<\/code><\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>In the&nbsp;<code>app.py<\/code>&nbsp;file, add the following lines of code:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>from flask import Flask\napp = Flask(__name__)\n\n@app.route('\/')\ndef hello_world():\n    return 'Hello, World!'\n\nif __name__ == '__main__':\n    app.run(host='0.0.0.0')<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Save the file and run it using the following command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code><code>python3 app.py<\/code><\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>Open a web browser and go to&nbsp;<code>http:\/\/server-IP:5000<\/code>. You should see &#8220;Hello, World!&#8221; displayed.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"289\" data-attachment-id=\"3908\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-flask-on-ubuntu-and-centos\/attachment\/screenshot-2023-09-19-at-15-10-14\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?fit=1944%2C748&amp;ssl=1\" data-orig-size=\"1944,748\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-19-at-15.10.14\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?fit=300%2C115&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?fit=750%2C289&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?resize=750%2C289&#038;ssl=1\" alt=\"Install Flask on Ubuntu and CentOS\" class=\"wp-image-3908\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?resize=1024%2C394&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?resize=300%2C115&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?resize=768%2C296&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?resize=1536%2C591&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-19-at-15.10.14.png?w=1944&amp;ssl=1 1944w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Final_Thoughts\"><\/span>Final Thoughts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Installing Flask on Ubuntu and CentOS is simple and results in a top-notch web development tool. With Flask, developers of all experience levels can begin creating powerful web applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flask, a micro web framework written in Python, is an excellent tool for developers looking to create robust web applications. Its simplicity and flexibility make it a popular choice among developers worldwide. This article will guide you through the process of installing Flask on Ubuntu and CentOS. Prerequisites Make sure<\/p>\n","protected":false},"author":8,"featured_media":3910,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[786,791,788,789,790,792,787],"class_list":["post-3904","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to","tag-flask-installation","tag-flask-linux","tag-flask-on-centos","tag-flask-on-ubuntu","tag-flask-pip","tag-flask-web-development","tag-python-web-framework"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-Install-Flask-on-Ubuntu-and-CentOS.png?fit=360%2C240&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-10Y","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":670,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/comparing-oss-centos-ubuntu-or-debian\/","url_meta":{"origin":3904,"position":0},"title":"Comparing OSs &#8212; CentOS, Ubuntu or Debian?","author":"Daniel Draga","date":"September 28, 2016","format":false,"excerpt":"CentOS \u009ewhich stands for Community Enterprise Operating System, is the result of a group of open source contributors and users working together to develop Linux solutions that are freely available to users who do not require a great deal of commercial support to achieve their goal. \u009eCentOS dedicated servers were\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/09\/centos-debian-ubuntu-06.png?fit=400%2C300&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3420,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-tensorflow-on-linux\/","url_meta":{"origin":3904,"position":1},"title":"How to Install TensorFlow On Linux","author":"George B.","date":"May 29, 2023","format":false,"excerpt":"Whether you're an aspiring data scientist or a seasoned professional, knowing how to install TensorFlow on Linux distribution is crucial. In this tutorial, we will guide you through the installation process on popular Linux distributions such as CentOS, Ubuntu, AlmaLinux, and Rocky Linux. TensorFlow is a versatile and powerful open-source\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3438,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-spark-on-ubuntu-22-04-and-centos\/","url_meta":{"origin":3904,"position":2},"title":"How to install Apache Spark on Ubuntu 22.04 and CentOS","author":"George B.","date":"June 1, 2023","format":false,"excerpt":"We will guide you through the process of installing Apache Spark on Ubuntu 22.04, 20.04, and CentOS, ensuring you have all the necessary tools to leverage this incredible technology. Apache Spark is a powerful open-source framework for distributed computing that has become a go-to solution for big data processing. With\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-install-Apache-Spark-on-Ubuntu-22.04-and-CentOS.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-install-Apache-Spark-on-Ubuntu-22.04-and-CentOS.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-install-Apache-Spark-on-Ubuntu-22.04-and-CentOS.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3448,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-gitlab-on-linux\/","url_meta":{"origin":3904,"position":3},"title":"How to Install GitLab on Linux","author":"George B.","date":"June 3, 2023","format":false,"excerpt":"We will walk you through the step-by-step process of installing GitLab on Linux. Whether you are an Ubuntu or CentOS user, this guide has got you covered! GitLab is a powerful web-based Git repository manager that provides a complete DevOps platform for managing code repositories, continuous integration\/continuous deployment (CI\/CD), issue\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-GitLab-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-GitLab-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-GitLab-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3468,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-haproxy-on-linux\/","url_meta":{"origin":3904,"position":4},"title":"How to install HAProxy on Linux","author":"George B.","date":"June 7, 2023","format":false,"excerpt":"This article will provide a comprehensive, step-by-step guide on how to install HAProxy on Linux, specifically Ubuntu and CentOS distributions. So, let's dive in and explore the installation process. In today's technology-driven world, ensuring high availability and efficient load balancing of web applications is crucial. HAProxy, a powerful and open-source\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-HAProxy-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-HAProxy-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-HAProxy-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":724,"url":"https:\/\/www.virtono.com\/community\/news-announcements\/how-to-protect-your-server-against-the-dirty-cow-linux-vulnerability\/","url_meta":{"origin":3904,"position":5},"title":"How To Protect Your Server Against the Dirty COW Linux Vulnerability","author":"Virtono","date":"October 25, 2016","format":false,"excerpt":"Introduction : On October 19, 2016, a privilege escalation vulnerability in the Linux kernel was disclosed. The bug is nicknamed Dirty COW because the underlying issue was a race condition in the way kernel handles copy-on-write (COW). Dirty COW has existed for a long time at least since 2007, with\u2026","rel":"","context":"In &quot;Announcements&quot;","block_context":{"text":"Announcements","link":"https:\/\/www.virtono.com\/community\/category\/news-announcements\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/IMG_2035.jpg?fit=1200%2C900&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/IMG_2035.jpg?fit=1200%2C900&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/IMG_2035.jpg?fit=1200%2C900&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/IMG_2035.jpg?fit=1200%2C900&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/IMG_2035.jpg?fit=1200%2C900&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=3904"}],"version-history":[{"count":2,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3904\/revisions"}],"predecessor-version":[{"id":3921,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3904\/revisions\/3921"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/3910"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=3904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=3904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=3904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}