Тёмный

How to deploy Next.js project to cPanel | Create custom server | Deploy Production Build in cPanel 

Dev Echoes
Подписаться 18
Просмотров 1,1 тыс.
50% 1

In this tutorial, We will deploy next.js project with prodution build in cpanel. When we deploy it in production it is really fast than the developemnt build.
Next.js creates issues when we deploy it to the cpanel with production. But we will solve those issue as well for deploying it to the cPanel.
In package.json include these scripts:
{
"scripts": {
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
}
}

Опубликовано:

 

17 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 26   
@Waqas-b1u
@Waqas-b1u 17 дней назад
Thank you so much. I found solution how to deploy and it fix my error during deploy on cpanel😊
@code_lab_9994
@code_lab_9994 17 дней назад
Thanks for watching
@blogvlogadvertising4976
@blogvlogadvertising4976 27 дней назад
Keep up the good good work, Thank you
@code_lab_9994
@code_lab_9994 27 дней назад
@@blogvlogadvertising4976 Thanks so much for watching 👍
@olujobifolaranmi2133
@olujobifolaranmi2133 28 дней назад
Thank you for this tutorial, it's very straightforward 👍
@code_lab_9994
@code_lab_9994 28 дней назад
​@@olujobifolaranmi2133 Thanks so much for watching and for your kind words! Glad you found the tutorial helpful. 😊
@BiniyamYoseph-t7j
@BiniyamYoseph-t7j 7 дней назад
grate video can u show us how to connect to pgsql database as well
@code_lab_9994
@code_lab_9994 7 дней назад
Thanks for watching. I will make tutorial on that soon.
@manishbhusal-fq2vv
@manishbhusal-fq2vv 5 дней назад
my project in next js TS tailwinds, I do same steps but show 503 error.
@code_lab_9994
@code_lab_9994 5 дней назад
@@manishbhusal-fq2vv make your build locally, and as a last step after running project unzip the .next folder in cpanel project directory. If solution works make sure to press subscrb channel
@LanaGames.
@LanaGames. 11 дней назад
what's your package json
@code_lab_9994
@code_lab_9994 11 дней назад
Your script part must contian this in package.json "dev": "node server.js", "build": "next build", "start": "NODE_ENV=production node server.js"
@maneeshsingh3038
@maneeshsingh3038 8 дней назад
Does this work on app router as well? I am getting error as i am using app router
@code_lab_9994
@code_lab_9994 8 дней назад
Deployment is same for both.
@maneeshsingh3038
@maneeshsingh3038 5 дней назад
​@@code_lab_9994I am unable to deploy view .next folder on my cpanel .. While I try to redeploy .next folder,it says the folder already exists, but it is not showing in cpanel
@maneeshsingh3038
@maneeshsingh3038 5 дней назад
Apparently I am getting error while running JS script build which says 'out of memory error may be caused by hitting LVE limits or "Max data size","Max address space" or "Max resident set" process limits.Please check LVE limits and process limits.' How to deal with this error? Any idea?
@code_lab_9994
@code_lab_9994 4 дня назад
@@maneeshsingh3038 you should not run JS script there instead you should create build locally and paste .next folder at last step and restart app as i did in video
@LanaGames.
@LanaGames. 11 дней назад
can you upload you github?
@code_lab_9994
@code_lab_9994 3 дня назад
In video description i have written the package.json scripts part that you needed. I will also put github link later.
@robiulhasan1028
@robiulhasan1028 27 дней назад
brother, i am working on app router and using middleware.js file for authentication. but, the middleware not working on the shared host. can you help me on this?
@code_lab_9994
@code_lab_9994 27 дней назад
try to make middleware.js file in the project root folder instead of pages directory. If you are using src/app then move this in src folder instead of src/app. Hope this helps.
@robiulhasan1028
@robiulhasan1028 27 дней назад
@@code_lab_9994 i am using app router and the middleware.js file is already in the src folder. but it's not working. basically, i get not-found page for the routes which are mentioned in the matcher isndie the middleware.js file.
@robiulhasan1028
@robiulhasan1028 27 дней назад
@@code_lab_9994 i am working on the app router and the middleware file is already on the src folder. but not working as expected. basically, i am getting not found page for all the routes which are mentioned in the matcher inside the middleware.
@manishgupta7181
@manishgupta7181 23 дня назад
is there a way to do it with out folder? because for my project .next folder is quite large , also i tried doing it with out folder but its causing problems in routing
@code_lab_9994
@code_lab_9994 23 дня назад
@@manishgupta7181 I also have tutorial on that goto my channel and you will find deploy static html export on cpanel
Далее
Holding Bigger And Bigger Dogs
00:18
Просмотров 22 млн
Send Emails In Your Next.js Application Using Postmark!
32:56
How to DEPLOY🚀 Nextjs in cPanel 2024 (Deploy Nextjs)
10:21
The BEST way to host Next.js websites
17:37
Просмотров 44 тыс.
I Didn't Know Next.js Server Actions Could Do This!
6:53
Stop using Server Actions | Nextjs
7:35
Просмотров 8 тыс.
How to Roll Your Own Auth
13:05
Просмотров 110 тыс.
How To Use Next.js 14 Server Actions
21:06
Просмотров 25 тыс.