{"id":43521,"date":"2023-01-11T12:30:46","date_gmt":"2023-01-11T18:30:46","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=43521"},"modified":"2023-01-05T03:55:27","modified_gmt":"2023-01-05T09:55:27","slug":"how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/","title":{"rendered":"How to Install Flask on Ubuntu 22.04 with Apache and WSGI"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"size-full wp-image-44555 alignnone\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04.webp\" alt=\"install flask on ubuntu 22.04\" width=\"742\" height=\"372\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04.webp 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04-300x150.webp 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04-150x75.webp 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/p>\n<p>In this tutorial, we are going to show you how to install the Flask application on Ubuntu 22.04 with <a href=\"https:\/\/www.rosehosting.com\/apache-hosting\/\">Apache Web server<\/a> and mod WSGI.<\/p>\n<p>Flask is a very popular web framework written in Python and used by many developers worldwide. The Apache is the Web server where requests are coming to the application, and the Mod WSGI is the Apache module that implements a WSGI-compliant interface for hosting Python-based web applications.<\/p>\n<p>Installing Flask with Apache and WSGI on Ubuntu 22.04 is a process that may take up to 30 minutes. Let&#8217;s get started!<\/p>\n<p><!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69ee6ae1b9c3f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><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><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69ee6ae1b9c3f\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#Step-1-Update-the-System\" >Step 1. Update the System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#Step-2-Install-Apache-Web-Server\" >Step 2. Install Apache Web Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#Step-3-Install-Python\" >Step 3. Install Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#Step-4-Install-Flask-Application\" >Step 4. Install Flask Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#Step-5-Create-WSGI-file\" >Step 5. Create WSGI file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#Step-6-Create-Apache-Virtual-Host-File\" >Step 6. Create Apache Virtual Host File<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>A server with Ubuntu 22.04 as OS<\/li>\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Step-1-Update-the-System\"><\/span>Step 1. Update the System<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before installing the software, we need to update the system packages to the latest versions available.<\/p>\n<pre>sudo apt-get update -y &amp;&amp; sudo apt-get upgrade -y<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-2-Install-Apache-Web-Server\"><\/span>Step 2. Install Apache Web Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To install the Apache Web server execute the following command:<\/p>\n<pre>sudo apt install apache2 -y<\/pre>\n<p>Once installed, start and enable the service.<\/p>\n<pre>sudo systemctl enable apache2 &amp;&amp; sudo systemctl start apache2<\/pre>\n<p>Check if the service is up and running:<\/p>\n<pre>sudo systemctl status apache2<\/pre>\n<p>You should receive the following output:<\/p>\n<pre>root@host:~# sudo systemctl status apache2\r\n\u25cf apache2.service - The Apache HTTP Server\r\n     Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\r\n     Active: active (running) since Mon 2022-11-07 13:30:41 CST; 1 week 0 days ago\r\n       Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\r\n   Main PID: 747 (apache2)\r\n      Tasks: 55 (limit: 4575)\r\n     Memory: 11.3M\r\n        CPU: 49.680s\r\n     CGroup: \/system.slice\/apache2.service\r\n             \u251c\u2500  747 \/usr\/sbin\/apache2 -k start\r\n             \u251c\u250070464 \/usr\/sbin\/apache2 -k start\r\n             \u2514\u250070465 \/usr\/sbin\/apache2 -k start\r\n\r\nNov 13 00:00:02 host.test.vps systemd[1]: Reloading The Apache HTTP Server...\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-3-Install-Python\"><\/span>Step 3. Install Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We need to install the latest version of python3 for Ubuntu 22.04 and the python package manager <b>pip<\/b> along with the python virtual environment. To achieve this execute the following commands:<\/p>\n<pre>sudo apt-get install python3 python3-pip python3-venv<\/pre>\n<p>To check the installed python version, execute the following command:<\/p>\n<pre>python3 -V<\/pre>\n<p>You should get the following output:<\/p>\n<pre>root@host:~# python3 -V\r\nPython 3.10.6\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-4-Install-Flask-Application\"><\/span>Step 4. Install Flask Application<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The next step is to install and deploy the flask application in the virtual environment.<\/p>\n<p>To create the virtual environment in the <b>opt<\/b> directory, execute the following command:<\/p>\n<pre>cd \/opt &amp;&amp; mkdir flask-app\r\n\r\ncd flask-app\r\n\r\npython3 -m venv flask-venv<\/pre>\n<p>Once the virtual flask environment is created, you need to activate it using the following command:<\/p>\n<pre>source flask-venv\/bin\/activate<\/pre>\n<p>The command prompt will change and will look as described below:<\/p>\n<pre>root@host:\/opt\/flask-app# source flask-venv\/bin\/activate\r\n(flask-venv) root@host:\/opt\/flask-app#<\/pre>\n<p>The next step is to install the flask application inside the virtual environment with the following command:<\/p>\n<pre>pip3 install flask<\/pre>\n<p>The successfully installed flask application will have the following output:<\/p>\n<pre>(flask-venv) root@host:\/opt\/flask-app# pip3 install flask\r\nCollecting flask\r\n  Downloading Flask-2.2.2-py3-none-any.whl (101 kB)\r\n     \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 101.5\/101.5 KB 2.4 MB\/s eta 0:00:00\r\nCollecting click&gt;=8.0\r\n  Downloading click-8.1.3-py3-none-any.whl (96 kB)\r\n     \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 96.6\/96.6 KB 4.3 MB\/s eta 0:00:00\r\nCollecting itsdangerous&gt;=2.0\r\n  Downloading itsdangerous-2.1.2-py3-none-any.whl (15 kB)\r\nCollecting Werkzeug&gt;=2.2.2\r\n  Downloading Werkzeug-2.2.2-py3-none-any.whl (232 kB)\r\n     \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 232.7\/232.7 KB 4.8 MB\/s eta 0:00:00\r\nCollecting Jinja2&gt;=3.0\r\n  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)\r\n     \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 133.1\/133.1 KB 4.0 MB\/s eta 0:00:00\r\nCollecting MarkupSafe&gt;=2.0\r\n  Downloading MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)\r\nInstalling collected packages: MarkupSafe, itsdangerous, click, Werkzeug, Jinja2, flask\r\nSuccessfully installed Jinja2-3.1.2 MarkupSafe-2.1.1 Werkzeug-2.2.2 click-8.1.3 flask-2.2.2 itsdangerous-2.1.2\r\n<\/pre>\n<p>Next is to create a sample flask application python file:<\/p>\n<pre>sudo nano app.py<\/pre>\n<p>Insert the following lines of code:<\/p>\n<pre>from flask import Flask\r\napp = Flask(__name__)\r\n\r\n@app.route('\/')\r\ndef index():\r\n    return 'Hello World'\r\n<\/pre>\n<p>Save the file, close it and set up the FLASK_APP environment variable.<\/p>\n<pre>export FLASK_APP=app.py<\/pre>\n<p>Now, we can test the application by running the following command:<\/p>\n<pre>flask run --host=0.0.0.0<\/pre>\n<p>You will receive the following output:<\/p>\n<pre>(flask-venv) root@host:\/opt\/flask-app# flask run --host=0.0.0.0\r\n * Debug mode: off\r\nWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.\r\n * Running on all addresses (0.0.0.0)\r\n * Running on http:\/\/127.0.0.1:5000\r\n * Running on http:\/\/<b>YourServerIP<\/b>:5000\r\nPress CTRL+C to quit\r\nHello World\r\n<b>YourServerIP<\/b> - - [15\/Nov\/2022 07:37:13] \"GET \/ HTTP\/1.1\" 200 -\r\n<\/pre>\n<p>As you can see in the output, this is a development server and is not recommended in a production deployment. We need to use the WSGI server instead. You can quit the running process with the <b>CTRL+C<\/b> command and deactivate the environment with the <b>deactivate<\/b> command for now. In the next step, we will configure the Apache Web server with mod WSGI.<\/p>\n<pre>(flask-venv) root@host:\/opt\/flask-app# <b>deactivate<\/b>\r\nroot@host:\/opt\/flask-app#\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-5-Create-WSGI-file\"><\/span>Step 5. Create WSGI file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before we create a <b>wsgi<\/b> file in the virtual flask environment, we first need to install some packages on the server level. To install the required libraries, execute the following command:<\/p>\n<pre>sudo apt-get install libapache2-mod-wsgi-py3<\/pre>\n<p>Once installed, create the file:<\/p>\n<pre>sudo nano \/opt\/flask-app\/flask-app.wsgi<\/pre>\n<p>Paste the following lines of code, save and close the file.<\/p>\n<pre>import sys\r\nsys.path.insert(0,'\/opt\/flask-app')\r\n\r\nfrom app import app as application<\/pre>\n<p>We are done with this part. Let&#8217;s go to the next step.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-6-Create-Apache-Virtual-Host-File\"><\/span>Step 6. Create Apache Virtual Host File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now, in the last step, we will create an Apache virtual host file and will configure it to work with the Mod WSGI parameters and <b>flask-app.wsgi<\/b> file.<\/p>\n<pre>touch \/etc\/apache2\/sites-available\/flask.conf<\/pre>\n<p>Open the file, and paste the following lines of code:<\/p>\n<pre>&lt;VirtualHost *:80&gt;\r\nServerName <b>yourdomain.com<\/b>\r\nDocumentRoot \/opt\/flask-app\/\r\n\r\nWSGIDaemonProcess app user=www-data group=www-data threads=5 python-home=\/opt\/flask-app\/flask-venv\r\nWSGIScriptAlias \/ \/opt\/flask-app\/flask-app.wsgi\r\n\r\nErrorLog ${APACHE_LOG_DIR}\/flask-error.log\r\nCustomLog ${APACHE_LOG_DIR}\/flask-access.log combined\r\n\r\n&lt;Directory \/opt\/flask-app&gt;\r\nWSGIProcessGroup app\r\nWSGIApplicationGroup %{GLOBAL}\r\nOrder deny,allow\r\nRequire all granted\r\n&lt;\/Directory&gt;\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>Enable the Apache2 configuration file:<\/p>\n<pre>sudo a2ensite flask.conf\r\n<\/pre>\n<p>Check the syntax of the Apache2 configuration.<\/p>\n<pre>apachectl -t<\/pre>\n<p>You should receive the following output:<\/p>\n<pre>root@host:~# apachectl -t\r\nSyntax OK\r\n<\/pre>\n<p>If you receive this output, you can restart the Apache service safely.<\/p>\n<pre>sudo systemctl restart apache2<\/pre>\n<p>Now, you can access the Flask Web interface via your domain at <b>http:\/\/YourDomain.com.<\/b><\/p>\n<p>That&#8217;s it. Congratulations, you successfully installed and configured Flask Application on Ubuntu 22.04 with Apache and WSGI. If you find this process difficult, you can always contact <a href=\"https:\/\/www.rosehosting.com\/support\/\">our technical support<\/a>, who will help you with any aspect of this configuration. Feel free to contact us anytime you want. We are available 24\/7.<\/p>\n<p>If you liked this post about installing Flask on Ubuntu 22.04 with Apache and WSGI, please share it with your friends on social networks or simply leave a reply below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we are going to show you how to install the Flask application on Ubuntu 22.04 with Apache &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Install Flask on Ubuntu 22.04 with Apache and WSGI\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#more-43521\" aria-label=\"Read more about How to Install Flask on Ubuntu 22.04 with Apache and WSGI\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":44555,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1712],"tags":[37,1985,59],"class_list":["post-43521","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-web-frameworks","tag-apache","tag-flask","tag-ubuntu","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Install Flask on Ubuntu 22.04 with Apache and WSGI | RoseHosting<\/title>\n<meta name=\"description\" content=\"In this tutorial, we will show you how to install the Flask application on Ubuntu 22.04 with Apache Web server and mod WSGI.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Flask on Ubuntu 22.04 with Apache and WSGI\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we are going to show you how to install the Flask application on Ubuntu 22.04 with Apache Web server and mod WSGI.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-11T18:30:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Install Flask on Ubuntu 22.04 with Apache and WSGI\" \/>\n<meta name=\"twitter:description\" content=\"In this tutorial, we are going to show you how to install the Flask application on Ubuntu 22.04 with Apache Web server and mod WSGI.\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Install Flask on Ubuntu 22.04 with Apache and WSGI\",\"datePublished\":\"2023-01-11T18:30:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/\"},\"wordCount\":651,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/install-flask-on-ubuntu-22-04.webp\",\"keywords\":[\"apache\",\"flask\",\"ubuntu\"],\"articleSection\":[\"Tutorials\",\"Web Frameworks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/\",\"name\":\"How to Install Flask on Ubuntu 22.04 with Apache and WSGI | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/install-flask-on-ubuntu-22-04.webp\",\"datePublished\":\"2023-01-11T18:30:46+00:00\",\"description\":\"In this tutorial, we will show you how to install the Flask application on Ubuntu 22.04 with Apache Web server and mod WSGI.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/install-flask-on-ubuntu-22-04.webp\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/install-flask-on-ubuntu-22-04.webp\",\"width\":742,\"height\":372,\"caption\":\"install flask on ubuntu 22.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Flask on Ubuntu 22.04 with Apache and WSGI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Install Flask on Ubuntu 22.04 with Apache and WSGI | RoseHosting","description":"In this tutorial, we will show you how to install the Flask application on Ubuntu 22.04 with Apache Web server and mod WSGI.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Flask on Ubuntu 22.04 with Apache and WSGI","og_description":"In this tutorial, we are going to show you how to install the Flask application on Ubuntu 22.04 with Apache Web server and mod WSGI.","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2023-01-11T18:30:46+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04.webp","type":"image\/webp"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_title":"How to Install Flask on Ubuntu 22.04 with Apache and WSGI","twitter_description":"In this tutorial, we are going to show you how to install the Flask application on Ubuntu 22.04 with Apache Web server and mod WSGI.","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Install Flask on Ubuntu 22.04 with Apache and WSGI","datePublished":"2023-01-11T18:30:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/"},"wordCount":651,"commentCount":5,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04.webp","keywords":["apache","flask","ubuntu"],"articleSection":["Tutorials","Web Frameworks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/","name":"How to Install Flask on Ubuntu 22.04 with Apache and WSGI | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04.webp","datePublished":"2023-01-11T18:30:46+00:00","description":"In this tutorial, we will show you how to install the Flask application on Ubuntu 22.04 with Apache Web server and mod WSGI.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04.webp","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/12\/install-flask-on-ubuntu-22-04.webp","width":742,"height":372,"caption":"install flask on ubuntu 22.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-flask-on-ubuntu-22-04-with-apache-and-wsgi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install Flask on Ubuntu 22.04 with Apache and WSGI"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/43521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=43521"}],"version-history":[{"count":6,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/43521\/revisions"}],"predecessor-version":[{"id":44559,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/43521\/revisions\/44559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/44555"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=43521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=43521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=43521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}