How to Deploy a Next.js app to a Custom Server - NOT Vercel! (Full Beginner Tutorial)

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

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

  • @biLLie_wiLLie
    @biLLie_wiLLie Год назад +68

    Finally someone cares about it

  • @nodirbeksharipov458
    @nodirbeksharipov458 Год назад +32

    As a senior software engineer, I know all of these, yet still watched and enjoyed every second of it, kudos to you 🥳

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

      Hi, Can I know where to store the env variables. I am stuck there. please hepl

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

      @@wazirshehryarali4375 hi! i located environmets in file .env.production and its works, but i don't know is it correct :)

    • @harsha.2186
      @harsha.2186 Месяц назад

      @@wazirshehryarali4375i think set it up in your project directory?

  • @divyanshutripathy3484
    @divyanshutripathy3484 4 месяца назад +2

    This is literal gold. I didn't find such comprehensive guide any where else.

  • @LoadOfJak
    @LoadOfJak 8 месяцев назад +3

    Most of my short career has been spent working on PHP and WordPress projects so I’ve had a lot of experience setting up server environments for those, but it’s really great seeing how this process can work for a Next.js project, which is pretty much synonymous with Vercel.
    Good to see I’m not completely stuck on vercel just because I wanted to use next.js.
    Great and instructive video.

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

      But what if we want to host both the next.js site and the php (mysql) site on the same server?

  • @semerset
    @semerset 11 месяцев назад +3

    This tutorial video is GOLD! Thanks a lot!

  • @videoponder4673
    @videoponder4673 Год назад +5

    Thank you so so much for this video! This is the explanation of the missing link in the chain. As a self-educator I was desperately searching for exactly this.

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

    Thanks Sunny !
    The pdf you've given in the description really helps.

  • @crysis992
    @crysis992 Год назад +33

    A video on how to setup auto deployment on a custom server would be awesome. So our app gets build on the server automatically with the latest changes to branch x on git.

  • @ewwitsantonio
    @ewwitsantonio 8 месяцев назад +1

    Excellent demonstration! This has cleared up so much for me. Thank!!

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

    That was absolutely brilliant! Thank you so much. I would love to see a video about adding an ssl certificate and adding a domain to the site. Thank you again!

  • @Saad_sahib
    @Saad_sahib Год назад +5

    Sonny! You're raising the top level of education available to us Your videos are enlightening to us and providing new knowledge thanks bro🙂 my English is not Soo good but I hope you under stand

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

    Wow. This video is sooo helpful. I covered all information i want to know. Thank you!

  • @christopheradolphe
    @christopheradolphe 9 месяцев назад +1

    Thank you for such great content. That's exactly the alternative I was looking for. Oh and by the way, totally unrelated... but that fade hair cut is sick!!

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

    Iv been waiting for this for sooo long

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

    I just deployed my nextjs app in shared hosting. Just took 5 mins. App running smoothly.

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

    Awesome video, specially the last part where you actually runs in localhost, this will make my work A LOT faster! Huge thanks

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

    Thank you so much. I was dealing with the issue of hosting my website on VPS. Now I can easily do that.

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

    It was very helpful for me. Big Like!

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

    Thank you very much brother. This video really helped me alot.

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

    Thank you for this video! I would like you to explain more about deploy. This topic is quite tricky for a not backender. Perhaps making a clone of functionality of vercel (connecting git to server) on this channel can collect a million of likes

  • @DanielPenaloza-fj8yo
    @DanielPenaloza-fj8yo Год назад +2

    It would be awesome if you Sonny can make a small guide of managing Nodejs apps (like Nextjs) in a VPS (like hostinger's). Cause sometimes it's really hard to find some relevant information like yours, thanks a lot.

  • @tair2347
    @tair2347 8 месяцев назад

    I don't write comments at videos at all, but this one is such a good video with grained explanation and showcase. Thank you very much!!! (And doc btw is very useful)

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

    As a complete beginner to hosting, how safe is this? Like would I be able to create a nextjs app that i know is safe if i was to host it on vercel and be able to host it on a vps or do i need to take extra security measures? and is the process the same on other hosting websites that let you create a vps?

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

    wow thumbs up for sure.. well deserved! (and subscribed!)

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

    The Best #papareact 🔥🔥🔥

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

    Thanks man!
    It was very helpful!

  • @murraywilliams-wd
    @murraywilliams-wd 6 месяцев назад

    Thanks Sonny like everyone else I was able to follow your instructions and get my VPS setup so this has been a super helpful video. The issue is that in reality we would never follow this process of setting up a new NextJS app on our server, it's almost always going to be setup and built out locally and then when it's ready to be deployed we need to push it to a server. Pretty please can you explain how we would integrate our Github repo so that we can auto deploy to our hostinger VPS 🙏

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

    Hi broo..Enjoyed and totally loved it❤
    Please bring SSL certification video

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

    Hey Sonny, you are the one who taught me ReactJs, which opened up the path for my career and startup. Wish you all the best.

  • @sujjee
    @sujjee Год назад +9

    Hey man! I really enjoyed your videos. I'm currently looking into implementing multi-tenancy (wildcard subdomains). I've read the Vercel documentation and cloned Steves Tey's platform starter kit, but I'm still having trouble understanding the concepts. Would you be able to create a video on this topic that is more beginner-friendly? I'm particularly interested in learning how to use the new Next.js app route feature.

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

    Cool from an old grand daddy : i love your Channel.😊

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

    2 words => Merci Sonny ! 😎

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

    Thanks for the bonus with remote - ssh . It’s really awesome

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

    Amazing, Thank you

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

    Been waiting for these.. Had been deploying my apps to a vps but wanted someone to share latest standards on how to do it esp auto deploys with web hooks or something

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

    Wow. Why does such an amazing video have just this many likes?

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

      We will grow don’t worry 🙏🏽 thank you so much for the support!!

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

    it cold, thank you so much sonny, i have one question how if i want to deploy two project in one vps?

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

    this is God sent

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

    Thanks you Sonny ! Please make more videos like this !
    How can i do if i want to publish more than one site using next ??

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

    Very beginner friendly guide. Please do the SSL setup video!

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

    Super content. Thanks !

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

    Thanks so much, this video taught me all I needed to know and got everything working on my side. But a quick question, how can you replicate this process for two or more apps that you want to be running on same VPS server. Also how does the server understands from the client's request which repository location that needs to be rendered

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

    Very useful. Subbed.

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

    As a Sr. frontend developer, I already have the above but still enjoyed watching on 2x speed 😅, also it will be great to make the ssh for it too

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

    ❤ u got your self a new sub with a bench of likes , thank you bro

  • @ZadSoleimaninia
    @ZadSoleimaninia 10 месяцев назад +1

    Hey Sonny, thanks for the tutorial, very neat and easy to follow!
    Do you mind sharing what screen recorder software you use? Trying making a few videos for workplace and almost none of them work for me when I'm trying to embed my webcam inside the video in real-time!
    Thanks

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

    Thanks for this video. I want a video for ssl conf. Thanks in advance 🤜

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

    Very much appreciated.

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

    Thank you so much!

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

    If I understand you right, you forwarded all requests for your web app to the node server, including requests for images, css etc.?

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

    I have a question when I do VPS do I lose the functionality of features such as middleware and API routes? Its kinda of a dumb question seeing as you are using app router. Its just that I may need to do this exact thing to host a PWA Next.js 13 app that Im doing. Great video, you gave me a solution!

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

    Hi Sonny! I was wondering if you have any advice about setting up an SSL Certificate in a VPS environment?

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

    is there any benefit of using vps over vercel?

  • @369-davian
    @369-davian 7 месяцев назад

    GOOD JOB!

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

    Hey, Can you please tell me where can I store my env variables in this?

  • @jackfrosch
    @jackfrosch Год назад +4

    Fyi, NGINX is pronounced like "engine x".

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

    Is cloudpanel required? or just ubuntu OS is good enough to start with?

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

    Great! how can you use Deferent node version my various app?

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

    The sharpest eye brows in software engineering

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

    Can we deploy Strapi cms project in Hostinger VPS server??

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

    15:21 I get an error when installing npm: "... have unmet dependencied:" ... "Unable to correct problems, you have held broken packages." Did I miss any step?

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

    Can we do it in simple website hosting plan?

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

    How can i connect my custom domain to deployed next.js app to specific IPAddress ?

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

    Would love to see a self-hosted github runner + monorepo project

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

    Big love sony sir ❤❤

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

    This is gold bruh gold👏🏾 goin make shmoneyyy with this

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

    why does no one tell you about the minimum vps configuration and the recommended one. how do I figure out how powerful a vps I need for next js?

  • @DeepakMishra-cz7fj
    @DeepakMishra-cz7fj Месяц назад

    dyanamic route is not working.. Its chunk throws 404. Could you help me to resolve that

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

    Any resources on maintaining serverless api inside VPS?

  • @victorc.chikezie
    @victorc.chikezie Год назад

    This is so beautiful. What if there is an error and I don't want users to see it yet until it's fixed, how do I do that since I'm working directly to the project folder from my remote vscode?

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

    Awesome, how do you do this but have it auto deploy from github? same setup, just auto deploy?

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

      In Vercel dashboard you can connect your GitHub in the integrations panel, once you do this pushing to master/main can trigger a deployment! Hope this helps!!

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

      @@SonnySangha I mean the VPS, not Vercel

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

    But what if we want to host both the next.js site and the php (mysql) site on the same server?

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

    This is awesome to deploy to custom server, lots of nextjs devs are searching for ...
    But a Major question here.
    Will app router middlewares and api route in nextjs work with this way?????
    Thanks

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

    wow! its tremendes and exellent job :) thanks a lot for this tutorial

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

    Hello, my backend is PHP. Can I install PHP on Ngix? Can you make a video on how a Next.js app would work with PHP?

  • @muhammadtahir-f6n
    @muhammadtahir-f6n Год назад

    warp is not available for windows, please, recommend any other terminal for this setup

  • @engageintellect
    @engageintellect Год назад +4

    Engine X*

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

      Not gonna lie, I LOLed.

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

    Let's do it.

  • @ONEOTPOfficial
    @ONEOTPOfficial 8 месяцев назад

    production build?

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

    works with cyberpanel?

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

    Hello, I bought a virtual server with 3 cores and 2GB of RAM, and I uploaded a very simple Next project to it. Inside this project, I installed the libraries `react-icon`, `react-toastify`, `next-auth`, and `tailwind`. Then, when I tried to build the project on the server, it me an error about unsupported CPU and said it couldn't do it. I want to know, is Next.js really that heavy that it can't even build a medium or small-scale project on such a server? Can you guide me and tell me if using Docker would make a? Please explain.

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

    I hope you will create tutorial how to do the same with docker images and github repo

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

    thanks bro

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

    This seems quite complicated, can't I just host the app on my own hosting where I put my regular web pages?

  • @muhammadtahir-f6n
    @muhammadtahir-f6n Год назад

    Can I use putty on windows 10 to connect with server.

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

    Sir ck you create videk for use ssl on this video?

  • @muhammadtahir-f6n
    @muhammadtahir-f6n Год назад

    I have purchased kvm2 hosting.
    and complete initial setups.
    how can i upload my nextjs project now. i want to deploy via github.

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

    There is no way to generate a statci/dist/out folder with all the javascript/css/html and upload this folder in the vps instead of upload the whole app . i mean like we do using vite ??

  • @Ga2-20
    @Ga2-20 Год назад

    Is it possible to integrate this flow with github? E.g. to have production app on main branch and staging app on develop branch? And when branch is updated then app on the servee also updates?

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

    Need your guide on ssh for this one ❤

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

    Thank you so much for this guide, it was very helpful!
    Do you mind if I create my own guide on how to deploy Next.js app to Google Cloud VM on free tier using the knowledge that I got from this video? I think it will be beneficial for the dev community 🙂

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

    bro thanks you

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

    after deploying next.js e.commerce plateform in hostinger, does it have bills to pay like vercel, cause i've watched a lot of people complaining about the hight bills to pay in vercel and now i'm afraid that this happens too in hostinger, so can anyone lead me to what is the best buisness plan to choose and what are the do's and dont's that i must to have in mind ????

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

    Thanks a lot. Please teach us load balancing and ssl and dns

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

    Great video, but I have a couple questions I'm hoping someone can help me out with.
    1.) How do you deploy a Nextjs project that I've created that is on my desktop or on GitHub? Sonny only shows how to upload a newly created project.
    2.) I followed Sonny's example and it worked perfectly. However, where is the project stored? I cannot find it using the CloudPanel GUI. It is not located under the "Sites" tab, so I'm not sure where I could go to access it.
    Thank you to anyone that is able to help me. I really appreciate it.

  • @Its-InderjeetSinghGill
    @Its-InderjeetSinghGill 5 месяцев назад

    Host-inger❌
    Hos-tinger✅

  • @skphotographyediting8983
    @skphotographyediting8983 10 месяцев назад +2

    Sunny it's showing an Error called /etc/nginx/sites-available/nextjs.conf : No such file or directory

    • @UnfairDz
      @UnfairDz Месяц назад +1

      Hi, I had the same issue just reinstall Nginx by using those command lines:
      sudo apt-get remove --purge nginx nginx-common
      sudo apt-get install nginx

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

    How do I add images in the public folder of the app? Can anyone help me on this please.

  • @BrandonF-z6v
    @BrandonF-z6v Год назад

    is this only possible by paying? I got a hostinger domain and hosting because youtubers told me to, while i was building nextjs apps, and then i pay for it and find out i can't host nextjs apps, and i have to pay for a vps now? super frustrated. is there a free option?

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

    can you deploy a nodejs server on it as well?