No video

How to Deploy Flask with Gunicorn and Nginx (on Ubuntu)

  Рет қаралды 69,844

Tony Teaches Tech

Tony Teaches Tech

Күн бұрын

Learn how to deploy your Flask app with the Gunicorn web server gateway interface (wsgi) behind an Nginx proxy on Ubuntu.
Next video: free SSL cert for HTTPS • How to Get Fully Autom...
Python code available over on Github 👉 github.com/ton...
Need an Ubuntu server? Get a free VPS with Vultr • A Very Simple VPS Serv...
Find more at tonyteaches.tech
Check out my vlog channel ‪@TonyFlorida‬
#python #nginx #flask #gunicorn

Пікірлер: 93
@QualtarVideo
@QualtarVideo Жыл бұрын
Tony, I've been trying to get something like this working for about 2 week though it feels like a century. I must have seen 30 'How to' videos. Your video is the only one that actually works. I'm so happy I found your tutorials.
@henujanrohanadasan2643
@henujanrohanadasan2643 11 ай бұрын
I missed that introduction so much in many of the previous tutorials i watched. Simple ,clear and very useful in order to understand the whole thing.
@ahmedosman1020
@ahmedosman1020 9 ай бұрын
This is by far the best video out there to show how to deploy a Flask app! Tony you are the GOAT man Respect
@user-cc2yd2cc3c
@user-cc2yd2cc3c 11 ай бұрын
Thank you! There are no tutorial videos like yours in Japan. I was in trouble. However, I was able to solve some problems by watching your video. thank you!
@sarim_hk
@sarim_hk 23 күн бұрын
this video was incredibly helpful! explained well, thanks a lot!! hosted my first web server with this
@gruntq
@gruntq 2 ай бұрын
Thank you very much! Very informative yet concise and clean explanation! Hope you make next video about how to containerize this app using docker😇
@teclote
@teclote 7 ай бұрын
Outstanding video, got mine working fine. Straight and to the point, only the essentials. Thanks very much.
@ukemeedet8675
@ukemeedet8675 2 ай бұрын
This was actually very helpful, thanks :)
@mfungomunema2949
@mfungomunema2949 10 ай бұрын
This has been so helpful to me. I am deeply grateful. God bless you abundantly indeed.
@izaansohail7731
@izaansohail7731 11 ай бұрын
This is super duper amazing. Couldn't have been better. Thanks alot
@simbarashemaunga5575
@simbarashemaunga5575 Жыл бұрын
Bro, that was extremely well explained
@TonyTeachesTech
@TonyTeachesTech Жыл бұрын
Glad you think so!
@xleage
@xleage Ай бұрын
your fan really djs in the background
@eddygrugger
@eddygrugger Ай бұрын
tony voce e um anjo kkkkkkkkkkkkkk thankyou for help me apreciate man
@msatashi_daily
@msatashi_daily 9 ай бұрын
hai, Tony thanks for your videos. but I want to ask how to change the website after deployment? I've struggling with it.
@andreypodlipsky9979
@andreypodlipsky9979 Жыл бұрын
Health to you! Many thanks for your video!!!
@westonwille3302
@westonwille3302 Жыл бұрын
🙌 This was so helpful!
@TonyTeachesTech
@TonyTeachesTech Жыл бұрын
So glad!
@ilovesciencemyanmar
@ilovesciencemyanmar 9 ай бұрын
Thanks Tony this tutorial help me a lot
@AntonioRonde
@AntonioRonde Жыл бұрын
Really helpful, thanks Tony
@TonyTeachesTech
@TonyTeachesTech Жыл бұрын
Glad it was helpful!
@criva1968
@criva1968 Жыл бұрын
Thank you, very well explained!
@brpawankumariyengar4227
@brpawankumariyengar4227 2 ай бұрын
Thank you very much for the video ❤❤❤
@hjertaker
@hjertaker Жыл бұрын
Really helpful, thank you!
@WaldoTheWombat
@WaldoTheWombat 7 ай бұрын
does anyone know how to deploy a flask app that uses web sockets? because I just finished deploying my app watching a deployment tutorial by Tech with Tim, but it seems that the sockets don't work there: 'Cannot obtain socket from WSGI environment.'
@DevTutorPro
@DevTutorPro 8 ай бұрын
thanks mate,, I am subscribing now.
@elliotsilveira30
@elliotsilveira30 11 ай бұрын
If I am setting this up all on a local device how can I get flask to host my public ip and not my local ip???
@RabeloHigor
@RabeloHigor 8 ай бұрын
How can I update the app after deployment? I have modified the Python code, but I am unsure of the steps required to make the updated version go live. Thank you for this video. It is really amazing, bro!
@vman049
@vman049 Жыл бұрын
Thanks for making the tutorial. Could you please share the link to part 1?
@mudikhan6203
@mudikhan6203 Жыл бұрын
You are a pro bro. Thanks
@techatival
@techatival Жыл бұрын
Nice, thank you!
@slurpeesauce1750
@slurpeesauce1750 Жыл бұрын
THANK Y(OU HOURS AND HOURS I NEEDED THIS
@WillYouVid
@WillYouVid Жыл бұрын
This is nice and teaching me a lot, thx! Your content is awesome, complete and straight to the point. But at the last minute I had an OCD attack triggered by the chmod 775, the sysadmin in me would have chown the sock file to the www-data user. Would it really have been safer to do so or is it just a stupid quirk of mine?
@donaldduck1073
@donaldduck1073 Жыл бұрын
if a tutorial contains only positive responses, like this one then you can assume that the author deletes critical hints. Like this one that has 2 errors in it. My comment got deleted.
@olaoka-ih9ej
@olaoka-ih9ej Жыл бұрын
I am using a centOS system and it gives me a permissions error when I want to run the peak service I checked if my user has the necessary permissions and the group it belongs to and it keeps giving me the same permission denied error
@zhulipa
@zhulipa 2 ай бұрын
Thank you
@user-zp5gn8tl9r
@user-zp5gn8tl9r 9 ай бұрын
the github page does not contain the service code
@marcelltoth9737
@marcelltoth9737 2 ай бұрын
Thanks!
@verainsardana
@verainsardana 8 ай бұрын
8:45 can someone explain why are we binding gunicorn to socket instead of address?
@verainsardana
@verainsardana 7 ай бұрын
I found the reason, it is because socket is much faster and more secure. Hope this helps
@sneaksneak6522
@sneaksneak6522 7 ай бұрын
Thank you for updating us. Would you be able to clarify, is the socket made implicitly when creating the service file? @@verainsardana
@verainsardana
@verainsardana 7 ай бұрын
@@sneaksneak6522 the socket is created when the service is in running state
@teclote
@teclote 11 ай бұрын
Fabulous presentation, thank you.
@thepramodgeorge
@thepramodgeorge Жыл бұрын
How do you do your video backgrounds? I can't figure it out! 😅
@freepluralism6652
@freepluralism6652 7 ай бұрын
Is it needed or asviable to remove root permission granted to the created User once the Website is published?
@fernandocoot9359
@fernandocoot9359 4 ай бұрын
the peak.sock file has to be in the directory app?
@abdulraufal-hassan5033
@abdulraufal-hassan5033 Жыл бұрын
Bravo!!
@TonyTeachesTech
@TonyTeachesTech Жыл бұрын
:)
@programmer9809
@programmer9809 6 ай бұрын
Michiel Huisman is now into IT?
@programmer9809
@programmer9809 5 ай бұрын
3:53
@NikKimp-f3d
@NikKimp-f3d Ай бұрын
what if i have ssl on my server, am i need write a bit different nginx conf file? mb someone have any guide regarding this
@wertuxhd6201
@wertuxhd6201 11 ай бұрын
After permissions given, I still get 502 Gateway error.
@TonyTeachesTech
@TonyTeachesTech 11 ай бұрын
Try this kzbin.info/www/bejne/noq5o5x-l5lmrbc
@cartulinito
@cartulinito 11 ай бұрын
@@TonyTeachesTech That is for PHP
@cartulinito
@cartulinito 11 ай бұрын
Add these 2 lines under "location" , right below "proxy_pass..." in your /etc/nginx/sites-available/file .conf: proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; That did it for me. Don't forget to stop nginx before, and after you edit the file, remove the symbolic link under /etc/nginx/sites-enabled/ and create it again from /etc/nginx/sites-available/yourfile.conf
@JOHNSMITH-sj3lg
@JOHNSMITH-sj3lg Жыл бұрын
i follow ur tutorial now 2 times but every time after i setup nginx as proxy i only get the welcome site from nginx but not my flask app do u have a idea why this is?
@bosmach
@bosmach 5 ай бұрын
The same problem! Did you solve it?
@JOHNSMITH-sj3lg
@JOHNSMITH-sj3lg 5 ай бұрын
@@bosmach nah bro
@polymathx_
@polymathx_ 11 ай бұрын
where is the sock file?? Did he create?
@gokulyc
@gokulyc Жыл бұрын
Cool, how to configure static files?
@taneliharkonen2463
@taneliharkonen2463 10 ай бұрын
What do I do in the /etc/nginx/nginx.conf? How do I make nginx read those sites-available config files?
@fullstackoverflow-ct3bz
@fullstackoverflow-ct3bz 11 ай бұрын
I have set guncorn with certificate and key to make it https. but after running gunicron the API cannot be accessed. is there any reference for gunicorn https?
@leocosta1009
@leocosta1009 8 ай бұрын
ja fiz o flask bro obg
@kylec.5476
@kylec.5476 4 ай бұрын
Better than chatGPT!
@caiquebaptista7165
@caiquebaptista7165 6 ай бұрын
How to do it on Amazon Linux 2 ?
@pyyu8748
@pyyu8748 9 ай бұрын
i use the same 4k LG screen
@mktfasshwetasoftware3343
@mktfasshwetasoftware3343 7 ай бұрын
really excellent
@TonyTeachesTech
@TonyTeachesTech 7 ай бұрын
Thank you!
@GiantsOnTheHorizon
@GiantsOnTheHorizon Жыл бұрын
I wish someone would have told me when I was learning Flask to learn Django instead.
@shizhouliu8912
@shizhouliu8912 Жыл бұрын
Why do you think Django is better then Flask based on your experience?
@GiantsOnTheHorizon
@GiantsOnTheHorizon Жыл бұрын
@@shizhouliu8912 You always hear that Flask is "easier to get started with." This may be true if you're doing a one page website. However, Django isn't all that much harder and it has built-in security, a built-in admin interface, etc. In Flask I kept having to tack new things on that were already incorporated into Django. This quickly begins to get messy and time consuming.
@shizhouliu9212
@shizhouliu9212 Жыл бұрын
@@GiantsOnTheHorizon Good to know. Thanks
@WillYouVid
@WillYouVid Жыл бұрын
@@GiantsOnTheHorizon it´s a matter of phylosophy, Django is heavier, Flask is more modular, it´s like saying oh wow, I wish I knew about Debian instead of using Arch, Debian has it all and with Arch I have to add all of the kernel modules one by one. None is better than the other IMHO, what´s important is to know that both exist and what each can give you. Django is modular too depending on what you mean by it. I hope what I said makes sense to you.
@GiantsOnTheHorizon
@GiantsOnTheHorizon Жыл бұрын
@@WillYouVid Sure. I guess my main point was that it takes longer to have to figure out which modules to add on vs having the batteries included. Especially if you’re just starting out.
@fahadshaikh9715
@fahadshaikh9715 Жыл бұрын
How to solve error g unicorn not working on port 5000 its showing me error that port 5000 already in use
@miguellaversa
@miguellaversa Жыл бұрын
Check if you already have gunicorn running > ps aux | grep gunicorn Then kill the old process > kill
@WillYouVid
@WillYouVid Жыл бұрын
@@miguellaversa argh I wanted to answer this and then I saw you already did, and correctly, this is honestly infuriating, how dare you. JK thanks for helping out people that want to learn things on the internet
@WillYouVid
@WillYouVid Жыл бұрын
@@miguellaversa no but really you spoiled my joy
@WillYouVid
@WillYouVid Жыл бұрын
@@miguellaversa like, one thing I know, I wanted to say it, and you just go and answer it. >:(
@impyrobot
@impyrobot 10 ай бұрын
2023 and you dont have timestamps in the description or provide the config you copy pasted in the description because its not on the github link
@Dragonoid_369_4
@Dragonoid_369_4 Ай бұрын
Мозг плавится
@jomary00
@jomary00 2 ай бұрын
What could be the problem with this error "197043#0: *5 open() "/usr/share/nginx/html/webhook" failed (2: No such file or directory),"
@nafisishtiaque
@nafisishtiaque Жыл бұрын
will this always run on background
@TonyTeachesTech
@TonyTeachesTech Жыл бұрын
Yep
@tanact0590
@tanact0590 4 ай бұрын
People, help me pls What is peak.sock?
How to Get Fully Automated Let's Encrypt SSL Renewal (no coding)
7:56
Tony Teaches Tech
Рет қаралды 55 М.
How to Deploy Django on Nginx with uWSGI (full tutorial)
37:57
Tony Teaches Tech
Рет қаралды 89 М.
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 2 МЛН
Challenge matching picture with Alfredo Larin family! 😁
00:21
BigSchool
Рет қаралды 42 МЛН
Lehanga 🤣 #comedy #funny
00:31
Micky Makeover
Рет қаралды 30 МЛН
الذرة أنقذت حياتي🌽😱
00:27
Cool Tool SHORTS Arabic
Рет қаралды 19 МЛН
How to Deploy a Flask App to a Linux Server with a Domain Name
21:29
Pretty Printed
Рет қаралды 23 М.
Deploy Flask Application on Ubuntu VPS using Nginx
16:19
DevGuyAhnaf
Рет қаралды 46 М.
NGINX Tutorial - What is Nginx
14:32
TechWorld with Nana
Рет қаралды 113 М.
Creating a Flask Web Server in EC2 on the AWS Free Tier from scratch!
17:28
WSGI for Web Developers (Ryan Wilson-Perkin)
24:52
PyCon Canada
Рет қаралды 93 М.
host ALL your AI locally
24:20
NetworkChuck
Рет қаралды 1 МЛН
Apache vs NGINX
7:53
IBM Technology
Рет қаралды 284 М.
Coding a Web Server in 25 Lines - Computerphile
17:49
Computerphile
Рет қаралды 333 М.
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 2 МЛН