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

67,614
19
Published 2023-09-22
Step-by-step beginner guide 👉 links.papareact.com/deployment

🔥 Sign up to Hostinger and obtain a VPS server. Use code SONNY for 10% off: www.hostinger.com/sonny

🚨 Learn to code - Join my Flagship Course & Community “Zero to Full Stack Hero”: www.papareact.com/course

-----------------

🔴 Looking for the code from my builds? 🛠️
links.papareact.com/github

📩 WANT TO LISTEN TO THE EXCLUSIVE PAPAFAM PLAYLIST?
Sign up for the PAPAFAM Newsletter here 👉 links.papareact.com/newsletter

👇🏻FOLLOW ME HERE:
Instagram: links.papareact.com/instagram
Facebook: links.papareact.com/facebook
LinkedIn: links.papareact.com/linkedin
Twitter: links.papareact.com/twitter
Discord: links.papareact.com/discord

💰 WANT TO SUPPORT THE CHANNEL?
Donate here: links.papareact.com/donate
Grab some PAPA Merch: links.papareact.com/merch

🕐 TIMESTAMPS:
00:00 Intro
01:13 Hostinger Sponsorship
02:09 Hostinger Dashboard Setup
03:06 Warp Terminal
03:30 Step 1 | Initialising ssh Command
04:25 Step 2 | Removing Apache2 & Installing Reverse Proxy
06:20 Explaining Remote Proxy
08:59 Step 3 | Setting Up NGINX Configuration
11:54 Step 4 (Crucial) | Creating a Symbolic Link
14:14 Step 5 | Setting Up the Next.js App
20:35 Step 6 | Implementing PM2
23:47 Bonus Step | Modifying the Site
28:04 Hostinger VPS Benefits
28:42 Outro

Let’s get it PAPAFAM 🔥.

#reactjs #nextjs #hosting #vercel

All Comments (21)
  • As a senior software engineer, I know all of these, yet still watched and enjoyed every second of it, kudos to you 🥳
  • @LoadOfJak
    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.
  • @videoponder4673
    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.
  • Sonny, Thank you so much brother. This was a huge part of the missing link that was so close to putting me off to node.js applications. I have own and run my own hosting servers, owned 3 hosting companies, trained and built over 300, but all before the time of Node.js. I could not get things working. I am not following all your processes found in this video, including programming remotely now, but with one modification. I am using Nginx Proxy Manager to manage my Nginx proxy and SSL certificates, with ability to control websockets and Access from one admin panel. It is very very fast. So now I have a complete solution and I am back to loving working with Node.js and Next.js
  • @crysis992
    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.
  • @semerset
    This tutorial video is GOLD! Thanks a lot!
  • @webwisesagar
    Thanks Sunny ! The pdf you've given in the description really helps.
  • 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!!
  • @bimaturity362
    wow thumbs up for sure.. well deserved! (and subscribed!)
  • @ewwitsantonio
    Excellent demonstration! This has cleared up so much for me. Thank!!
  • @Saad_sahib
    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
  • @lucaskrieck1877
    Awesome video, specially the last part where you actually runs in localhost, this will make my work A LOT faster! Huge thanks
  • @arthur6892
    Wow. This video is sooo helpful. I covered all information i want to know. Thank you!
  • @hadi_2122
    Thank you so much. I was dealing with the issue of hosting my website on VPS. Now I can easily do that.
  • 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.