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

Поделиться
HTML-код
  • Опубликовано: 29 дек 2024

Комментарии • 104

  • @QualtarVideo
    @QualtarVideo Год назад +21

    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 Год назад +3

    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.

  • @hirokisaito-b6n
    @hirokisaito-b6n Год назад +4

    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!

  • @shaun8626
    @shaun8626 22 дня назад

    Awesome. Completely new to Linux/Flask/Nginx world. This is the first video came when searched and boom..!|
    Everything is working like a charm. Even after 2 years from publishing the video, still relevant in Dec 2024.
    Thanks for the awesome work.!

  • @writart3723
    @writart3723 2 месяца назад +1

    This video of yours has become a scripture or a handbook for me. I use Contabo and every time I have to host a flask website this video of yours helps me out. Heartfelt gratitude sir.

    • @TonyTeachesTech
      @TonyTeachesTech  2 месяца назад

      I'm happy to hear you're getting so much value from it :)

  • @sadpikachu409
    @sadpikachu409 3 месяца назад

    bro literally saved me with a 1 year old video. I had been stuck on the permission error for 3 hours trying everything to figure out what was the issue. Thank you for your video, you saved me with a one liner. I love you.

  • @pawjast
    @pawjast 3 месяца назад

    I like how those Flask tutorials are short but still comprehensive enough - good job!

  • @ahmedosman1020
    @ahmedosman1020 Год назад +1

    This is by far the best video out there to show how to deploy a Flask app!
    Tony you are the GOAT man
    Respect

  • @patricklehner5568
    @patricklehner5568 2 месяца назад

    Thank you so much for this video. After many hours and many not working tutorials (at least for me) this one DID work :-)

  • @MauricioAB-bf3hj
    @MauricioAB-bf3hj 29 дней назад

    Very good tutorial. Thanks Tony!

  • @verainsardana
    @verainsardana Год назад +3

    8:45 can someone explain why are we binding gunicorn to socket instead of address?

    • @verainsardana
      @verainsardana 11 месяцев назад

      I found the reason, it is because socket is much faster and more secure. Hope this helps

    • @sneaksneak6522
      @sneaksneak6522 11 месяцев назад

      Thank you for updating us. Would you be able to clarify, is the socket made implicitly when creating the service file? @@verainsardana

    • @verainsardana
      @verainsardana 11 месяцев назад

      @@sneaksneak6522 the socket is created when the service is in running state

  • @teclote
    @teclote Год назад

    Outstanding video, got mine working fine. Straight and to the point, only the essentials. Thanks very much.

  • @msatashi_daily
    @msatashi_daily Год назад +2

    hai, Tony thanks for your videos. but I want to ask how to change the website after deployment? I've struggling with it.

  • @sarim_hk
    @sarim_hk 5 месяцев назад

    this video was incredibly helpful! explained well, thanks a lot!! hosted my first web server with this

  • @mfungomunema2949
    @mfungomunema2949 Год назад +1

    This has been so helpful to me. I am deeply grateful.
    God bless you abundantly indeed.

  • @gruntq
    @gruntq 7 месяцев назад

    Thank you very much! Very informative yet concise and clean explanation! Hope you make next video about how to containerize this app using docker😇

  • @izaansohail7731
    @izaansohail7731 Год назад

    This is super duper amazing. Couldn't have been better. Thanks alot

  • @ukemeedet8675
    @ukemeedet8675 6 месяцев назад

    This was actually very helpful, thanks :)

  • @simbarashemaunga5575
    @simbarashemaunga5575 Год назад +1

    Bro, that was extremely well explained

  • @WaldoTheWombat
    @WaldoTheWombat 11 месяцев назад +1

    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.'

  • @andreypodlipsky9979
    @andreypodlipsky9979 Год назад +1

    Health to you! Many thanks for your video!!!

  • @TamLeAuthentic
    @TamLeAuthentic 3 месяца назад

    Would have taken me several hours at minimum without your help Tony!

  • @Oellie
    @Oellie 2 месяца назад

    Hello @Tony, great tutorial. I 've a quick question: How do I deploy app changes without restarting the server?
    Kind regards, Maik

  • @elliotsilveira30
    @elliotsilveira30 Год назад +1

    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???

  • @olaoka-ih9ej
    @olaoka-ih9ej Год назад +1

    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

  • @naymyomhan
    @naymyomhan Год назад

    Thanks Tony this tutorial help me a lot

  • @BisquiOne
    @BisquiOne 6 месяцев назад

    tony voce e um anjo kkkkkkkkkkkkkk thankyou for help me apreciate man

  • @xleage
    @xleage 5 месяцев назад

    your fan really djs in the background

  • @user-zp5gn8tl9r
    @user-zp5gn8tl9r Год назад +1

    the github page does not contain the service code

  • @freepluralism6652
    @freepluralism6652 11 месяцев назад

    Is it needed or asviable to remove root permission granted to the created User once the Website is published?

  • @wertuxhd6201
    @wertuxhd6201 Год назад +2

    After permissions given, I still get 502 Gateway error.

    • @TonyTeachesTech
      @TonyTeachesTech  Год назад +1

      Try this ruclips.net/video/hYVriHb43wU/видео.html

    • @cartulinito
      @cartulinito Год назад +1

      @@TonyTeachesTech That is for PHP

    • @cartulinito
      @cartulinito Год назад

      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

  • @westonwille3302
    @westonwille3302 Год назад

    🙌 This was so helpful!

  • @JOHNSMITH-sj3lg
    @JOHNSMITH-sj3lg Год назад +2

    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 9 месяцев назад

      The same problem! Did you solve it?

    • @JOHNSMITH-sj3lg
      @JOHNSMITH-sj3lg 9 месяцев назад

      @@bosmach nah bro

  • @vman049
    @vman049 Год назад +1

    Thanks for making the tutorial. Could you please share the link to part 1?

  • @AntonioRonde
    @AntonioRonde Год назад

    Really helpful, thanks Tony

  • @polymathx_
    @polymathx_ Год назад +2

    where is the sock file?? Did he create?

  • @fernandocoot9359
    @fernandocoot9359 9 месяцев назад

    the peak.sock file has to be in the directory app?

  • @RabeloHigor
    @RabeloHigor Год назад

    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!

  • @criva1968
    @criva1968 Год назад

    Thank you, very well explained!

  • @JenuelDevTutors
    @JenuelDevTutors Год назад

    thanks mate,, I am subscribing now.

  • @programmer9809
    @programmer9809 11 месяцев назад +1

    Michiel Huisman is now into IT?

  • @taneliharkonen2463
    @taneliharkonen2463 Год назад

    What do I do in the /etc/nginx/nginx.conf? How do I make nginx read those sites-available config files?

  • @WillYouVid
    @WillYouVid Год назад +1

    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 Год назад +2

      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.

  • @brpawankumariyengar4227
    @brpawankumariyengar4227 7 месяцев назад

    Thank you very much for the video ❤❤❤

  • @pramodgeorgehq
    @pramodgeorgehq Год назад

    How do you do your video backgrounds? I can't figure it out! 😅

  • @NikKimp-f3d
    @NikKimp-f3d 5 месяцев назад

    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

  • @fullstackoverflow-ct3bz
    @fullstackoverflow-ct3bz Год назад

    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?

  • @hjertaker
    @hjertaker Год назад

    Really helpful, thank you!

  • @gokulyc
    @gokulyc Год назад

    Cool, how to configure static files?

  • @slurpeesauce1750
    @slurpeesauce1750 Год назад

    THANK Y(OU
    HOURS AND HOURS I NEEDED THIS

  • @mudikhan6203
    @mudikhan6203 Год назад

    You are a pro bro. Thanks

  • @caiquebaptista7165
    @caiquebaptista7165 10 месяцев назад

    How to do it on Amazon Linux 2 ?

  • @teclote
    @teclote Год назад

    Fabulous presentation, thank you.

  • @techatival
    @techatival Год назад

    Nice, thank you!

  • @mimahmed95
    @mimahmed95 Месяц назад

    Awesome.

  • @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 Год назад +2

      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. >:(

  • @marcelltoth9737
    @marcelltoth9737 7 месяцев назад

    Thanks!

  • @zhulipa
    @zhulipa 6 месяцев назад

    Thank you

  • @abdulraufal-hassan5033
    @abdulraufal-hassan5033 Год назад

    Bravo!!

  • @pyyu8748
    @pyyu8748 Год назад

    i use the same 4k LG screen

  • @leocosta1009
    @leocosta1009 Год назад

    ja fiz o flask bro obg

  • @kylec.5476
    @kylec.5476 8 месяцев назад

    Better than chatGPT!

  • @mktfasshwetasoftware3343
    @mktfasshwetasoftware3343 Год назад

    really excellent

  • @GiantsOnTheHorizon
    @GiantsOnTheHorizon Год назад +2

    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 Год назад +3

      @@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 Год назад +2

      @@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 Год назад +1

      @@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.

  • @impyrobot
    @impyrobot Год назад +7

    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 6 месяцев назад

    Мозг плавится

  • @jomary00
    @jomary00 6 месяцев назад

    What could be the problem with this error "197043#0: *5 open() "/usr/share/nginx/html/webhook" failed (2: No such file or directory),"

  • @tanact0590
    @tanact0590 8 месяцев назад +2

    People, help me pls
    What is peak.sock?

  • @nafisishtiaque
    @nafisishtiaque Год назад

    will this always run on background