Holy crap, I spent countless hours trying to figure this out on my own a few months ago and eventually gave up - this is the first tutorial of its kind, I am beyond excited. Will edit my comment if I can get it working, and what kinks I experienced along the way
Seeing a Vercel employee teaching this makes me trust Vercel more. Finally they're being open about it. I don't believe Vercel would lose much by doing this, most people will stick with the convenience. Those who want to move to self-hosted solutions will do so whether Vercel hides that it's possible or not.
I don’t think Vercel are trying to hide anything; Vercel have provided self-hosting documentation for as long as I remember. There’s no step-by-step tutorial in their documentation but they cover self hosting in the deployment documentation.
@@PraiseYeezusHow often do you see Vercel advocates talking about it? I thought it was a no-brainer that Vercel makes it seem like letting them host is a silver bullet, feels free to share more content like this one
Thanks for making this video Lee. Super handy resource that I'll be sharing around at work. Also great to hear you guys have taken feeback on board from people like Brandon. Keep up these type of videos. Super insightful.
Although I know a lot about self hosting my own apps I still found this video to be very useful as I am still a beginner to NextJS and there was a ton of info here specific to NextJS, I recommend everyone watch this before deploying. There are a few changes I would make it to the script like forcing SSH keys and setting up fal2ban for SSH and I'm not sure if you're taking pull requests but there are a few other things too, if you are taking PR's, I'd be willing to help add to the script. Otherwise, I totally understand because then the video may become out of date.
I am really happy for this video, my startup is not ready to leave vercel but i have been thinking of sustainability and that made Remix look good but deep down i know Nextjs is the 🐐 .
Lee man I know it may be difficult for you to make this full fleged tutorials, but please keem them coming! Would love to see more such videos wherein you build stuff
I am absolutely no one and at the same time very valuable (IMO) feedback giver: thanks, Lee, you are doing a very valuable job for sooo many people, you can't even imagine this crowd
Thank you so so much Lee. The part where you talk about caching was extremely important to me. I think the vercel docs need to better explain WHERE all of the caching is stored when you deploy on a VPS, or when you deploy to Vercel. I think that your explanation helped me understand where the unstable_cache() function for example might store all of its data, depending on the environment
BREAKING: Vercel is announcing a round of layoffs (1 employee) because of forbidden tutorial nah, just joking This is a good tutorial definitely. A lot of folks fail hard to self-host Next.js and this really helps. Thanks! 😎
Her Lee I have an idea for your next video that I believe will benefit a lot of devs. Build this exact thing but on AWS instead. I believe that’s where a lot of mid to large engineering companies are at. I keep hearing the sentiment from a lot of peers that NextJS is for startup and agency type work in my circle.
Awesome tutorial, Lee! Would you like to do one using Kamal? It'd be great. Thank you in any case. P.S: Kudos to Vercel to not fear doing something like this. It makes me trust you/them (even) more.
Awesome stuff Lee, thanks for sharing! One question though. As I understand it caching on a CDN is not something you would do if you also want to support PPR? I guess for that to work you do need to hit the server so it can assemble the content from the cache in nextjs together with whatever content that is streamed in a suspensed component. Correct?
docker-compose is now built into docker since a few years ago as "docker compose" iirc, so I don't think it is necessary to separately install docker-compose in the script
It would be great to get more info around deploymentId / x-deployment-id header etc... for skew protection. Running into issues with Next 15 now that ServerAction ids are secure.
@leerob - I am having trouble understanding the build step of a Nextjs application with Prisma. How and when did you push your schema design to the Postgres DB? I am not seeing anywhere in the code base where you actually call `db:push`. Furthermore. With server components, the build step can often require a database connection so that it can cache resources at build time. On the initial deploy, the postgres database doesnt exist, and the `web` service is encapsulated from the other running containers at build time. (at least this is what I have gathered) so i cant simply start the `db` container first. Any direction on these issues would be helpful. Thanks for the amazing video. PS. I am new to this, and trying to adapt this deploy script into my own application and understand how it works -- not working directly from a fork of yours.
Hey, love the video thanks. I have a question about it, How much traffic per month can handle, more less ? I want to make it but I don’t know how much traffic I would be able to handle in my project.
Very useful information. One thing that is unclear to me is cache persistance across deployments. Would next.js's default cache handler be able to re-use data, cached from a fetch request with revalidate timer from a previous deployment, when a new docker instance is created? If not, what would I need to do to achieve this?
We appreciate you Lee
You see Cody? "Just use Neovim, bro" 😂
He is employed by vercel
@@sinaasadi3800 And? Is something salty for you?
@@sinaasadi3800 why does that change if we appreciate anyone or not?
Amazing, lovely resource to redirect my viewers when they ask about self hosting! :)
Lee, that's a good step to open-source community, really appreciate it
Knowing I can self-host anytime makes me feel more comfortable using Vercel.
Holy crap, I spent countless hours trying to figure this out on my own a few months ago and eventually gave up - this is the first tutorial of its kind, I am beyond excited. Will edit my comment if I can get it working, and what kinks I experienced along the way
How's it going so far?
Seeing a Vercel employee teaching this makes me trust Vercel more. Finally they're being open about it. I don't believe Vercel would lose much by doing this, most people will stick with the convenience. Those who want to move to self-hosted solutions will do so whether Vercel hides that it's possible or not.
I don’t think Vercel are trying to hide anything; Vercel have provided self-hosting documentation for as long as I remember. There’s no step-by-step tutorial in their documentation but they cover self hosting in the deployment documentation.
finally they're being open about it? lol
@@PraiseYeezusHow often do you see Vercel advocates talking about it? I thought it was a no-brainer that Vercel makes it seem like letting them host is a silver bullet, feels free to share more content like this one
A lot of mid to large companies need to be able to deploy on their infrastructure.
Why vercel does not provide self hosting on their plateform too ?
I love everything about this video. Its very comprehensive and to the point while staying completely unbiased. Hope to see more!
Lee is coming in clutch with the NextJS as always 🔥
Thanks for making this video Lee. Super handy resource that I'll be sharing around at work.
Also great to hear you guys have taken feeback on board from people like Brandon.
Keep up these type of videos. Super insightful.
Best video for self hosting Next.js on TH-cam
I appreciate all the effort you are making to clarify these points. And I love that you used Bun runtime as an example!
Thanks, this is exactly what I’m looking for. Feels nice seeing it from someone who actually works at Vercel
Thats really great, that Vercel helps developers, to self-host their app.
👏 Thanks for the video! It's amazing ✨. This is the kind of video we need to save the link to see later when it's needed.
Greetings from Brazil 🇧🇷🇧🇷🇧🇷
Boss tutorial. Appreciate the material you put out for the community :)
Love this type of videos we need more that goes deeper into next.js and how to use some advanced features on otger platforms
this is so honest! huge respect for Lee and Vercel even more now!
Although I know a lot about self hosting my own apps I still found this video to be very useful as I am still a beginner to NextJS and there was a ton of info here specific to NextJS, I recommend everyone watch this before deploying. There are a few changes I would make it to the script like forcing SSH keys and setting up fal2ban for SSH and I'm not sure if you're taking pull requests but there are a few other things too, if you are taking PR's, I'd be willing to help add to the script. Otherwise, I totally understand because then the video may become out of date.
Can I connect with you as I don't know much about hosting but learning. It would be great connect with you on LinkedIn or some other platform
I am really happy for this video, my startup is not ready to leave vercel but i have been thinking of sustainability and that made Remix look good but deep down i know Nextjs is the 🐐 .
Scratch that theo made a video about improving vercel bill. We are moving no more
Great , I was waiting for more videos from you leerob , to learn things with next , thank you!
Ultimately, this helps reunite the community and encourages people to place greater trust in Next.js.
You’re right, at first I was excited, I was on my third project using Next.js, and then I felt trapped, lol.
Great video. Makes me appreciate vercel more with what they take off my plate
Best deployment video for a framework I have ever watched, thanks Lee!
Lee man I know it may be difficult for you to make this full fleged tutorials, but please keem them coming! Would love to see more such videos wherein you build stuff
I am absolutely no one and at the same time very valuable (IMO) feedback giver: thanks, Lee, you are doing a very valuable job for sooo many people, you can't even imagine this crowd
lol
so much gold info in this video, thank you!
Thank you so so much Lee. The part where you talk about caching was extremely important to me. I think the vercel docs need to better explain WHERE all of the caching is stored when you deploy on a VPS, or when you deploy to Vercel. I think that your explanation helped me understand where the unstable_cache() function for example might store all of its data, depending on the environment
amazing video lee! this was really good. BTW, that peace at the end was new :D
Awesome video Lee! Thanks for your time and effort doing this, it's really helpful
Thank you for this great video! It is educational, very hands on and helps a lot to clear some myths about Next.
This is literally gold.. thank you my man!
Thanks, I'm getting into DevOps and love learning self-hosting
Me too. Can we connect on LinkedIn?
You made my day lee!!! I really appreciate it!
Great work, Im just now staring to dive into Next.js and love to see that self hosting is possible
I respect engineers when I see their vi skills :)
Great video! Small suggestion: it would be nice to zoom in a bit in the terminal so that the text is easier on the eyes
“Items, nice!” 😂🎉 thank you. So. Much.
Dudeeeeee yes. Thank you Lee 🎉🎉🎉🎉
what an incredible video
Respect to Vercel for posting this. 🙏🏻
Thanks for making this video. We really appreciate it.
Amazing to have this update 🎉
Great content, thanks!
Thank you for this tutorial. You've covered a lot of useful topics
Spend management = Pokeball, catching those wild things 😁
big w
yeaah boi, Lee always comes to help :D
Very good video, I learnt a lot 👍
Such amazing content !
Thanks! This is just what I was looking for.
Next: how to do this using Kamal.
very helpful!
Thx for the great tutorial
Powerful move, and great video 👏
Awesome work, Lee.
Thanks Lee, appreciate you so much! Can you make a video on setting up a websocket server in Next.js?
BREAKING: Vercel is announcing a round of layoffs (1 employee) because of forbidden tutorial
nah, just joking
This is a good tutorial definitely. A lot of folks fail hard to self-host Next.js and this really helps. Thanks! 😎
Pretty sure Lee kinda became the face together with the CEO of Vercel they likely would not wanna loss him!
I started learning React & Nextjs because of Lee @@codernerd7076
Super video, thanks!
I already know. But I will watch it because I might learn something new.
Wow awesome content Lee.
Can you please add error and performance monitoring
Her Lee I have an idea for your next video that I believe will benefit a lot of devs. Build this exact thing but on AWS instead. I believe that’s where a lot of mid to large engineering companies are at. I keep hearing the sentiment from a lot of peers that NextJS is for startup and agency type work in my circle.
I wish this like was a vote for knighthood. Thank you!
Awesome tutorial, Lee! Would you like to do one using Kamal? It'd be great. Thank you in any case.
P.S: Kudos to Vercel to not fear doing something like this. It makes me trust you/them (even) more.
Pretty good video actually :)
I want to give him a "hi fi", this is awesome!
Awesome tutorial, thank you
Does Coolify's NextJS template use this exact method? Thanks for this video.
DHH is really powerful
You dropped this……. 👑
yoooo he did it! thank you lee
Thank you for this video!
Good stuff man ❤
Awesome stuff Lee, thanks for sharing! One question though. As I understand it caching on a CDN is not something you would do if you also want to support PPR? I guess for that to work you do need to hit the server so it can assemble the content from the cache in nextjs together with whatever content that is streamed in a suspensed component. Correct?
docker-compose is now built into docker since a few years ago as "docker compose" iirc, so I don't think it is necessary to separately install docker-compose in the script
Sure, I removed it from the script and it worked just fine.
I appreciate you Lee 🌟🌟🌟🌟🌟
I am pleasantly surprised. Thanks
Excellent 👍👍👍
It would be great to get more info around deploymentId / x-deployment-id header etc... for skew protection. Running into issues with Next 15 now that ServerAction ids are secure.
Really nice video.
Man !! this was great !
Thanks a lots Lee !
Lee is the new Dan Abramov
@leerob - I am having trouble understanding the build step of a Nextjs application with Prisma. How and when did you push your schema design to the Postgres DB? I am not seeing anywhere in the code base where you actually call `db:push`. Furthermore. With server components, the build step can often require a database connection so that it can cache resources at build time. On the initial deploy, the postgres database doesnt exist, and the `web` service is encapsulated from the other running containers at build time. (at least this is what I have gathered) so i cant simply start the `db` container first.
Any direction on these issues would be helpful. Thanks for the amazing video.
PS. I am new to this, and trying to adapt this deploy script into my own application and understand how it works -- not working directly from a fork of yours.
lovely, really great content! one question tho, what do you think about SST, maybe someone who's used it for production Next.js could give some info
❤
Very nice, though I prefer using VSCode's SSH capabilities so I can work on the server files in the application UI vs a terminal.
I can''t decide what i like more : Framer Motion or Lee ? 😄
This is awesome.
thanks man, so cool,
🔥🔥🔥
What are the trade offs for hetzner?
You're the best!
Thanks for the vid. Under vercels pro plan how many sites can be hosted / or much monthy traffic can it approx handle?
Thanks Lee!
Btw, is it possible to cap spending per project and not per account only on Vercel?
Hey, love the video thanks.
I have a question about it, How much traffic per month can handle, more less ? I want to make it but I don’t know how much traffic I would be able to handle in my project.
Great video!!!
Bless you sir
ho do you create this slids/diagrams that you explain? the font is cool and your explanation is good
Awesome Video
Very useful information. One thing that is unclear to me is cache persistance across deployments. Would next.js's default cache handler be able to re-use data, cached from a fetch request with revalidate timer from a previous deployment, when a new docker instance is created? If not, what would I need to do to achieve this?
Nice, can you record and share insights baout same approach with turborepo ?
how did you handle migration when new database and update column
Thank you !