Thank you so much, sir! Almost 2 years later, your video is still incredibly helpful. I just wanted to point out that for those who might want to deploy their app on the primary domain, there might be an issue where cPanel refuses to grant access to the public_html folder when creating the Node.js app. An alternative solution is to create a subfolder (you can choose any name) within the public_html directory and upload your files there. The process remains the same, just with a different application root folder: public_html/yourfoldername. Thanks again and best of luck!
Thank you bro, I've been searching every where the way hosting nextjs website but always failed and finally succeed after watch your video tutorial. thanks a lot for your effort.
Hi there. I have my nextjs deployed to cPanel as on the video but I get the 500error. I have my website running on Vercel but deploying to cPanel turned out to be a complete nightmare. Can anyone help me out here? I have tried everything I could online. Node version is the same locally and on the server.
My problem is, running the NPM Install from cPanel got me an error so it was failed, but it just showed an Error, no additional description. So what happened and by this can i just run npm install on local then upload it within the zip file?
This is great.almost Everything should work just fine. There problem I have with nextjs is this, hosting a nextjs app on another plattform other than vercel may require you to create a custom server. This is not very good. Doing so will remove some of NextJs very important features like Automatic static optimization. So pages a no longer pre rendered and others. Meanwhile, all these features are what make NextJs this popular. I find this as a huge red flag cuz am force to stick with vercel.
Thank you for the video, great explanations. I had issue with cpanel not allowing npm install (last step) and the provider changed the npm config to http (without s) so the basic app would work. But when I upload my next.js app (the most basic one, no code changed except server.js and package.json) npm install goes well, but it is always error 503. I use same node version on both cpanel and locally (18.16.0). Do you have any idea why this is the case, and also is it normal that node modules in this cpanel folder (where app is) are only 57kb, is that a reference or some bug? Thank you!
Hi, when I move to other page like /about, it works fine. But if I refresh /about page, it turn to 404. The only page that I can refresh is only home page /. Is there a way to fix that? thank you
Watch this video and download the .htaccess and add it to your files ruclips.net/video/F0ORxJWZ_D8/видео.html Check the video description for the link to download . htaccess file and add to root of your nextjs project directory
iam always fail on next js 13.2.3, on my cpanel server only have v.14, v.16.19.1 , so im choose v.16, but when im npm install by application cpanel its always fail, so im trying by ssh , them says , killed when installing npm , any have tips or trick ? tyy
@@codesermon We're sorry, but something went wrong. The issue has been logged for investigation. Please try again later. and Error ID: 9ed91db8 all i can found and i dunno what is that
that works with not nextjs apps like react alone and if you have installed mod passenger and nodejs with easyapache or you need that your hosting provider has this options enabled
I was getting 503 all the time and in my case you needed to upload node modules to a server, cause it caused lags and etc while installing it so zip node_modules do not skip it and skip the installation part on the server, it is interesting why you did it this way why you didn't zip node modules locally and uploaded to a server instead of using a server to install node modules?
node_modules is too heavy to zip & upload. Never upload node_modules locally. The reason you received 503 error was because your local dev node version is different from your remote node version. Ensure both versions are the same and try it and see. If your local Dev node version is 16, your installation or app may fail on remote node version 14. Ensure it's 16 on local Dev and 16 on remote Dev or 14 on local Dev and 14 on remote Dev. This will ensure you use packages that compatible with each node version.
yes, I only had several options on a server for node versions, that`s probably was the case the server couldn't install packages, well anyway is there any other reason why I should not zip my node_modules and extract those on a server apart of size and waiting for it to upload to a server? Thanks
@@paulks9771 No any other reason but it will be quite daunting task to be uploading node_modules always. It's just a tradition to freshly install node packages on any new server to ensure compatibility. I will be releasing a video on auto-deployment of nextjs app on cpanel soon.
@@codesermon First of all thank you for the video. I am also getting 503 error. My local node version is 18.x and server is 14.x. I did not realize this issue while developing. Now that I have built this whole app, what can I do to solve this issue? also getting some unhandlespromiserejection error on the log file. Really appreciate your help, thanks again!
Thank you so much, sir! Almost 2 years later, your video is still incredibly helpful. I just wanted to point out that for those who might want to deploy their app on the primary domain, there might be an issue where cPanel refuses to grant access to the public_html folder when creating the Node.js app.
An alternative solution is to create a subfolder (you can choose any name) within the public_html directory and upload your files there. The process remains the same, just with a different application root folder: public_html/yourfoldername. Thanks again and best of luck!
Looked everywhere over the last two days. This video is the only thing that really helped deploying next.js app with DirectPanel. Thank you.
Glad it helped!
Finally the details I was looking for. THANK YOU for sharing this and let's hope the God of programming will be with me too. :)
Glad it was helpful!
Thank you bro, I've been searching every where the way hosting nextjs website but always failed and finally succeed after watch your video tutorial. thanks a lot for your effort.
Glad you found it helpful
Hi there. I have my nextjs deployed to cPanel as on the video but I get the 500error. I have my website running on Vercel but deploying to cPanel turned out to be a complete nightmare. Can anyone help me out here? I have tried everything I could online. Node version is the same locally and on the server.
do u got the solution can you please help
Could you please make a video on deploying the Next 13.4 App Router in shared hosting! I haven't find any solution yet
My problem is, running the NPM Install from cPanel got me an error so it was failed, but it just showed an Error, no additional description. So what happened and by this can i just run npm install on local then upload it within the zip file?
It is possibile to add environmental variables?
for all the people trying to do this yo need to have a hosting or a whm server with cloudlinux for this node selector
I keeping getting a 503 error. Any idea why?
This is great.almost Everything should work just fine. There problem I have with nextjs is this, hosting a nextjs app on another plattform other than vercel may require you to create a custom server. This is not very good. Doing so will remove some of NextJs very important features like Automatic static optimization. So pages a no longer pre rendered and others. Meanwhile, all these features are what make NextJs this popular. I find this as a huge red flag cuz am force to stick with vercel.
Thank you for the video, great explanations. I had issue with cpanel not allowing npm install (last step) and the provider changed the npm config to http (without s) so the basic app would work. But when I upload my next.js app (the most basic one, no code changed except server.js and package.json) npm install goes well, but it is always error 503. I use same node version on both cpanel and locally (18.16.0). Do you have any idea why this is the case, and also is it normal that node modules in this cpanel folder (where app is) are only 57kb, is that a reference or some bug?
Thank you!
it return 503 response, what should i do ?
What is the point of changing npm run start script if we are not using it?
Sir,here are you using shared hosting or vps hosting?please reply.your 30 secs may help me a lot.
Shared hosting on namecheap
Hi, when I move to other page like /about, it works fine. But if I refresh /about page, it turn to 404. The only page that I can refresh is only home page /. Is there a way to fix that? thank you
Watch this video and download the .htaccess and add it to your files ruclips.net/video/F0ORxJWZ_D8/видео.html
Check the video description for the link to download . htaccess file and add to root of your nextjs project directory
After all those steps, it displays only blank page :/ Any idea what is wrong?
Why did you create this server.js file?
Next.js itself is not compiled, but doesn't it give you a server inside .next/server?
Good tutorial!
You need a custom server if you're using your own server
Thanks, but is there a way to deploy both your express backend and Next Js Application Cpanel?
Yes... You can either integrate your API in the nextjs app or deploy it separately on the Nodejs server
Thank you for your efforts, this video was really useful!
Thank you Sir - it worked perfectly! 🙂
Glad it helped
iam always fail on next js 13.2.3, on my cpanel server only have v.14, v.16.19.1 , so im choose v.16, but when im npm install by application cpanel its always fail, so im trying by ssh , them says , killed when installing npm , any have tips or trick ? tyy
Hey
Thank you for the detailed explanation 🙂
Plzz make video on how to deploy nextjs app on hostinger h-panel
Simpler and brief than the previous video about this topic? But you didn't delete the package.json file this time around?
Forgot but you can combine the two videos to get what you want.
@@codesermon That’s exactly what I did. Thank you for the lecture. Good job 👍🏾
@@azeezabidoye1188 don't forget to subscribe and share with your friends, thanks.
Not working for me. Maybe when i extract all files there is no .next file in cpanel in extract he is in but after he is not help!
what errors are you receiving?
@@codesermon We're sorry, but something went wrong.
The issue has been logged for investigation. Please try again later. and Error ID:
9ed91db8 all i can found and i dunno what is that
@@AlMagic911 did your script run successfully?
@@codesermon ye everything was fine
@@AlMagic911 Here's what I suggest you should do. Create a new subdomain and repeat the process. If the error occurs again, we will schedule a session
Hai nice tutorial ...Is it possible to run next js application without (setup node js app )in cpanel
Nope
What will be the application root if we are setting up up on the main domain?
public_html directory within file manager
It doesn't accept public_html I am trying to deploy a nodejs app with ejs on cpanel it keeps showing error even after following your video
@@zyzer01 when creating the app using the node app interface, choose public_html as the root directory and let it perform the configuration for you
faz um video falando da sua hospedagem para nós, por favor
Nice tutorial sir! Which provider use for cPanel?
namecheap.com
Great video, please how do you handle things like API keys stored in a .env file?
You can add them to the environment variables options in cpanel.
Super useful - thanks my fwen 🐸
is it possible to deploy sth like that for free?
Its not enough only do next export and then copy the server.js file inside the generated folder?
Hmm don't understand your question. I thought the video is straight forward
that works with not nextjs apps like react alone and if you have installed mod passenger and nodejs with easyapache or you need that your hosting provider has this options enabled
thanks, man. this is very helpful!
Nice work, thanks
HI everyone!, is there a better way to upload my next js website? I tried doing it using this tutorial but I find that the response was so slow.
Vercel is the preferred one by the next team. Also heroku, digitalocean and netlify are good. All of them allow for auto deployment with git.
@@Ziko2687s8 Thankyou for the reply!!! You're right. I found out that vercel's the best option and am using it now. 😁😁
my npm install taking forever
I have got 500 ERROR why?
could you do same for strapi
I will look into it
Nice 🙂 one
Thank you! Cheers!
so, this work with ssr?
read here for more details nextjs.org/docs/pages/building-your-application/configuring/custom-server
cool! but i have a problem with nextjs13, its always a 503
Ensure your development node version is the same with your remote node version
@@codesermon it is for me, but still same error :(
Sir my next js project is giving me 403 error when deploying on hostinger what to do sir for 2 days I am stuck with this issue sir
Have you followed these steps properly? Ensure your local and remote node versions are the same
@@codesermon sir i found out i have shared hosting and next js works on vps hosting thatswhy it didn't work
I was getting 503 all the time and in my case you needed to upload node modules to a server, cause it caused lags and etc while installing it so zip node_modules do not skip it and skip the installation part on the server, it is interesting why you did it this way why you didn't zip node modules locally and uploaded to a server instead of using a server to install node modules?
node_modules is too heavy to zip & upload. Never upload node_modules locally.
The reason you received 503 error was because your local dev node version is different from your remote node version. Ensure both versions are the same and try it and see.
If your local Dev node version is 16, your installation or app may fail on remote node version 14.
Ensure it's 16 on local Dev and 16 on remote Dev or 14 on local Dev and 14 on remote Dev. This will ensure you use packages that compatible with each node version.
yes, I only had several options on a server for node versions, that`s probably was the case the server couldn't install packages, well anyway is there any other reason why I should not zip my node_modules and extract those on a server apart of size and waiting for it to upload to a server? Thanks
@@paulks9771
No any other reason but it will be quite daunting task to be uploading node_modules always.
It's just a tradition to freshly install node packages on any new server to ensure compatibility.
I will be releasing a video on auto-deployment of nextjs app on cpanel soon.
@@paulks9771 hey paul im getting the same problem with 503 error everytime can you explain to me all the ways you fixed the issue?
@@codesermon First of all thank you for the video. I am also getting 503 error. My local node version is 18.x and server is 14.x. I did not realize this issue while developing. Now that I have built this whole app, what can I do to solve this issue? also getting some unhandlespromiserejection error on the log file. Really appreciate your help, thanks again!
Thanks for this!
hey! it thows an error on webpage " Error 503. Service Unavailable "
Ensure your local Nodejs version is the same with your remote Nodejs version
@Ali install nvm to use multiple node versions and ensure your development version matches your remote version
Broooo helppp, after i import the files in filemanager its not detected the configuration files package.json
Follow the video again and let me know what happens
@@codesermon bro the eror
npm ERR! code ERESOLVEnpm ERR! ERESOLVE unable to resolve dependency tree
@@muhhisymatqushayyi8497 did you click on npm install on the Nodejs server?
@@codesermon yes sir, but the eror show up
@@muhhisymatqushayyi8497 where do you see this error?
Hey, when I try to update web pages from cpanel it is not updating
Anytime you're about to update your uploaded files, you must stop and restart your server.
@@codesermon So can we not update inside cpanel text editor
@@codingjunk whenever you update,you must restart the server to pick the changes
@@codesermon I have done it but changes are not reflecting
@@codingjunk clear cache once you've stopped & restarted the server. It will reflect
Thank you !!!
Muchas gracias!!!
De nada
CRACK!