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

Sdílet
Vložit
  • čas přidán 7. 02. 2022
  • In this video, I'm going to show you step by step tutorial on how to build and deploy your react next js application on cpanel using namcheap shared shared hosting package. Technologies used include; react js, next js, javascript, cpane, vscode, node js Stay tuned
    Want to buy me coffee?
    www.buymeacoffee.com/techfort...
  • Věda a technologie

Komentáře • 171

  • @preciousnwaoha3123
    @preciousnwaoha3123 Před 2 lety +8

    This is an underated channel.
    Clean clear explaination

  • @abdurahimnegussie3850
    @abdurahimnegussie3850 Před 8 měsíci

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

  • @joshuaolusayo
    @joshuaolusayo Před 2 lety +7

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

    • @codesermon
      @codesermon  Před 2 lety +1

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

    • @luckypius132
      @luckypius132 Před rokem +1

      I found you here. Fantabulous 😅

    • @joshuaolusayo
      @joshuaolusayo Před rokem

      @@luckypius132 Very very fantabulous 😂

  • @azeezabidoye1188
    @azeezabidoye1188 Před rokem

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

  • @Nothing-cx4jt
    @Nothing-cx4jt Před 2 lety

    Excellent tutorial. Thanks.

  • @zamanms396
    @zamanms396 Před rokem

    You have done very good job. Thanks a lot!

  • @carlyliczyk
    @carlyliczyk Před rokem

    Such a lifesaver! Thank you for your detailed documentation

    • @codesermon
      @codesermon  Před rokem +1

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

  • @fbnoanonymo7114
    @fbnoanonymo7114 Před 2 lety

    Great tutorial! Thank you so much

  • @Nevilwin
    @Nevilwin Před 2 lety +1

    I love the video you explained everything well

  • @thomaszawist3002
    @thomaszawist3002 Před rokem +1

    I'm thrilled! Thanks for your support!!

  • @godspowerchimezie2352
    @godspowerchimezie2352 Před 10 měsíci

    Very helpful!
    Keep it up brother

  • @elkhanhamet2561
    @elkhanhamet2561 Před rokem

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

  • @gracemurigi1124
    @gracemurigi1124 Před rokem +1

    Thank you for this!

  • @clementcrn
    @clementcrn Před rokem

    Thank you sir, you saved my day

  • @thomaszawist3002
    @thomaszawist3002 Před rokem

    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.

  • @Leandro_Santiago
    @Leandro_Santiago Před 4 dny

    thanks, works execellent

  • @joyrsg
    @joyrsg Před 2 lety

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

    • @codesermon
      @codesermon  Před 2 lety +1

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

  • @tekebethelson443
    @tekebethelson443 Před 2 lety +1

    Super great!!! Kudos!

  • @mas.angkasa27
    @mas.angkasa27 Před 2 lety

    Great tutorial! thanks

  • @NASATech_Vision
    @NASATech_Vision Před 7 měsíci

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

  • @alexkey9372
    @alexkey9372 Před rokem

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

  • @XyianSoftware
    @XyianSoftware Před 4 měsíci

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

  • @manasc80
    @manasc80 Před 3 měsíci

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

  • @Fabianazka
    @Fabianazka Před 8 měsíci

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

  • @georgeebisike
    @georgeebisike Před 2 lety

    Thanks bro... This saved me today

    • @codesermon
      @codesermon  Před 2 lety

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

  • @hadiswaleh5304
    @hadiswaleh5304 Před 11 měsíci

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

  • @user-dd4tm4yj9y
    @user-dd4tm4yj9y Před rokem

    thanks a lot for this video!

  • @user-hn7qs1xj6k
    @user-hn7qs1xj6k Před 10 měsíci

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

  • @MuhammadRizky-ub3oy
    @MuhammadRizky-ub3oy Před rokem +1

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

  • @streaming-pro
    @streaming-pro Před rokem

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

  • @jepqmw
    @jepqmw Před 8 měsíci

    will API work there?

  • @gbolaboaluko5576
    @gbolaboaluko5576 Před 2 lety

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

    • @codesermon
      @codesermon  Před 2 lety

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

  • @Quicknuggets
    @Quicknuggets Před 2 lety

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

  • @leonardosuarez7359
    @leonardosuarez7359 Před rokem

    muchas gracias, pude resolver

  • @JoeMonye
    @JoeMonye Před rokem +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  Před rokem

      Alright

    • @codingjunk
      @codingjunk Před rokem

      @@codesermon bro how to host dynamic next js application

    • @codesermon
      @codesermon  Před rokem +1

      @@codingjunk you can watch this one czcams.com/video/KUBADQ3qhmE/video.html

  • @Filip-bp6lu
    @Filip-bp6lu Před rokem

    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  Před rokem +1

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

  • @Tibeb
    @Tibeb Před 2 lety

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

    • @codesermon
      @codesermon  Před 2 lety

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

  • @cikplays7375
    @cikplays7375 Před 2 lety +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  Před 2 lety +1

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

  • @kentay4460
    @kentay4460 Před 2 lety +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  Před 2 lety +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 Před rokem

      Estou com o mesmo problema, como solucionou ?

  • @vihigacountyreferralhospit2656

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

  • @klickerxlab4321
    @klickerxlab4321 Před 2 lety +1

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

    • @codesermon
      @codesermon  Před 2 lety +1

      Provided it supports node js. It will work

    • @klickerxlab4321
      @klickerxlab4321 Před 2 lety +1

      @@codesermon Thanks for your response

  • @15h4f
    @15h4f Před rokem

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

  • @alvin59
    @alvin59 Před 2 lety +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  Před 2 lety

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

    • @GeniusHawlah
      @GeniusHawlah Před rokem

      Did you later get it to work with Tailwind CSS?

    • @alvin59
      @alvin59 Před rokem

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

    • @anth0ni33
      @anth0ni33 Před rokem

      @@codesermon g

    • @codesermon
      @codesermon  Před rokem

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

  • @joaovitorcorrea06
    @joaovitorcorrea06 Před rokem

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

    • @codesermon
      @codesermon  Před rokem

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

  • @preciousnwaoha3123
    @preciousnwaoha3123 Před 2 lety +2

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

    • @codesermon
      @codesermon  Před 2 lety +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 Před rokem +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  Před rokem

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

  • @olusojidaramola1429
    @olusojidaramola1429 Před 2 lety +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  Před 2 lety +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 Před 2 lety +1

      Thanks for the prompt response

  • @avinmangukiya
    @avinmangukiya Před rokem +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  Před rokem +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 Před rokem

      @@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 Před rokem

      @@codesermon Thank for your reply

  • @hadesinferno813
    @hadesinferno813 Před rokem

    where did you get the server.js code

    • @codesermon
      @codesermon  Před rokem

      Rewatch the video again. I explained everything there

  • @Arthur-fq5dd
    @Arthur-fq5dd Před 2 lety +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  Před 2 lety

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

  • @hadesinferno813
    @hadesinferno813 Před rokem

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

    • @codesermon
      @codesermon  Před rokem

      Here's the link czcams.com/video/F0ORxJWZ_D8/video.html

  • @soroushsalehi9498
    @soroushsalehi9498 Před 2 lety +1

    thanks

  • @fabianhabilramdhan562
    @fabianhabilramdhan562 Před 2 lety +2

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

    • @codesermon
      @codesermon  Před 2 lety

      Are u using a domain or a subdomain?

    • @WEBDEVIndo
      @WEBDEVIndo Před 2 lety +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  Před 2 lety

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

    • @WEBDEVIndo
      @WEBDEVIndo Před 2 lety

      @@codesermon it's working on sub domain

    • @codesermon
      @codesermon  Před 2 lety

      @@WEBDEVIndo glad it worked.

  • @kaoutarjarmouni6258
    @kaoutarjarmouni6258 Před 2 lety

    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 Před 2 lety

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

    • @kaoutarjarmouni6258
      @kaoutarjarmouni6258 Před 2 lety

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

    • @kaoutarjarmouni6258
      @kaoutarjarmouni6258 Před 2 lety

      @@supakonnectinc it does give 500 internal server error

    • @supakonnectinc
      @supakonnectinc Před 2 lety

      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  Před 2 lety

      hope your issue was resolved

  • @inversionesmaxrodochoa2549

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

    • @codesermon
      @codesermon  Před rokem

      Check your Nodejs version and ensure it matches the production version

  • @treescoco7065
    @treescoco7065 Před 2 lety +1

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

    • @codesermon
      @codesermon  Před 2 lety

      Check this comment section to find possible solution

    • @cikplays7375
      @cikplays7375 Před 2 lety +1

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

  • @codingjunk
    @codingjunk Před rokem +1

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

    • @codesermon
      @codesermon  Před rokem

      watch this czcams.com/video/KUBADQ3qhmE/video.html

    • @codingjunk
      @codingjunk Před rokem

      @@codesermon thanks I have done it

    • @codingjunk
      @codingjunk Před rokem

      @@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  Před rokem +1

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

    • @codingjunk
      @codingjunk Před rokem

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

  • @RealSquabbit
    @RealSquabbit Před 2 lety

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

    • @codesermon
      @codesermon  Před 2 lety

      Did you host the site on your main domain?

    • @feliper.h.6863
      @feliper.h.6863 Před 2 lety

      me too

    • @codesermon
      @codesermon  Před 2 lety

      Create a subdomain and try again

    • @feliper.h.6863
      @feliper.h.6863 Před 2 lety

      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 Před 2 lety

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

  • @lebaf8661
    @lebaf8661 Před 8 měsíci

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

    • @codesermon
      @codesermon  Před 8 měsíci +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 Před 8 měsíci

      @@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  Před 8 měsíci +1

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

    • @lebaf8661
      @lebaf8661 Před 8 měsíci

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

    • @codesermon
      @codesermon  Před 8 měsíci +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.

  • @MilanDrazic
    @MilanDrazic Před rokem

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

    • @codesermon
      @codesermon  Před rokem

      just copy everything in your project directory excluding node_modules

    • @MilanDrazic
      @MilanDrazic Před rokem

      @@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  Před rokem

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

    • @MilanDrazic
      @MilanDrazic Před rokem

      @@codesermon then how to build app?

    • @codesermon
      @codesermon  Před rokem +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

  • @mealigholi
    @mealigholi Před 2 lety

    Hi i have error 503

    • @codesermon
      @codesermon  Před 2 lety

      Check comment section and you will see the suggested solution

  • @jhonier1602
    @jhonier1602 Před 2 lety +1

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

    • @codesermon
      @codesermon  Před 2 lety

      Where in the app state have you encountered that??

    • @jhonier1602
      @jhonier1602 Před 2 lety +1

      @@codesermon start app node js cpanel, url direction

    • @codesermon
      @codesermon  Před 2 lety

      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 Před 2 lety

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

    • @codesermon
      @codesermon  Před 2 lety

      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

  • @Nevilwin
    @Nevilwin Před 2 lety

    I am getting a 503 error

    • @codesermon
      @codesermon  Před 2 lety +1

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

    • @Nevilwin
      @Nevilwin Před 2 lety +1

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

    • @codesermon
      @codesermon  Před 2 lety

      I hope all's working now right?

  • @golalislive
    @golalislive Před 2 lety

    working on https but not on http

    • @codesermon
      @codesermon  Před 2 lety

      What do you mean?

    • @golalislive
      @golalislive Před 2 lety

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

    • @codesermon
      @codesermon  Před 2 lety

      You mean works locally but not remotely?

  • @akaamosfrancoisaka6236

    thank thank thank thank thank thank

  • @TurpoChargedGaming
    @TurpoChargedGaming Před rokem

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

    • @codesermon
      @codesermon  Před rokem

      Try another directory

    • @TurpoChargedGaming
      @TurpoChargedGaming Před rokem

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

  • @soumyaranjan6941
    @soumyaranjan6941 Před 2 měsíci

    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  Před 2 měsíci

      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 Před 2 měsíci

      @@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 Před 2 měsíci

      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?

  • @youcefkettar7693
    @youcefkettar7693 Před rokem

    - 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  Před rokem

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