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

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

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

  • @deanelie7775
    @deanelie7775 4 месяца назад +5

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

  • @iSkayer
    @iSkayer 27 дней назад

    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!

  • @arfazchhapawala2892
    @arfazchhapawala2892 Месяц назад +2

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

  • @alexkey9372
    @alexkey9372 4 месяца назад +1

    You are back!! great news!

  • @Shasa.t
    @Shasa.t 4 месяца назад

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

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

    Wow, best video I've ever watched on RUclips! Congratulations!!!

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

    Thank you for the incredibly helpful content!

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

    Very helpful content. Tnx so much! 🙏

  • @simonboddy7415
    @simonboddy7415 12 дней назад

    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.

  • @AyushKumar-ow1od
    @AyushKumar-ow1od 4 месяца назад +1

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

    • @thedigitalceo
      @thedigitalceo  4 месяца назад

      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.

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

    this content is legendary !

  • @samsHandle
    @samsHandle 4 месяца назад +1

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

    • @thedigitalceo
      @thedigitalceo  4 месяца назад +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.

  • @ywywywyw612
    @ywywywyw612 4 месяца назад

    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  3 месяца назад +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!

  • @MrAlao675
    @MrAlao675 4 месяца назад

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

    • @thedigitalceo
      @thedigitalceo  4 месяца назад +1

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

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

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

  • @bphil4859
    @bphil4859 4 месяца назад +1

    mongodb in host bro !

    • @thedigitalceo
      @thedigitalceo  4 месяца назад

      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.

  • @sakshambista0
    @sakshambista0 4 месяца назад

    LIFE SAVER ❤

  • @Benni1000games
    @Benni1000games 4 месяца назад

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

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

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

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