Build and deploy Next js app on cpanel | Host react js, node js, next js website on cpanel

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 178

  • @joshuaolusayo
    @joshuaolusayo 2 года назад +8

    A one month problem get solved by watching your video. We are launching tomorrow and you just saved me. Thanks.

    • @codesermon
      @codesermon  2 года назад +1

      Welcome. Don't forget to subscribe for more awesome videos like this. Also share the video with your friends. Thanks

    • @luckypius132
      @luckypius132 2 года назад +1

      I found you here. Fantabulous 😅

    • @joshuaolusayo
      @joshuaolusayo 2 года назад

      @@luckypius132 Very very fantabulous 😂

  • @preciousnwaoha3123
    @preciousnwaoha3123 2 года назад +8

    This is an underated channel.
    Clean clear explaination

  • @abdurahimnegussie3850
    @abdurahimnegussie3850 Год назад

    This is the most clear and precise step on subject. Thank you.

  • @thomaszawist3002
    @thomaszawist3002 2 года назад +1

    I'm thrilled! Thanks for your support!!

  • @brbslythering
    @brbslythering Месяц назад

    Hi, thank you so much for this video, it was extremely clear and concise and I learnt a lot. One thing I couldn't quite hear properly from the video is why you deleted package.json-can you please explain why here?

    • @codesermon
      @codesermon  Месяц назад

      @@brbslythering you can choose to leave it but if someone has access to that file, they easily exploit your application. It's optional though

    • @brbslythering
      @brbslythering Месяц назад

      @@codesermon I see, gotcha! I have another question. Do you by any chance know how I can view server logs of the deployed application? I keep getting 503 even though the built application runs fine locally. I've checked that the node version is correct too so I am curious what is breaking.

  • @joyrsg
    @joyrsg 2 года назад

    You are my Savior !!! Thank you so much for making our life easy.

    • @codesermon
      @codesermon  2 года назад +1

      You're welcome Sir. Do me, a favour and subscribe to my channel for more awesome tutorial

  • @carlyliczyk
    @carlyliczyk Год назад

    Such a lifesaver! Thank you for your detailed documentation

    • @codesermon
      @codesermon  Год назад +1

      I'm you found it helpful... All the best

  • @elkhanhamet2561
    @elkhanhamet2561 Год назад

    Thank you very much Sir!!! Incredibly helpful tutorial. Thanks again and Happy holidays!!!

  • @hadiswaleh5304
    @hadiswaleh5304 Год назад

    Thankyou for the detail information
    followed all the steps but showing internal server error message from server.js

  • @Filip-bp6lu
    @Filip-bp6lu 2 года назад

    Does it load fast with pre rendering as with vercel? Not sure if it is because of your bandwidth but seemed to me that it's loading to long on first render. Great video btw.

    • @codesermon
      @codesermon  2 года назад +1

      It loads faster. It was my laptop that was lagging.

  • @MuhammadRizky-ub3oy
    @MuhammadRizky-ub3oy Год назад +1

    i get error 500, internal server error. can you help sir?

  • @robiulhasan1028
    @robiulhasan1028 2 месяца назад

    brother, middleware not working on this way. can you help me on this?

  • @JoeMonye
    @JoeMonye 2 года назад +1

    Thanks a lot. Your tutorial is straight to the point. However, can you make another tutorial that explains how I can host a dynamic Next js Application with API (need node js) on cpanel. Thanks.

    • @codesermon
      @codesermon  2 года назад

      Alright

    • @codingjunk
      @codingjunk Год назад

      @@codesermon bro how to host dynamic next js application

    • @codesermon
      @codesermon  Год назад +1

      @@codingjunk you can watch this one ruclips.net/video/KUBADQ3qhmE/видео.html

  • @godspowerchimezie2352
    @godspowerchimezie2352 Год назад

    Very helpful!
    Keep it up brother

  • @azeezabidoye1188
    @azeezabidoye1188 2 года назад

    Hey dude! You are a problem solver. Kudos! 👍👍

  • @kentay4460
    @kentay4460 2 года назад +3

    Hello, I reproduced every step but when I try I get a 500 internal server error or sometimes I also got a "We're sorry, but something went wrong." message. Only differences are that I am trying to host it on a subdomain and I have SSR, don't know if it can be related. If someone had this issue, please let me know how you solved it.

    • @codesermon
      @codesermon  2 года назад +1

      Check the solution proposed by Felipe R in the comment section below and follow his solution. It's should work for you. If it doesn't, try it on a subdomain and see

    • @GersonSilva-cm5ow
      @GersonSilva-cm5ow Год назад

      Estou com o mesmo problema, como solucionou ?

  • @manasc80
    @manasc80 6 месяцев назад

    I'm getting "Too many redirects" error. I have hosted the Next.js app on a sub directory. Please advise.

  • @XyianSoftware
    @XyianSoftware 8 месяцев назад

    could you make an updated version of this using next.js 14+?

  • @Fabianazka
    @Fabianazka 11 месяцев назад

    How do I bring up the Node.js software on cPanel?

  • @vihigacountyreferralhospit2656
    @vihigacountyreferralhospit2656 2 года назад +1

    does this method of deployment have optimization advantages from next js?

    • @codesermon
      @codesermon  2 года назад

      Yes Sir. Nothing changes

  • @NASATech_Vision
    @NASATech_Vision 11 месяцев назад

    my backend is on digital ocean can i run my frontend on blue ocean cpanel?

  • @klickerxlab4321
    @klickerxlab4321 2 года назад +1

    Thanks for the video, bro. Can I follow the same process on centos 7 on CWP?

    • @codesermon
      @codesermon  2 года назад +1

      Provided it supports node js. It will work

    • @klickerxlab4321
      @klickerxlab4321 2 года назад +1

      @@codesermon Thanks for your response

  • @avinmangukiya
    @avinmangukiya Год назад +2

    I have not index.js file and my page start on localhost:3000/webapp then how can i deploy in cpanel using server.js file ? and also can we deploy using terminal because in my cpanel Setup node.js app Software not available ?

    • @codesermon
      @codesermon  Год назад +1

      Upload files to domain directory with a subdirectory webapp. When you go the Nodejs homepage to create your node app on cpanel, specify the directory as my.domain.com/webapp as the app directory. This will configure the app in the subdirectory for you.

    • @avinmangukiya
      @avinmangukiya Год назад

      @@codesermon I can build with npm run build command. then there is .next folder create. am i right ? after i have to add .next folder in cPanel in my root file. then how can i deploy with terminal ? bcz i have not setUp Node.js App software in Software Section. please reply i am stuck last 2 weeks.

    • @avinmangukiya
      @avinmangukiya Год назад

      @@codesermon Thank for your reply

  • @EdutionsLiveClass
    @EdutionsLiveClass Год назад

    please help me this error :
    Build error : The global thread pool has not been initialized.: ThreadPoolBuildError { kind: GlobalPoolAlreadyInitialized } next js error

  • @alexkey9372
    @alexkey9372 Год назад

    Works with nextjs12, Seems not to work with nextjs 13 says some stream module is missing or something?

  • @Nevilwin
    @Nevilwin 2 года назад +1

    I love the video you explained everything well

  • @cikplays7375
    @cikplays7375 2 года назад +1

    is there any way to view the nodejs app's terminal and see if i have errors or info similar to a local run dev

    • @codesermon
      @codesermon  2 года назад +1

      Yes. Check this path var/log/apache2/error_log in your file manager or ask the support of your hosting company

  • @thomaszawist3002
    @thomaszawist3002 2 года назад

    Not sure if it helps, but the "RUNJS" button to do run the build script throws a wasm error as well as Cpanel's web console does. You can overcome this, however, by logging into your hosting cpanel server through ssh.

  • @Nothing-cx4jt
    @Nothing-cx4jt 2 года назад

    Excellent tutorial. Thanks.

  • @zamanms396
    @zamanms396 2 года назад

    You have done very good job. Thanks a lot!

  • @preciousnwaoha3123
    @preciousnwaoha3123 2 года назад +2

    Hello, I don't seem to have the "Setup Node.js App" Option in my Softwares

    • @codesermon
      @codesermon  2 года назад +1

      Sorry, if you don't have it, it means you need to upgrade your hosting package to higher version. Shared hosting business package can do the magic for you.

    • @williambenarto6212
      @williambenarto6212 2 года назад +1

      @@codesermon So i tried purchasing a higher package version and sitll dont have the option for node js. Can you guide me where to find the right package? I am using hostgator.

    • @codesermon
      @codesermon  2 года назад

      @@williambenarto6212 www.namecheap.com/hosting/shared/?gclid=Cj0KCQjwyOuYBhCGARIsAIdGQROMuXeRUOthRUk6fLzpBhrxujU3K2gcLTUoTvZ-bGiSqDYsoNbh49IaAou7EALw_wcB
      Use stellar business plan

  • @streaming-pro
    @streaming-pro Год назад

    I haver Error 503. Service Unavailable. Can you help me?

  • @therevealmusic
    @therevealmusic Месяц назад

    can we deploy an api ,doing server-side things in cpanel

  • @jepqmw
    @jepqmw 11 месяцев назад

    will API work there?

  • @olusojidaramola1429
    @olusojidaramola1429 2 года назад +1

    I was following the tutorial but I couldn't see the Set Up Nodejs app in my cPanel under software. Any help?

    • @codesermon
      @codesermon  2 года назад +1

      Yes.. The reason is the hosting package you're using doesn't have that feature and you will have to upgrade to shared hosting package or higher package. Not all hosting packages that support Nodejs apps

    • @olusojidaramola1429
      @olusojidaramola1429 2 года назад +1

      Thanks for the prompt response

  • @tekebethelson443
    @tekebethelson443 2 года назад +1

    Super great!!! Kudos!

  • @gracemurigi1124
    @gracemurigi1124 Год назад +1

    Thank you for this!

  • @fbnoanonymo7114
    @fbnoanonymo7114 2 года назад

    Great tutorial! Thank you so much

  • @clementcrn
    @clementcrn Год назад

    Thank you sir, you saved my day

  • @Quicknuggets
    @Quicknuggets 2 года назад

    Would this work with Server side rendered pages also ? say.. i was pulling information from a database or some api

  • @15h4f
    @15h4f Год назад

    i want to use ISR inside my namcheap shared hosting. can i do that?

  • @Arthur-fq5dd
    @Arthur-fq5dd 2 года назад +1

    For my part, I had an error and it loaded a long time before getting an error message: We're sorry, but something went wrong. By paying attention to the step in the video I realized that I had selected the wrong version of nodejs, be careful with the version selected by default (10.24.1 in my case) it did not work. You have to use version 14.18.3 as in the video. I hope this will unlock some. Thanks for the video !

    • @codesermon
      @codesermon  2 года назад

      Glad you found this video helpful and kudos for proffering solution to your problem.

  • @fabianhabilramdhan562
    @fabianhabilramdhan562 2 года назад +2

    hello, i followed you exact the same things, but i get 503 error. know how to solve this?

    • @codesermon
      @codesermon  2 года назад

      Are u using a domain or a subdomain?

    • @WEBDEVIndo
      @WEBDEVIndo 2 года назад +1

      @@codesermon I have same problem. I got 503 Service Unavailable. I am using domain and NPM run NPM Install successfully. any idea for this issue ?

    • @codesermon
      @codesermon  2 года назад

      @@WEBDEVIndo try it on a subdomain and see.
      Also, try adding "homepage": "your domain" in the package.json file and see.

    • @WEBDEVIndo
      @WEBDEVIndo 2 года назад

      @@codesermon it's working on sub domain

    • @codesermon
      @codesermon  2 года назад

      @@WEBDEVIndo glad it worked.

  • @Tibeb
    @Tibeb 2 года назад

    will it work if we used server side rendering for data fetching?

    • @codesermon
      @codesermon  2 года назад

      Yes it will work perfectly.
      Checkout this blog post to learn more dev.to/techfortified/how-to-host-nextjs-website-on-cpanel-2dij

  • @gbolaboaluko5576
    @gbolaboaluko5576 2 года назад

    Hello does this work with Mongo Db atlas, and is there any additional configurations for Api endpoints

    • @codesermon
      @codesermon  2 года назад

      Yes. You can use any database or service. It doesn't change anything.

  • @joaovitorcorrea06
    @joaovitorcorrea06 Год назад

    i dont have the Setup Node.js App, how can i find or install?

    • @codesermon
      @codesermon  Год назад

      Buy namecheap business shared hosting plan or ask your hosting provider support for how to upgrade

  • @LeandroSantiagoB
    @LeandroSantiagoB 3 месяца назад

    thanks, works execellent

  • @georgeebisike
    @georgeebisike 2 года назад

    Thanks bro... This saved me today

    • @codesermon
      @codesermon  2 года назад

      Welcome. Don't forget to subscribe to my channel. :)

  • @codingjunk
    @codingjunk Год назад +1

    I cannot found build folder after npm run build and files are not zipping

    • @codesermon
      @codesermon  Год назад

      watch this ruclips.net/video/KUBADQ3qhmE/видео.html

    • @codingjunk
      @codingjunk Год назад

      @@codesermon thanks I have done it

    • @codingjunk
      @codingjunk Год назад

      @@codesermon bro I am using WordPress as a headless CMS but the content is not showing on my website when I add new posts

    • @codesermon
      @codesermon  Год назад +1

      @@codingjunk check your API configuration. What errors are you receiveing? have your enabled cors?

    • @codingjunk
      @codingjunk Год назад

      @@codesermon working fine on a localhost, but when I build it and upload on cpanel posts are not updating

  • @jhonier1602
    @jhonier1602 2 года назад +1

    We're sorry, but something went wrong.
    The issue has been logged for investigation. Please try again later.
    error

    • @codesermon
      @codesermon  2 года назад

      Where in the app state have you encountered that??

    • @jhonier1602
      @jhonier1602 2 года назад +1

      @@codesermon start app node js cpanel, url direction

    • @codesermon
      @codesermon  2 года назад

      Have you installed your dependencies just the way it appeared in the video? Ensure you're starting your server config with an empty directory to avoid conflicts. You can create new subdomain and try again with new directory.

    • @jhonier1602
      @jhonier1602 2 года назад

      @@codesermon I deploy with vercel, my Api laravel on cPanel, my front is good, but Api error console fetch (401 (Unauthorized)) pls :((((

    • @codesermon
      @codesermon  2 года назад

      That should come from your authentication service. Ensure your front-end is well connected with your server API by ensuring your configure the necessary cors

  • @hadesinferno813
    @hadesinferno813 2 года назад

    where did you get the server.js code

    • @codesermon
      @codesermon  2 года назад

      Rewatch the video again. I explained everything there

  • @mas.angkasa27
    @mas.angkasa27 2 года назад

    Great tutorial! thanks

  • @treescoco7065
    @treescoco7065 2 года назад +1

    my page still show under construction.. after start the app

    • @codesermon
      @codesermon  2 года назад

      Check this comment section to find possible solution

    • @cikplays7375
      @cikplays7375 2 года назад +1

      navigate to you public_html folder and delete the index.html folder there and reload it should work

  • @alvin59
    @alvin59 2 года назад +1

    hello, do you know how to deploy this with tailwind CSS? I just followed your tutorial and it worked, but the CSS didn't working. Could you help me, please?
    The error shows Refused to apply style from '/_next/static/css/d6c9c8bf75352fff.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

    • @codesermon
      @codesermon  2 года назад

      I will make a demo version and see if I can find a solution for you. That would be during the weekend.

    • @GeniusHawlah
      @GeniusHawlah 2 года назад

      Did you later get it to work with Tailwind CSS?

    • @alvin59
      @alvin59 2 года назад

      @@GeniusHawlah Yeah, I did. I also used Tailwind CSS at this project. Do you have any solution?

    • @anth0ni33
      @anth0ni33 2 года назад

      @@codesermon g

    • @codesermon
      @codesermon  2 года назад

      I will release a video on it this week. Stay tuned.

  • @hadesinferno813
    @hadesinferno813 2 года назад

    can you do a video on how to host react js app this same way

    • @codesermon
      @codesermon  2 года назад

      Here's the link ruclips.net/video/F0ORxJWZ_D8/видео.html

  • @алексейжучков-я8и

    thanks a lot for this video!

  • @inversionesmaxrodochoa2549
    @inversionesmaxrodochoa2549 2 года назад

    I followed all these steps but I obtain error 503...Please help me...

    • @codesermon
      @codesermon  2 года назад

      Check your Nodejs version and ensure it matches the production version

  • @kaoutarjarmouni6258
    @kaoutarjarmouni6258 2 года назад

    Hello, I followed the tutorial but I got error 503 service unavailable. I am using a sub-domain so I don't know where the problem is. the application is working on my local

    • @supakonnectinc
      @supakonnectinc 2 года назад

      Change the "basePath" in next.config.js to point to the folder of your application. Ex: "/folder/myapp".
      Try this and see

    • @kaoutarjarmouni6258
      @kaoutarjarmouni6258 2 года назад

      @@supakonnectinc I tried it but it didn't work

    • @kaoutarjarmouni6258
      @kaoutarjarmouni6258 2 года назад

      @@supakonnectinc it does give 500 internal server error

    • @supakonnectinc
      @supakonnectinc 2 года назад

      Edit your package.json and add homepage key and value as the the URL of your site e.g
      "homepage": "yourdomain". And see

    • @codesermon
      @codesermon  2 года назад

      hope your issue was resolved

  • @soroushsalehi9498
    @soroushsalehi9498 2 года назад +1

    thanks

  • @MilanDrazic
    @MilanDrazic 2 года назад

    where is buid folder. For me is not in public. I have .next???

    • @codesermon
      @codesermon  2 года назад

      just copy everything in your project directory excluding node_modules

    • @MilanDrazic
      @MilanDrazic 2 года назад

      @@codesermon ок I got it.
      I don't know why need to delete .next everytime from GitHub and from cpanel. Otherwise it will not commit to cpanel.
      Can you show how to automatic with yaml?

    • @codesermon
      @codesermon  2 года назад

      @@MilanDrazic do not push .next to GitHub. Exclude it by specifying it in gitignore file. With this it will always be updated.

    • @MilanDrazic
      @MilanDrazic 2 года назад

      @@codesermon then how to build app?

    • @codesermon
      @codesermon  2 года назад +1

      @@MilanDrazic just deploy it and ensure you install the packages and everything will still work. You don't need to run npm run build

  • @leonardosuarez7359
    @leonardosuarez7359 2 года назад

    muchas gracias, pude resolver

  • @RealSquabbit
    @RealSquabbit 2 года назад

    After following this I get "example.net" redirected you too many times error. Does anybody know why?

    • @codesermon
      @codesermon  2 года назад

      Did you host the site on your main domain?

    • @feliper.h.6863
      @feliper.h.6863 2 года назад

      me too

    • @codesermon
      @codesermon  2 года назад

      Create a subdomain and try again

    • @feliper.h.6863
      @feliper.h.6863 2 года назад

      I changed the "basePath" in next.config.js to pointer to the folder of my application and worked. Ex: "/folder/myapp".
      And Thanks for the video.

    • @feliper.h.6863
      @feliper.h.6863 2 года назад

      Font: nextjs.org/docs/api-reference/next.config.js/basepath

  • @golalislive
    @golalislive 2 года назад

    working on https but not on http

    • @codesermon
      @codesermon  2 года назад

      What do you mean?

    • @golalislive
      @golalislive 2 года назад

      @TechFortified I mean when i am in http it shows its working and in https it show the website

    • @codesermon
      @codesermon  2 года назад

      You mean works locally but not remotely?

  • @mealigholi
    @mealigholi 2 года назад

    Hi i have error 503

    • @codesermon
      @codesermon  2 года назад

      Check comment section and you will see the suggested solution

  • @Nevilwin
    @Nevilwin 2 года назад

    I am getting a 503 error

    • @codesermon
      @codesermon  2 года назад +1

      Can you repeat the process again?? Have you installed the dependencies?

    • @Nevilwin
      @Nevilwin 2 года назад +1

      @@codesermon yes I have I am now installing it on a sub domain

    • @codesermon
      @codesermon  2 года назад

      I hope all's working now right?

  • @maurocastro5181
    @maurocastro5181 2 месяца назад

    hijo de la chingada te amo!

  • @soumyaranjan6941
    @soumyaranjan6941 5 месяцев назад

    Hi Sir ,
    Need a help from you regrading deployment of nextjs in a shared server in cpanel ,
    As currently stuck by an issue when trying to run npm start
    This is issue i am getting, please help me out
    node:internal/deps/undici/undici:9235
    return await WebAssembly.instantiate(mod, {
    ^
    RangeError: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance
    at lazyllhttp (node:internal/deps/undici/undici:9235:32)
    Node.js v19.9.0

    • @codesermon
      @codesermon  5 месяцев назад

      check if both your dev and remote node versions are the same. If not the same, ensure remote version is higher than dev version

    • @soumyaranjan6941
      @soumyaranjan6941 5 месяцев назад

      @@codesermon
      Thanks for replying.
      I tried with maintaining save version in dev and remote. But the issue is still persist.
      And it's specific for Nextjs, when I tried to run a simple node js server it's running smoothly.

    • @soumyaranjan6941
      @soumyaranjan6941 5 месяцев назад

      Could you make a video on how to deploy a nextjs app in cpanel shared server and if anyone stuck with this kind of issue how to overcome?

  • @akaamosfrancoisaka6236
    @akaamosfrancoisaka6236 2 года назад

    thank thank thank thank thank thank

  • @youcefkettar7693
    @youcefkettar7693 2 года назад

    - my web site is get :
    Failed to load resource: the server responded with a status of 503 () favicon.ico:1
    what to do ?

    • @codesermon
      @codesermon  2 года назад

      Ensure your local nodejs version matches your remote nodejs version and try again

  • @lebaf8661
    @lebaf8661 11 месяцев назад

    Someone gets a 503 error on the server.How do I solve this?

    • @codesermon
      @codesermon  11 месяцев назад +1

      Ensure both your Dev node version is the same with the remote(server) node version.... Also check if the libraries used in the projects are compatible with the node versions

    • @lebaf8661
      @lebaf8661 11 месяцев назад

      @@codesermonI read that on stackoverflow, but on my notebook I work with node version 20.9.0 and the version of node on the server that I chose was the same, 20.9.0. .If I find the solution I will tell you about it here, if you can think of something that could be, I would appreciate any comment or idea of what it could be. Thanks for your quick response.

    • @codesermon
      @codesermon  11 месяцев назад +1

      @@lebaf8661 It seems version 20 doesn't work well. Either upgrade to 21 or 18

    • @lebaf8661
      @lebaf8661 11 месяцев назад

      @@codesermon What would be the requirements of a server to run a project in nextjs?. First of all, Thanks

    • @codesermon
      @codesermon  11 месяцев назад +1

      @@lebaf8661 it depends on the nextjs version that you're using... if you're using next 14 app router, nodejs version 21 is recommended.

  • @TurpoChargedGaming
    @TurpoChargedGaming Год назад

    I get the error: "specified directory already used by /home/olivertu/OT_Portfolio"
    Any advice??

    • @codesermon
      @codesermon  Год назад

      Try another directory

    • @TurpoChargedGaming
      @TurpoChargedGaming Год назад

      @@codesermon turns out you need to create the app before uploading your files. Did that, and now I get nothing showing online. Can't quite work this out