Creating a Flask Web Server in EC2 on the AWS Free Tier from scratch!

  Рет қаралды 34,568

Vincent Stevenson

Vincent Stevenson

2 жыл бұрын

I show how to deploy a Python Flask app on an EC2 instance in the AWS free tier. I walk through each step that is needed to configure security group rules and prepare the Ubuntu OS with gunicorn and nginx to successful host your website.
To see the commands I ran in this video, go to this link: / step-by-step-visual-gu...

Пікірлер: 107
@klnmn3722
@klnmn3722 Жыл бұрын
Only halfway through and this has already been one of the most helpful programming tutorials I've ever watched. Wow, good job skipping over all the useless crap, like telling me how to sign up for an AWS account for 5 minutes, while expanding on the stuff that's actually important to know, like what a worker is (never knew that). Thank you!
@mithson
@mithson Жыл бұрын
Clear and crisp to the point man great video🙌🏻 explained very well thanks
@mateussantos1041
@mateussantos1041 Жыл бұрын
This is one of the best tutorials I've seen in my entire life. Absolutely clear and straightforward. It worked perfectly, I love this video, I love this guy. Thank you very much
@adolfoguevara6506
@adolfoguevara6506 Жыл бұрын
This is by far one of the most helpful tutorials on AWS that I saw.... thanks!!!
@reginaldcobb4356
@reginaldcobb4356 Жыл бұрын
What a great consise tutorial for setting up Flask on AWS! I started a few tutorials, but this one was perfect and to the point. Thank you so much!!
@ettionestuckey5463
@ettionestuckey5463 4 ай бұрын
By far the best end to end tutorial on this topic! 🎉
@user-fd9hq1cx1f
@user-fd9hq1cx1f 5 ай бұрын
many sleepness nights and hours and hours of trying to get this to work and your tut was the ONE that did it. Thank you sir. You are God send.
@randallhale5529
@randallhale5529 Жыл бұрын
dude you are by far my favorite person ever for learning this shit from. You have such a great personality and you're so easy to understand. Thank you shawty
@rishu4225
@rishu4225 10 ай бұрын
Thanks for your hard work. Tutorial was really easy to follow-along and informative.
@bezdras
@bezdras Жыл бұрын
Bro you saved me. Had some trouble because my ec2 was centos, but a bit of extra googling and all is fine now! Thanks!
@xondemingo
@xondemingo Жыл бұрын
Thanks Vincent, it was really usefull! It's a joy to follow such a good-explained tutorial
@lachlancroll2386
@lachlancroll2386 Жыл бұрын
This is an absolute life saver. THANK YOU, YOU ARE A LEGEND!
@mattbeglinger
@mattbeglinger Жыл бұрын
This is super helpful, thanks for putting this together!!
@linuxlearnerlab
@linuxlearnerlab 7 ай бұрын
Thanks a lot. The tutorial was simple. I made it in 20 minutes. Learned something new in it . Very usefull
@user-dw5qw3hy1o
@user-dw5qw3hy1o 8 ай бұрын
The best tutorial so far It works with Linux well too
@eminedogan3125
@eminedogan3125 Жыл бұрын
Thank you Vincent, awesome video.
@markb255
@markb255 Жыл бұрын
Great video!! Very clear and concise. Thx
@samfoong3558
@samfoong3558 Жыл бұрын
Thank you Vincent! You saved my life.
@evegarcianz
@evegarcianz Жыл бұрын
mate, your video is brilliant!
@milosmarkovic4566
@milosmarkovic4566 10 ай бұрын
Can't thank you enough for this! Awesome!
@erikfeigin6317
@erikfeigin6317 Жыл бұрын
It was super helpful! Thank you a lot!
@zzjam
@zzjam Жыл бұрын
so crisp and helpful!!!
@Mantra-ro9cx
@Mantra-ro9cx 4 ай бұрын
Awesome, this video cleared lots of my doubts.
@pulkitpareek
@pulkitpareek 4 ай бұрын
The only tutorial that worked!
@gagikkhalafyan8731
@gagikkhalafyan8731 Жыл бұрын
Thanks a lot mate! Really nice video.
@user-hx8ew4gq7v
@user-hx8ew4gq7v 3 ай бұрын
Can never thank you enough, man!
@yuantian8408
@yuantian8408 2 жыл бұрын
Thanks! This video is helpful.
@wenxuanzhang3545
@wenxuanzhang3545 10 ай бұрын
Thank you, this works perfectly!
@user-dg8ln2uh4v
@user-dg8ln2uh4v 7 ай бұрын
Bro, thx so much, you help a lot!!!! Basically you save my life
@ax_ai
@ax_ai Жыл бұрын
This was beautiful!
@abdulazizdeveloper7915
@abdulazizdeveloper7915 Ай бұрын
thank u very much , it was very helpful and clear explanation
@anuragdhyani1712
@anuragdhyani1712 Жыл бұрын
Thanks for everything!
@haroldherrera1
@haroldherrera1 Жыл бұрын
Great tutorial, thank you
@jameswharton5259
@jameswharton5259 2 ай бұрын
Job well done 🔥🔥
@szalajable
@szalajable 10 ай бұрын
Big thanks from Gdańsk
@akachukwumba6155
@akachukwumba6155 Жыл бұрын
Hey man, thank you soo much !!
@hoteny
@hoteny 9 ай бұрын
I really like this video, its fast.
@jeandtx
@jeandtx 9 ай бұрын
Saved my day !
@LeFantasticPlanet
@LeFantasticPlanet 6 ай бұрын
Amazing, To the point, my webApp is live, Thank you!
@abbasjafary3443
@abbasjafary3443 Жыл бұрын
Thank you very much sir
@agb2557
@agb2557 Жыл бұрын
Amazing. Thank you
@gilbertoyarritu1326
@gilbertoyarritu1326 Жыл бұрын
Great tutorial, really helpful!!
@TheTORTA31
@TheTORTA31 Жыл бұрын
Hello! Did you do something different? It doesn't work for me. I get "This site can't be reached"
@gilbertoyarritu1326
@gilbertoyarritu1326 Жыл бұрын
@@TheTORTA31 There could be many things affecting wether it works or not. For starters are you trying it in a network that may block some connections. I first tried it in my college network and it didn't work. Also make you sure yo have all the right permissions
@ignoringyou376
@ignoringyou376 Жыл бұрын
LIFE CHANGING
@xuechuanmi5345
@xuechuanmi5345 Жыл бұрын
Hey there, Hope you are having a wonderful life! Your video and blog are super helpful! I have one question: why is port 8000 working from outside? I didn't see you set it open in the aws console. Without nginx, will the server be accessible to public browsers? I understand the reverse-proxy but, how is 8000 open to the outside? sorrt for the naive question, been a noob in this area XD thanks!
@noble6169
@noble6169 9 күн бұрын
awesome video
@ribo2139
@ribo2139 Жыл бұрын
This really helped me - thanks - I'll make a donation when I can. Subscribed and liked.
@TheTORTA31
@TheTORTA31 Жыл бұрын
Hello! Did you do something different? It doesn't work for me. I get "This site can't be reached"
@QualtarVideo
@QualtarVideo Жыл бұрын
I've been trying this for hours before I fell across your video. Thank you Vincent.
@ravikumawat-iitm
@ravikumawat-iitm 9 ай бұрын
This tutorial is useful.
@Shehab-Codes
@Shehab-Codes 11 ай бұрын
Thank you so much
@harshvardhan_grandhi
@harshvardhan_grandhi 6 ай бұрын
wow! thanks a lot
@ifalu
@ifalu 3 ай бұрын
Thanks!
@guidocaru
@guidocaru Жыл бұрын
thanks!!
@Sam-tg4ii
@Sam-tg4ii 11 ай бұрын
This was great thank you. One question: how can we have an actual link starting with www instead of those numbers?
@sheharyaar6338
@sheharyaar6338 Жыл бұрын
you really did well. But i have a question that is when you bind nginx with this app only, what if i have multiple scripts and want to run those within the same server?
@blueeyeswhitejesus
@blueeyeswhitejesus 11 ай бұрын
You're a freaking wizard bro let's be friends 😂😂😂 I got ideas dawg 😂
@njbshah
@njbshah Жыл бұрын
kindly make a tutorial on doing exactly same but on Windows EC2 instance
@HenkLeerssen
@HenkLeerssen Жыл бұрын
Concise.. only one thing. The "systemctl" command is not available with your tutorial (I use Frankfurt AWS node).. you can work your way around things with "service" command... but that does not restart things automatically after a reboot...
@DrexSux
@DrexSux 10 ай бұрын
I love the video, thank you so much! I am having trouble with the src/link tags on HTML though; it seems any ref or href won't link (might be due to relative pathing) so I'm unable to display any JS or CSS or static images. Does anyone have any insight on why this might be/the correct syntax? Thank you in advance!
@aguilarstephenjoaquing.1831
@aguilarstephenjoaquing.1831 4 ай бұрын
thank you for helping me, but i've just changed my source code, then i restarted gunicorn and nginx, why still i get the previous one when i curl it in localhost:8000 gunicorn, but if i curl in localhost:5000 when im running it on dev server, i get the changed one.
@ibrahimkezer9451
@ibrahimkezer9451 Жыл бұрын
Great video. How can i deploy dynamic flask web app?,
@aminmohebbi9838
@aminmohebbi9838 Жыл бұрын
I have an ML model with its CSV file. I used the Pickle method and created a flask application. How can I upload new files and update them?
@papimarcis8730
@papimarcis8730 Жыл бұрын
Hi, i just want to ask if is possible to deploy 2 or more flasks apps in the same ec2 instance with this method, and if that's the case, how?
@ajadavis2000
@ajadavis2000 11 ай бұрын
any idea how to check logs from flask server or view print statements? trying to actively debug
@rain-er6537
@rain-er6537 9 ай бұрын
How does the service work, if it needs flask. I see that you provide path for gunicorn launch command from the created venv, but how does service know to use the actual venv?
@FinnBrownc
@FinnBrownc Жыл бұрын
Where are logs written to when running flask like this?
@gunot5656
@gunot5656 2 ай бұрын
Technically don't need nginx, can just start flask/gunicorn on port 80? (For demo)
@blueeyeswhitejesus
@blueeyeswhitejesus 11 ай бұрын
For a simple chat bot for helping people with niche info, would a raspberry pi server suffice?
@rafikemad9114
@rafikemad9114 Жыл бұрын
anyone can help me on how to get the link of the app after it is up on AWS? like a link to send to someone to use the app
@parthverma5071
@parthverma5071 Жыл бұрын
Hi Vincent, Can you please help me with how to deploy the api which takes a parameter as input and has a URI and returns back an object. What are the changes that I have to make? Please help me asap as I am stuck on a project. Regards, Parth Verma
@rishabhchandaliya3028
@rishabhchandaliya3028 Жыл бұрын
how to push new code to flask app in order to reflect it on our web app as I tried updating the code of hello world using git push and also tried restarting nginx server still its showing old app on server
@pradeeppoojary8792
@pradeeppoojary8792 Жыл бұрын
for that you need to restart you gunicorn service use this command to restart your gunicorn service: sudo systemctl restart gunicorn
@muhammadanasrashid2634
@muhammadanasrashid2634 2 ай бұрын
so I cannot setup more than one server in it ?
@tapendrasinghdhayal1759
@tapendrasinghdhayal1759 Жыл бұрын
hello sir thank you so much provide the best content, your content help to use get good knowledge. I created a python flask app and I want to deploy AWS ec2 ubuntu, I undersend all things as you told in this video, and I successfully deployed. please provide content with MySQL database connection [ flask and MySQL ]
@TheTORTA31
@TheTORTA31 Жыл бұрын
Hello! Did you do something different? It doesn't work for me. I get "This site can't be reached"
@beongky
@beongky 8 ай бұрын
Thanks for the useful tutorial. Just one question here... After restarting the instance, it doesn't work anymore, should we have to start manually any of these services?
@VincentStevenson
@VincentStevenson 8 ай бұрын
Yes - depending on how you’ve configured the OS, the services need to be restated. Linux does have ways of making services run automatically when the system boots.
@AchyutJagini
@AchyutJagini Жыл бұрын
how to deploy server public DNS
@user-lu3xj4mp2n
@user-lu3xj4mp2n 2 ай бұрын
Hey buddy much thanks for this very helpful tutorial I really appreciate it . Please keep it up and keep sharing useful info like this . I like, subsucribe and comment you 😁🤪🤭
@JoshuaHaley-tw8wc
@JoshuaHaley-tw8wc Жыл бұрын
im getting this error: curl: (7) Failed to connect to localhost port 8000 after 0 ms: Connection refused Any recommendations would be much appreciated!
@syedhaideralizaidi4149
@syedhaideralizaidi4149 Жыл бұрын
Saame
@aashishadhikari8144
@aashishadhikari8144 Жыл бұрын
@@syedhaideralizaidi4149 I had the same error and realized later that I forgot to put the colon symbol after the localhost in the curl command.
@jacobhill5097
@jacobhill5097 4 ай бұрын
I was getting the same error. I had created my virtual environment as .venv instead of venv so I had to change a single line in the helloworld.service file to ExecStart=/home/ubuntu/helloworld/.venv/bin/gunicorn -b localhost:8000 app:app Note the .venv Hope that was your problem too
@aashnashroff3094
@aashnashroff3094 10 ай бұрын
I did this and when i try to curl the localhost, it does not give me any response? Can someone help me ?
@fahadfayyaz552
@fahadfayyaz552 9 ай бұрын
same things happened with me
@victortrevino4169
@victortrevino4169 8 ай бұрын
same@@fahadfayyaz552
@jacobhill5097
@jacobhill5097 4 ай бұрын
where did you put your virtual environment and what did you name it?
@varunraja9646
@varunraja9646 3 ай бұрын
hey mate i need your help with my application . happy to pay you
@davidtrokten
@davidtrokten 10 ай бұрын
curl: (7) Failed to connect to localhost port 8000 after 0 ms: Couldn't connect to server
@victortrevino4169
@victortrevino4169 8 ай бұрын
same
@LuciaLleraszarza
@LuciaLleraszarza Жыл бұрын
Great, now how you join it with front react?.
@Mobbin6500
@Mobbin6500 Жыл бұрын
easy
@Alpheamus
@Alpheamus Жыл бұрын
My father and I are having trouble connecting to our EC2 instance via SSH, and also are attempting to connect to it to send files via SCP. Seems like passing our keys in with the SSH command doesn't work, despite running the same command the Amazon supplies us with (the SSH command). We're also trying to set up Remote SSH to our EC2 instance using VSCode's extension for Remote SSH by Microsoft. Any tips you can give us? Much appreciated!
@VincentStevenson
@VincentStevenson Жыл бұрын
I would double check the security group to make sure ssh traffic is allowed from anywhere on port 22 for the instance.
@Alpheamus
@Alpheamus Жыл бұрын
@@VincentStevenson We had an unfortunate problem where, once we had gotten fed up with the pem/ppk key files not working, we opened it to be access via password and user, and we believe someone used a web spider, discovered us, and hacked our instance because it slowed down tremendously and continuously crashed when we attempted to do anything. We started a new one following your tutorial once again and managed to get our pem/ppk key files to work properly. To anyone in the future, definitely don't open the servers for use with user/pass, and download VSCode Remote SSH extension and connect it to the instance. It makes working on it so much simpler. Thanks for your tutorial, Vincent. Looking forward to more.
@AchyutJagini
@AchyutJagini Жыл бұрын
@@Alpheamus how to deploy server public DNS
@suneelkumar5175
@suneelkumar5175 11 ай бұрын
Hi Stevenson thanks for the great tutorial, I am facing problem while creating the service file as I check the status of the service I am getting the following error Loaded: loaded (/etc/systemd/system/app.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sun 2023-07-30 17:36:18 UTC; 7s ago Main PID: 1781 (code=exited, status=203/EXEC) Jul 30 17:36:18 ip-172-31-86-5 systemd[1]: app.service: Scheduled restart job, restart counter is at 5. Jul 30 17:36:18 ip-172-31-86-5 systemd[1]: Stopped Implementing python using gunicorn. Jul 30 17:36:18 ip-172-31-86-5 systemd[1]: app.service: Start request repeated too quickly. Jul 30 17:36:18 ip-172-31-86-5 systemd[1]: app.service: Failed with result 'exit-code'. Jul 30 17:36:18 ip-172-31-86-5 systemd[1]: Failed to start Implementing python using gunicorn. can anyone help me how to resolve this issue. Thankyou
@user-tj8fs4mv2j
@user-tj8fs4mv2j Жыл бұрын
This was great except when I got to the NGINX part in the last few minutes, I keep getting " [ Directory '/etc/nginx/sites-available' does not exist ]" I ran this a few times but keep getting the same thing. Did I miss a step?
@TragicGFuel
@TragicGFuel 9 күн бұрын
Did u sudo
@teddyperera8531
@teddyperera8531 Жыл бұрын
The video is very helpful. Thank you!
@bakasura999
@bakasura999 Жыл бұрын
Thanks!
How to Deploy a Flask App to a Linux Server with a Domain Name
21:29
Pretty Printed
Рет қаралды 21 М.
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 62 МЛН
LOVE LETTER - POPPY PLAYTIME CHAPTER 3 | GH'S ANIMATION
00:15
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 36 МЛН
Containerizing Python web apps with Docker, Flask, Nginx & uWSGI
25:38
How to Deploy Flask with Gunicorn and Nginx (on Ubuntu)
13:50
Tony Teaches Tech
Рет қаралды 63 М.
Top 50+ AWS Services Explained in 10 Minutes
11:46
Fireship
Рет қаралды 1,5 МЛН
Hosting a Docker Container on AWS EC2 Free Tier in under 12 minutes
11:35
Vincent Stevenson
Рет қаралды 40 М.
Creating an RDS PostgreSQL Database on the AWS Free Tier
11:20
Vincent Stevenson
Рет қаралды 56 М.
How to SSH into Amazon EC2 Machine | SSH AWS EC2
10:27
Piyush Garg
Рет қаралды 12 М.
😱Хакер взломал зашифрованный ноутбук.
0:54
Последний Оплот Безопасности
Рет қаралды 675 М.
Clicks чехол-клавиатура для iPhone ⌨️
0:59
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 334 М.
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 22 МЛН
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 5 МЛН
Easy Art with AR Drawing App - Step by step for Beginners
0:27
Melli Art School
Рет қаралды 13 МЛН