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

Поділитися
Вставка
  • Опубліковано 10 гру 2024

КОМЕНТАРІ • 59

  • @Waqas-b1u
    @Waqas-b1u 3 місяці тому +3

    Thank you so much. I found solution how to deploy and it fix my error during deploy on cpanel😊

  • @samuelnarciso9110
    @samuelnarciso9110 14 годин тому

    Hermano!, muchas gracias, tenía un problema con los "import from", muchas gracias!

    • @code_lab_9994
      @code_lab_9994  11 годин тому

      @@samuelnarciso9110 can you write in English

  • @blogvlogadvertising4976
    @blogvlogadvertising4976 3 місяці тому +3

    Keep up the good good work, Thank you

    • @code_lab_9994
      @code_lab_9994  3 місяці тому

      @@blogvlogadvertising4976 Thanks so much for watching 👍

  • @nishargakabir745
    @nishargakabir745 Місяць тому +2

    😍Thanks its working for the nextjs app router 😍

    • @code_lab_9994
      @code_lab_9994  Місяць тому +1

      Thank you for watching.

    • @thomasiboniventure8969
      @thomasiboniventure8969 Місяць тому +1

      hellow

    • @thomasiboniventure8969
      @thomasiboniventure8969 Місяць тому +1

      i have a problem please help me in deploying next js app router in cpanel with middleware and dynamic routing am stack all over the week

    • @nishargakabir745
      @nishargakabir745 Місяць тому

      @@thomasiboniventure8969 which type of issue you face?

    • @nishargakabir745
      @nishargakabir745 Місяць тому

      @@thomasiboniventure8969 which type of issues you face?

  • @olujobifolaranmi2133
    @olujobifolaranmi2133 3 місяці тому +1

    Thank you for this tutorial, it's very straightforward 👍

    • @code_lab_9994
      @code_lab_9994  3 місяці тому

      ​@@olujobifolaranmi2133 Thanks so much for watching and for your kind words! Glad you found the tutorial helpful. 😊

  • @abhik9077
    @abhik9077 27 днів тому +2

    i am having an issue using a shared server but my dynamic routing is not working giving me internal error 500

  • @Samlama8848
    @Samlama8848 2 місяці тому +1

    This is good, thanks for sharing

    • @code_lab_9994
      @code_lab_9994  2 місяці тому

      @@Samlama8848 Thanks for watching 👍

  • @gabrielobafisile2299
    @gabrielobafisile2299 2 місяці тому +3

    Thank you but in my case the .next folder isn't showing after upload

    • @code_lab_9994
      @code_lab_9994  2 місяці тому

      @@gabrielobafisile2299 click on setting icon in project folder in cpanel and click on "show hidden files". Make sure to subscribe my chnnel

  • @lalamax3d
    @lalamax3d 2 місяці тому +2

    thanks, if my application is using prisma and conencting to mysql (localhost) if i create db in cpanel and set values in .env, will it work ?? and connect to mysql in server?? right?

    • @code_lab_9994
      @code_lab_9994  2 місяці тому

      @@lalamax3d yes it will work. On cpanel already mysql database runs on localhost.

    • @lemongautam6171
      @lemongautam6171 Місяць тому

      Did you deploy your bro? I have same configuration but I am having problem deploying to cpanel

    • @lalamax3d
      @lalamax3d Місяць тому

      @@lemongautam6171 I bought shared cpanel host on NC, going to try in coming week

    • @thomasiboniventure8969
      @thomasiboniventure8969 Місяць тому

      @@lemongautam6171 hello

  • @BiniyamYoseph-t7j
    @BiniyamYoseph-t7j 3 місяці тому +1

    grate video can u show us how to connect to pgsql database as well

    • @code_lab_9994
      @code_lab_9994  3 місяці тому

      Thanks for watching. I will make tutorial on that soon.

  • @manishbhusal-fq2vv
    @manishbhusal-fq2vv 3 місяці тому +1

    my project in next js TS tailwinds, I do same steps but show 503 error.

    • @code_lab_9994
      @code_lab_9994  3 місяці тому

      @@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

  • @manishgupta7181
    @manishgupta7181 3 місяці тому +2

    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  3 місяці тому

      @@manishgupta7181 I also have tutorial on that goto my channel and you will find deploy static html export on cpanel

  • @thomasiboniventure8969
    @thomasiboniventure8969 Місяць тому

    i have a problem please help me in deploying next js app router in cpanel with middleware and dynamic routing am stack all over the week

  • @jonreylumayag9856
    @jonreylumayag9856 Місяць тому +1

    Does it work in TypeScript?

    • @code_lab_9994
      @code_lab_9994  Місяць тому

      Yes it works.

    • @jonreylumayag9856
      @jonreylumayag9856 Місяць тому

      @@code_lab_9994 Im using App Router. Should i move the server.js inside the src/app?

    • @jonreylumayag9856
      @jonreylumayag9856 Місяць тому

      Having problems with app router in next. Some files are not found.

    • @code_lab_9994
      @code_lab_9994  Місяць тому

      @@jonreylumayag9856 when it occurred? Are you following the process in tutorial properly. Because it is works same as for both app router or page router

    • @jonreylumayag9856
      @jonreylumayag9856 Місяць тому

      @@code_lab_9994 This is one of the errors. "webpack-10c40cd540426986.js Not found"

  • @robiulhasan1028
    @robiulhasan1028 3 місяці тому +1

    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  3 місяці тому

      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 3 місяці тому

      @@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 3 місяці тому

      @@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.

  • @maneeshsingh3038
    @maneeshsingh3038 3 місяці тому +1

    Does this work on app router as well?
    I am getting error as i am using app router

    • @code_lab_9994
      @code_lab_9994  3 місяці тому

      Deployment is same for both.

    • @maneeshsingh3038
      @maneeshsingh3038 2 місяці тому

      ​@@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 2 місяці тому

      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  2 місяці тому

      @@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

  • @abdullahzafar4401
    @abdullahzafar4401 2 місяці тому +1

    Is it the same using app router ?

    • @code_lab_9994
      @code_lab_9994  2 місяці тому

      @@abdullahzafar4401 yes it will also work. If you face any issue tell me in comment.

    • @abdullahzafar4401
      @abdullahzafar4401 2 місяці тому

      @@code_lab_9994

  • @LanaGames.
    @LanaGames. 3 місяці тому +1

    what's your package json

    • @code_lab_9994
      @code_lab_9994  3 місяці тому

      Your script part must contian this in package.json
      "dev": "node server.js",
      "build": "next build",
      "start": "NODE_ENV=production node server.js"

  • @LanaGames.
    @LanaGames. 3 місяці тому +1

    can you upload you github?

    • @code_lab_9994
      @code_lab_9994  2 місяці тому

      In video description i have written the package.json scripts part that you needed. I will also put github link later.