Flask app is a popular framework for developing minimal apps or often creating restful APIs. In this article I’m going to discuss about how to deploy a flask app using WSGI and Apache server over Ubuntu 20.04. This article will be helpful to those people who are deploying flask app for the first time and I have also discussed that how to find some of the errors which may occur during deployment and how to tackle them. Recently, I deployed a flask app on AWS and there I were faced some difficulties. So, main purpose of this article is to share all those difficulties which a beginner may face too. In this article I’m skipping the section about how to create a Ubuntu server on online web service like Amazon Web Service etc. but I’ll suggest first to google it by following the keywords “How to create a Ubuntu server on AWS” or “How to launch and AWS EC2 server and set up ubuntu on it”. Once when you’ll have a Ubuntu server follow this article to deploy your app. Here are some further intuitions which are needed to deploy a Flask app
- Create an AWS EC2 instance and setup Ubuntu server on it.
- Push your Flask app code on GitHub. Because, we are going to upload our flask app code on AWS Ubuntu server using GitHub repository.
Logging In to Virtual Machine
Once you’ll create your virtual machine (VM) on AWS or any other web service then you’ll be able to access it using ssh. Let first login to AWS by running ssh on terminal by running following command:
$ ssh -i yourSecretKey.pem ubuntu@ec2-XX-XXX-XXX-XX.yourServerLocation.compute.amazonaws.com
Once you’ll logged in successfully, then you may be able to see the following screen

Comments
Post a Comment