Self host Next.js website on an Ubuntu server with Auto Deploy on commits!

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 32

  • @deanelie7775
    @deanelie7775 7 หลายเดือนก่อน +5

    Your tutorials are absolute gold! Thank you so much! 😊

    • @thedigitalceo
      @thedigitalceo  7 หลายเดือนก่อน

      Wowza, thank you!

  • @iSkayer
    @iSkayer 3 หลายเดือนก่อน

    This was a really great tutorial, thank you for walking us through the steps. I already knew most of them, but needed a refresh, especially on the pm2 part. Keep up the great work!

  • @Shasa.t
    @Shasa.t 6 หลายเดือนก่อน

    The TH-cam algorithm brought this to me right when I needed it! getting myself a droplet and learning

  • @arfazchhapawala2892
    @arfazchhapawala2892 4 หลายเดือนก่อน +2

    Thanks for sharing an amazing tutorial 🙏. I was really searching for the perfect one, and it is well explained 🙌

  • @josemarceloalexandre3656
    @josemarceloalexandre3656 4 หลายเดือนก่อน

    Wow, best video I've ever watched on TH-cam! Congratulations!!!

  • @shaqranbhat1168
    @shaqranbhat1168 2 วันที่ผ่านมา

    Absolute gold man❤

  • @alexkey9372
    @alexkey9372 7 หลายเดือนก่อน +1

    You are back!! great news!

  • @marchello6826
    @marchello6826 4 หลายเดือนก่อน

    Thank you for the incredibly helpful content!

  • @achrefmtir8250
    @achrefmtir8250 5 หลายเดือนก่อน

    this content is legendary !

  • @pongtswaila7922
    @pongtswaila7922 3 หลายเดือนก่อน

    Very helpful content. Tnx so much! 🙏

  • @samsHandle
    @samsHandle 7 หลายเดือนก่อน +1

    Awesome tutorial! Any idea on how DigitalOcean pricing compares to AWS?

    • @thedigitalceo
      @thedigitalceo  7 หลายเดือนก่อน +2

      I think Digital Ocean is going to be the best value and very easy. The interface is so clean and easy. Aws interface is very confusing and the pricing is complex. The servers may be similar in cost but with AWS there’s added cost to bandwidth which makes it even more elusive. If you’re scaling something massive AWS would be good if you will use other services . For most apps Digital Ocean is really nice.

  • @maxschneidercodes3
    @maxschneidercodes3 หลายเดือนก่อน

    Thank you so much!

  • @simonboddy7415
    @simonboddy7415 2 หลายเดือนก่อน

    Really good! I'm still getting over the fact that nextjs has to be built in situ. A build can always fail, so it seems very risky to overwrite your live site with some new code that needs to be built. Folk are likely handling this with containers but I think I'm going to try a blue/green strategy and switch the nginx config when the build has succeeded. I'm also a bit startled to see the PATH modified in the deployment pipeline. Why should I need to modify my pipeline every time my node version changes? I think I need a better solution there. God I wish we still had server guys.

  • @MrAlao675
    @MrAlao675 7 หลายเดือนก่อน

    This is absolutely amazing... Been looking/waiting for this.
    What about full stack with something like prisma?
    Thank you!

    • @thedigitalceo
      @thedigitalceo  7 หลายเดือนก่อน +1

      Thanks! Yeah that's another wonderful aspect, you can put a database on the server too.

  • @ywywywyw612
    @ywywywyw612 6 หลายเดือนก่อน

    There is a slight problem with this and it is that you cannot run build while running PM2 because building causes the files that are being served by PM2 to be modified, you have to copy them to another directory before hand, I think you can use `next build [directory to which you copied the files]` to fix this, otherwise awesome video!
    edit: use next JS standalone mode, not `next build [directory]`!

    • @thedigitalceo
      @thedigitalceo  5 หลายเดือนก่อน +1

      A good point. I haven’t run into a lot of issues in most cases but what you suggested is definitely best practice. Thank you!

  • @sakshambista0
    @sakshambista0 6 หลายเดือนก่อน

    LIFE SAVER ❤

  • @AyushKumar-ow1od
    @AyushKumar-ow1od 6 หลายเดือนก่อน +1

    sir i am facing this issue
    ubuntu@13.200.235.21: Permission denied (publickey).
    Error: Process completed with exit code 255.

    • @thedigitalceo
      @thedigitalceo  6 หลายเดือนก่อน

      It means when you created the server you didn’t place your ssh key on the server. If creating from digital ocean you need to add the ssh key during the process of creating the server. If it’s not added when creating you won’t be able to login. You can delete the server and start over.

  • @alleggs
    @alleggs 5 หลายเดือนก่อน

    something wrong with this. i tries to run two apps on same domain with subomains, but only one app runs on domain

  • @amremam4188
    @amremam4188 หลายเดือนก่อน

    Then what is the point of npm run build

  • @bphil4859
    @bphil4859 7 หลายเดือนก่อน +1

    mongodb in host bro !

    • @thedigitalceo
      @thedigitalceo  7 หลายเดือนก่อน

      Right! I'm all about mysql, but that's another cool thing about your own server, you can place the database on the same server! mongodb, or any other.

  • @Benni1000games
    @Benni1000games 6 หลายเดือนก่อน

    nvm, pm2 and npm should not be running as root, this is dangerous and asking for trouble. If anybody wants to follow this guide I really highly recommend that you create a separate user account for this and also for cloning and updating the code. Root is the Linux equivalent of an admin user and anything that does not require admin privileges should never run as root. If there is ever an RCE in your code or nextJS and you are running this setup the attacker has full admin access to your server. Create a sandboxed user account with limited privileges, a separate SSH key and read/write only allowed to their own files for every project, project A should not be able to read files from project B.

    • @thedigitalceo
      @thedigitalceo  5 หลายเดือนก่อน +1

      That is a good point. I believe I mentioned this the tutorial. Just kept root for the demo. Thank you for clarifying

  • @bimwerx
    @bimwerx 5 หลายเดือนก่อน

    The title reads 'Self host' - using Digital Ocean is not self hosting. How about using Ubuntu-server on a local machine to deploy a live Next.js app?

    • @haiffy
      @haiffy 5 หลายเดือนก่อน

      Digital ocean droplets are just ubuntu server under the hood, literally same thing, you can use this tutorial on any ubuntu server anywhere

    • @PongLenis99
      @PongLenis99 3 หลายเดือนก่อน

      @@haiffy yah it worked for me on my self hosted ubuntu. great tut