Within a few videos that I watched from you, you have become my favourite tech youtuber. Your content is well-structures, concise and insightful. I love the practical yet deep insights you are giving on Next JS and adjacent technologies. Thanks!
Another great video. I think a lot of new developers are afraid to self-host, but they don't realize that learning Linux and Docker sets you up for the future. It's also helpful because PaaS vendors tend to raise prices and try to lock you in over time. Self hosting is wonderful, because you can take your Docker container to another host in minutes. Bare metal is bare metal, your container will work anywhere.
A lot of new developers don't understand that Time = Money. And if you start from building html website, after that you became react developer, after that you started to learning back end. After that you decided that you need to learn linux docker and containers and after that cybersecurity.... And after that you havent shipped anything. Gave up and failed.
@@puzzleetpuzzles7951I'm sorry, could you please tell me why failed? I know frontend and basic backend. Now wanna deoploy my web. so Decided to learn OS and more you mentioned. Is it the wrong way?
Hi Wesley, just wanted to drop a note to say that your react course is fantastic so far! I'm excited to get to the Next.js portion of the course! Thanks for all the great content!
well i'm already suffering with aws Amplify for 6 months and i wanna mention some stuff there security (ddos attacks for example) and scaling i don't know if i could manage VPSs very well at a large scale with zero down time, thanks for the video by the way 😊, and i would be glad if anyone could give me some suggestions.
I'm wondering how PPR would work with self-hosting? A static shell of a page generated build time would be served from a CDN close to the user, and stream the dynamic content on-demand from the server. Any idea how that would work?
Probably it would be a little different. In your case some way of combining parts received from CDN and other received from server should be included. It would be a simple js file to do this. But it requires client to run it and wait. So PPR would be more like that: Client makes request and server starts processing it. Some parts of requested page would be prerendered at build time so server will keep it in memory. During request server will take that parts from memory and include them it the response. Rest of the content that is dynamic would be rendered and streamed to the client (which will already have static content visible in browser). So we save time beacuse we used that static prerendered content from memory
Great tutorial! Thanks for sharing! Is there any benefit of building the docker image locally over building it directly on the VPS on every push (triggered by a webhook / GH action)? This is how I used to do it, but I'm wondering now if I'm missing out on anything compared to your approach. Also, would be great if you could cover SSL auto renewal in another view… Thank you so much!
Great video, as always! What if i have a separate backend, say in Django Rest Framework from my Nextjs Frontend, how could i do it? Could you show us how could we deploy them together and maybe also separately? Could we dockerize them together and deploy them on a self-hosting platform like hostinger/heroku? And, if separately, could it be something like the frontend in hostinger and the backend in heroku? Many thanks, you are truly one of the best, keep it up!
I think we could use docker-compose to build the apps(microservices) as different containers that can talk to each other. This of course would be happening on the VPS
This is interesting. I host my projects on VPS. One of them uses ISR on home page (revalidates every hour). Also there is cloudflare CDN used, but during every request for this home page still full request is needed. This is fairly simple. Client needs to check if page was revalidated or not. But the rest of assets (like js or css) are servered from CDN. Getting to the point. I don't really know how it work with fully static pages. I am going to test that. It will really depend on Next.js and which http headers are set
It simply works. It is nothing different than storing rendered page in memory. Nothing special. Then when it's needed server serves it and revalidate sometimes.
Awesome tutorial! Does Docker Next.js deployment option support for using “edge-runtime” API when deployed on VPS? I heard it uses Cloudflare Workers API in the background.
Amazing videos ! Something weird though, i have an issue with sharp doing the exact same steps for building the docker image ... Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. It's killing me ahahaah
You can choose any database you want. Db should be selected based on project requirements. However, any database should work properly with next.js as good as it works with node.js (it is the same). Only choose proper ORM (many of them support multiple kind of db's)
👋🏼Hey, another great video. I would like to see a more detailed look at the supported Next.js features. What about self-hosting on a VPS with middleware? i18n Routing is where I feel a bit lost so far. AWS Amplify for example does not support middleware with Next 14 yet. The ISR setup would also be interesting. Otherwise, as I said, great overview. Thanks
i'm not sure what do you mean but if you talking about ddos attacks for example Cloudflare would your choise or AWS WAF if you are using aws and you wanna keep everything in one place
Hi! hope you will be able to answer me :) I have hosted my Next.js project on Vercel, but I'm encountering issues with the SQL server database. I keep receiving an error message stating that I'm unable to make requests to the Vercel project due to IP address restrictions. Do you know how I can resolve this issue?
Your explanations are well thought out and on point. Everytime I have something to learn, and I come here, I don't get lost in all those unnecessary technical jargons that I actually don't need to get something done. Love your approach to solutions and much respect for the effort you put into these videos for the community. Super amazing! Bless you!! 🫡
Within a few videos that I watched from you, you have become my favourite tech youtuber. Your content is well-structures, concise and insightful. I love the practical yet deep insights you are giving on Next JS and adjacent technologies. Thanks!
Thanks!
Another great video. I think a lot of new developers are afraid to self-host, but they don't realize that learning Linux and Docker sets you up for the future. It's also helpful because PaaS vendors tend to raise prices and try to lock you in over time. Self hosting is wonderful, because you can take your Docker container to another host in minutes. Bare metal is bare metal, your container will work anywhere.
A lot of new developers don't understand that Time = Money.
And if you start from building html website, after that you became react developer, after that you started to learning back end. After that you decided that you need to learn linux docker and containers and after that cybersecurity....
And after that you havent shipped anything. Gave up and failed.
Let's be honest. If your website has no visitors, self-hosting is the way to go. It's really cheap :]
@@puzzleetpuzzles7951I'm sorry, could you please tell me why failed? I know frontend and basic backend. Now wanna deoploy my web. so Decided to learn OS and more you mentioned. Is it the wrong way?
@@dae2530but if your website has no visitors the hobby plan (free) on Vercel would be better than a VPS, right?
Hi Wesley, just wanted to drop a note to say that your react course is fantastic so far! I'm excited to get to the Next.js portion of the course! Thanks for all the great content!
Hi, that’s great, enjoy!
Really valuable knowledge , have been following you since a long time and you never disappont , really awesome content
well i'm already suffering with aws Amplify for 6 months and i wanna mention some stuff there security (ddos attacks for example) and scaling i don't know if i could manage VPSs very well at a large scale with zero down time, thanks for the video by the way 😊, and i would be glad if anyone could give me some suggestions.
You can host it on lambda functions, which is extremely cheap...and you can leveragrle nextjs server side processing.
1:37 That was not a server action. You forget to add "use server" at the top, so it worked as normal server side function
Nice catch! It doesn't make a difference in the results though.
Wow! Never cease to amaze! By far the best tech youtuber. Sincerely appreciate your content. Keep up the good work!
Thanks for the video. When doing a DNS setup for the ip address so you can use a TLD how do you do that with a port? TY
I'm wondering how PPR would work with self-hosting? A static shell of a page generated build time would be served from a CDN close to the user, and stream the dynamic content on-demand from the server. Any idea how that would work?
Probably it would be a little different. In your case some way of combining parts received from CDN and other received from server should be included. It would be a simple js file to do this. But it requires client to run it and wait. So PPR would be more like that: Client makes request and server starts processing it. Some parts of requested page would be prerendered at build time so server will keep it in memory. During request server will take that parts from memory and include them it the response. Rest of the content that is dynamic would be rendered and streamed to the client (which will already have static content visible in browser). So we save time beacuse we used that static prerendered content from memory
Thank you very much for this wonderful summary and overview.
Great tutorial! Thanks for sharing! Is there any benefit of building the docker image locally over building it directly on the VPS on every push (triggered by a webhook / GH action)? This is how I used to do it, but I'm wondering now if I'm missing out on anything compared to your approach. Also, would be great if you could cover SSL auto renewal in another view… Thank you so much!
Great video, as always! What if i have a separate backend, say in Django Rest Framework from my Nextjs Frontend, how could i do it? Could you show us how could we deploy them together and maybe also separately? Could we dockerize them together and deploy them on a self-hosting platform like hostinger/heroku? And, if separately, could it be something like the frontend in hostinger and the backend in heroku? Many thanks, you are truly one of the best, keep it up!
I think we could use docker-compose to build the apps(microservices) as different containers that can talk to each other. This of course would be happening on the VPS
You mentioned the hostinger vps is best for experienced devs but what do u reccommend for beginners on a budget for next. Js apps and websites?
After building the app
Can you serve static pages from a CDN and dynamic pages from a dynamic server at the same time?
This is interesting. I host my projects on VPS. One of them uses ISR on home page (revalidates every hour). Also there is cloudflare CDN used, but during every request for this home page still full request is needed. This is fairly simple. Client needs to check if page was revalidated or not. But the rest of assets (like js or css) are servered from CDN. Getting to the point. I don't really know how it work with fully static pages. I am going to test that. It will really depend on Next.js and which http headers are set
11:10 correct me if I am wrong but does ISR works when self deploying???
I think its a platform feature
ISR is nothing special and it has been proven that you don't need it, SSR + Caching has same speed as static
It simply works. It is nothing different than storing rendered page in memory. Nothing special. Then when it's needed server serves it and revalidate sometimes.
what about SSL, how to set it up with docker on the Hostinger?
SST whooooo🕊️🌀
Thank you .Totally useful 👍
What if I want to host multiple domain apps on the same vps hosting account
Awesome tutorial! Does Docker Next.js deployment option support for using “edge-runtime” API when deployed on VPS? I heard it uses Cloudflare Workers API in the background.
Amazing videos !
Something weird though, i have an issue with sharp doing the exact same steps for building the docker image ... Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly.
It's killing me ahahaah
Can you do a video on using coolify to host our Next JS Applications?
Thank you for the wonderful tutorial, please consider deploying without docker in your next video. Best wishes!
I also wanna know which database is better with next js
You can choose any database you want. Db should be selected based on project requirements. However, any database should work properly with next.js as good as it works with node.js (it is the same). Only choose proper ORM (many of them support multiple kind of db's)
Tell me you don't have a slightest clue what you are doing without saying it...
@@gubocci Currently I am using MongoDB, but vercel provides us an option for Postgres SQL. That’s why I am confused a bit.
@@C9Sid Yes, Vercel also offers PostgreSQL, but you don't have to use it. You can use what you want
@@domson_0478Thanks man 👍
👋🏼Hey, another great video. I would like to see a more detailed look at the supported Next.js features. What about self-hosting on a VPS with middleware? i18n Routing is where I feel a bit lost so far. AWS Amplify for example does not support middleware with Next 14 yet. The ISR setup would also be interesting. Otherwise, as I said, great overview. Thanks
this was very informative, thank you
amazing! thanks for your guides
what about security ? If a Nextjs app is deployed on a VPS, how must security be done as equal to Vercel deploy ?
i'm not sure what do you mean but if you talking about ddos attacks for example Cloudflare would your choise or AWS WAF if you are using aws and you wanna keep everything in one place
@@xelion7110 i mean which security measures must be taken on a VPS ? cloudflare for DDOS attacks is ok. other measures ?
I'm using Appwrite as Database, Should I upload the .env.local file in the VPN to run my app?
Hi! hope you will be able to answer me :)
I have hosted my Next.js project on Vercel, but I'm encountering issues with the SQL server database. I keep receiving an error message stating that I'm unable to make requests to the Vercel project due to IP address restrictions. Do you know how I can resolve this issue?
Where does something like Google Cloud Run fall into this picture?
Your explanations are well thought out and on point. Everytime I have something to learn, and I come here, I don't get lost in all those unnecessary technical jargons that I actually don't need to get something done. Love your approach to solutions and much respect for the effort you put into these videos for the community.
Super amazing! Bless you!! 🫡
thanks your video
Is it possible to combine both export and standalone outputs so we can host the static oart on a cdn ans the docker image on a server?
Alright take my affiliation money, you deserved it
I tried this method myself but images werent working for me
Did you install the sharp package ?
It's necessary for VM method
thank u
Cloudflare?
I thought Hostinger was a managed hosting platform not self-hosting
New devs went full circle 😂
Amazing world we live this is called - Experienced developer right now😅
👌👌👍👍
coolify