Playback starts YouTube’s embedded player (privacy-enhanced mode).
How to Deploy a Flask App to a Linux Server
ChannelTech With TimDescription from the creator
This video will show you how to deploy your flask app to a headless linux server that is running ubuntu. We will be using apache and wsgi to do so.
Thanks to Linode for sponsoring this video! Deploy your linux server by clicking the link or using the promo code TWT19 for $20 free credit!
linode.com/techwithtim
Playlist: youtube.com/watch?v=mqhxxeeTbu0&list=PLzMcB…
Download Links:
putty.org/
winscp.net/eng/download.php
Credits:
digitalocean.com/community/tutorials/how-to-dep…
**Procedure (refer to video for missing details)**
Step 1: Setup a server on linode
Step 2: Download Putty and SSH in
Step 3: Download and Install Apache
- sudo apt update
- sudo apt install apache2
- apache2 -version
Step 4: Configure Firewall
- sudo ufw app list
- sudo ufw allow ‘Apache’
Step 5: Configure apache
- sudo systemctl status apache 2
Step 6: Install and enable mod_wsgi
- sudo apt-get install libapache2-mod-wsgi python-dev
Step 7: Creating flask app
- cd /var/www
- sudo mkdir webApp
- cd webApp
Step 8: Install flask
- sudo apt-get install python-pip
- sudo pip install Flask
- sudo pip install flask_sqlalchemy
Step 9: Use winSCP to transfer python files to server
Step 10: configure and enable virtual host
- sudo nano /etc/apache2/sites-available/webApp.conf
CLICK TO DOWNLOAD THE CODE TO PUT IN webApp.conf
dev-cms.us-east-1.linodeobjects.com/code_to_pla…
- sudo a2ensite webApp
- systemctl reload apache2
Step 11: Create .wsgi file
- sudo nano webapp.wsgi
Place the below code in the wsgi file
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/webApp/")
from webApp import app as application
application.secret_key = 'Add your secret key'
Step 12: Restart apache
- sudo service apache2 restart
Step 13: Visit the ip address of your server in the browser to access your website!
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
tech-with-tim.teachable.com/p...
📸 Instagram: instagram.com/tech_with_tim
🌎 Website techwithtim.net
📱 Twitter: twitter.com/TechWithTimm
⭐ Discord: discord.gg/pr2k55t
📝 LinkedIn: linkedin.com/in/tim-rusci...
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
💵 One-Time Donations: paypal.com/donate/?token=...
💰 Patreon: patreon.com/techwithtim
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
Tags:
- Tech With Tim
- How to deploy a flask app to linux
- Deploy flask app
- Flask App Deploy
- Deploy flask app to ubuntu server
#Python #Flask #Linux
Thanks to Linode for sponsoring this video! Deploy your linux server by clicking the link or using the promo code TWT19 for $20 free credit!
linode.com/techwithtim
Playlist: youtube.com/watch?v=mqhxxeeTbu0&list=PLzMcB…
Download Links:
putty.org/
winscp.net/eng/download.php
Credits:
digitalocean.com/community/tutorials/how-to-dep…
**Procedure (refer to video for missing details)**
Step 1: Setup a server on linode
Step 2: Download Putty and SSH in
Step 3: Download and Install Apache
- sudo apt update
- sudo apt install apache2
- apache2 -version
Step 4: Configure Firewall
- sudo ufw app list
- sudo ufw allow ‘Apache’
Step 5: Configure apache
- sudo systemctl status apache 2
Step 6: Install and enable mod_wsgi
- sudo apt-get install libapache2-mod-wsgi python-dev
Step 7: Creating flask app
- cd /var/www
- sudo mkdir webApp
- cd webApp
Step 8: Install flask
- sudo apt-get install python-pip
- sudo pip install Flask
- sudo pip install flask_sqlalchemy
Step 9: Use winSCP to transfer python files to server
Step 10: configure and enable virtual host
- sudo nano /etc/apache2/sites-available/webApp.conf
CLICK TO DOWNLOAD THE CODE TO PUT IN webApp.conf
dev-cms.us-east-1.linodeobjects.com/code_to_pla…
- sudo a2ensite webApp
- systemctl reload apache2
Step 11: Create .wsgi file
- sudo nano webapp.wsgi
Place the below code in the wsgi file
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/webApp/")
from webApp import app as application
application.secret_key = 'Add your secret key'
Step 12: Restart apache
- sudo service apache2 restart
Step 13: Visit the ip address of your server in the browser to access your website!
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
tech-with-tim.teachable.com/p...
📸 Instagram: instagram.com/tech_with_tim
🌎 Website techwithtim.net
📱 Twitter: twitter.com/TechWithTimm
⭐ Discord: discord.gg/pr2k55t
📝 LinkedIn: linkedin.com/in/tim-rusci...
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
💵 One-Time Donations: paypal.com/donate/?token=...
💰 Patreon: patreon.com/techwithtim
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
Tags:
- Tech With Tim
- How to deploy a flask app to linux
- Deploy flask app
- Flask App Deploy
- Deploy flask app to ubuntu server
#Python #Flask #Linux
About this tutorial
Tech With Tim published this 22:12 video tutorial on November 29, 2019. It has been watched 186,613 times on YouTube.
- Channel
- Tech With Tim
- Category
- Education
- Duration
- 22:12
- Published
- November 29, 2019
- Views
- 186,613
- Likes
- 3,060
Tags
Share
This tutorial in other languages
- FRComment déployer une application Flask à un serveur Linux
- ESCómo implementar una aplicación de frasco a un Servidor Linux
- PTComo implantar um frasco App para um servidor Linux
- ITCome distribuire un App pallone in una server Linux
- DEWie man eine Flasche App auf einem Linux-Server bereitstellen
- NLHoe maak je een Flask App implementeren van een Linux Server
- RUКак Развертывание КОЛБУ приложения на Linux Server
- PLJak wdrożyć kolby aplikacji na Linux Server
- JALinuxサーバへのフラスコのAppを展開する方法
- ARكيفية نشر قارورة التطبيقات لخادم لينكس
- HIकैसे एक लिनक्स सर्वर से एक फ्लास्क अनुप्रयोग को तैनात करने
- IDCara Menyebarkan App Flask ke Server Linux