1 Deploy Nodejs Server on cPanel - Shared Hosting 2023

Поделиться
HTML-код
  • Опубликовано: 3 дек 2022
  • Tutorial: How to Deploy Node.js backend server on cPanel
    In this example my backend listens on a port and connects to mongoDB
    www.a2hosting.com/refer/372175
    My apologies, RUclips doesn't allow code snippets : (
    In the subdomain folder :
    .htaccess
    *See video for code snippet, also available on A2 Hosting docs
    In the node.js app folder:
    .npmrc
    scripts-prepend-node-path=true
    From the terminal:
    cloudlinux-selector install-modules --json --interpreter nodejs --user yourusername --app-root yoursubdomainfolder
    source /home/yourusername/nodevenv/yoursubdomainfolder/14/bin/activate && cd /home/yourusername/yoursubdomainfolder
    npm run start
    cron job:
    *See video for code snippet
    Updating-killing the previous script:
    ps faux
    kill __________your process id number PID
    Backend project for testing: github.com/Peta-S/test-node-app
    My Portfolio: www.peta-stewart.com
    www.hashtag-metoo.com
    Best of luck with your own projects

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

  • @peta-stewart
    @peta-stewart  Час назад

    If "Setup nodejs App" not available on your cPanel, then check this second method for deploying ruclips.net/video/uxKTMHfpuwY/видео.html

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

    I was looking for a clear and concise tutorial on how to deploy a MERN stack app on cPanel, but I couldn’t find any until I stumbled upon your video. You are a lifesaver! 🙌 Thank you for explaining everything so well and providing all the necessary commands/scripts. You made my day! 😊

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

    I ve been stuck for almost 3 days this tutorial It felt like medicine appricciated

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

    Thank you!
    edit: My server was not serving my index.ejs on the home route ('/') && following your guide got my express server running + serving the files

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

    Please Upload more videos regarding MERN hosting, and increase video-length.

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

    Thanks 🌹🌹🌹

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

    Thanks a lot

  • @Backend.FrankGP
    @Backend.FrankGP 6 месяцев назад

    thankyou

  • @abujayed8999
    @abujayed8999 Месяц назад +1

    tnx, can you pls make another video of nodejs app postgress database.

    • @peta-stewart
      @peta-stewart  Месяц назад

      Can do... but I am working on playlist for "wed dev pathway"... so it will go on the end of the list (unless I get a bit more free time : )

  • @ahmedismail-gf1mq
    @ahmedismail-gf1mq 10 месяцев назад

    Hello thank you for this tutorial ,
    i have problem every things working fine except the file uploading with it's work fine when i run node js from the terminal "node index.js"
    but when i run the app from "Setup node js app" only the api with multi part not working .

    • @peta-stewart
      @peta-stewart  10 месяцев назад

      Did you go through this tutorial step by step. There seems to be some issues with regard to app module. This tutorial show the work arounds.

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

    I have a VPS hosting hosting, but why doesn't my hosting have a cPanel Login? login? If I want to add it, how do I do it? thanks!

    • @peta-stewart
      @peta-stewart  3 месяца назад

      Does your VPS hosting company provide cPanel? In a VPS you normally need purchase it. In the even you have purchased VPS with a cPanel account, then your hosting company may need to install the cPanel on your VPS first. After installation they provide you with a link to cPanel's WHM to login with your account password.

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

    I made a website using html,css, javascript for frontend and express nodejs for my backend and my storage using mongodb and store in AWS and run in local host,but I want to deploy my website so can you please help me how to upload and also how to add domain for my website

  • @Mark-ic4hl
    @Mark-ic4hl 11 месяцев назад

    Would it be possible for the nodejs app to handle file uploads and store the files in cpanel storage?

    • @peta-stewart
      @peta-stewart  10 месяцев назад

      You need to do that manually.

  • @tutoring-academy
    @tutoring-academy Год назад

    Hi, At @4:09 what is 14 in the command.
    Is this node version, because I am using 16 version

    • @peta-stewart
      @peta-stewart  Год назад +1

      Yes, 14 is the version number. You will use 16. (I'm slow to reply so you probably already figured it out : )

  • @user-lb6uz5yd4k
    @user-lb6uz5yd4k 8 месяцев назад +1

    i don't know how to say thank you to am full with joy i don't know how to start to show my gratitude to you but in all may Almighty God the father of our Lord Jesus Christ Increase your knowledge Amen

  • @zaighumhassan7398
    @zaighumhassan7398 2 дня назад

    I followed each step but when I test api from the postman it says "404 Not Found" ,I deployed nest js app

    • @peta-stewart
      @peta-stewart  2 дня назад

      First, check that your app is running. I check my backend routes while still in dev environment. And I haven't faced any issues deploying live. I have a link to test app in the comments if you need more troubleshooting.

  • @usamaaltaf2904
    @usamaaltaf2904 10 месяцев назад

    I can't see setup Node Js option on my Cpanel.
    How to enable it?

    • @peta-stewart
      @peta-stewart  10 месяцев назад +2

      You need to make sure that your provider supplies the module (if you are on a shared server). If you are on VPS you will need to install the module yourself.

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

    You didn't you create any MongoDB database here?
    I'm trying to host my mern stack project and I have a cPanel server which does not include MongoDB database as I see

    • @peta-stewart
      @peta-stewart  8 месяцев назад

      I used MongoDB Atlas which is hosted via AWS (They have a free tier) . As yet cPanel doesn't really support the paid version of MongoDB to be installed. I believe you can do it though.

    • @peta-stewart
      @peta-stewart  8 месяцев назад +1

      That was the reason I mentioned you need to make sure the port was open your mongoDB can connect.

  • @SaadKhan-yc7gp
    @SaadKhan-yc7gp Год назад

    You have used es6 module ?

    • @peta-stewart
      @peta-stewart  Год назад

      No, I am not sure if express has updated but it wasn't supported when I initially created the app.

  • @user-re9ee4oc3e
    @user-re9ee4oc3e Год назад

    Not installed by default and only vps host

    • @peta-stewart
      @peta-stewart  Год назад

      Some Shared Hosting hosts have the module installed. As mentioned in the video.

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

    terminal not showing in cpenal

    • @user-lb6uz5yd4k
      @user-lb6uz5yd4k 8 месяцев назад

      send ticket to your server support team to enable terminal for you

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

    I have an error: cannot connect to any cluster servers

    • @peta-stewart
      @peta-stewart  2 месяца назад

      Ok, you'll need to troubleshoot through it. Does you connection work from your local environment? Did you follow all the steps in the tutorial including requesting the port to be opened.

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

      ​@@peta-stewart I am using a shared CPanel 102.0.24 (i think)
      I already contact the tech and they say they can't open port so... it's a loss for me

  • @user-kr4ei3ix5m
    @user-kr4ei3ix5m 10 месяцев назад +2

    i have a vps server, in cpanel "Setup nodejs App" is not showing. What can i do?

    • @Yousafzai112
      @Yousafzai112 4 дня назад

      Same in mine also how to solve it?

    • @user-kr4ei3ix5m
      @user-kr4ei3ix5m 3 дня назад

      @@Yousafzai112 In my case, I switched the hosting service which I used didnt support in-built node js setup.

    • @programmingwithafaq3282
      @programmingwithafaq3282 2 дня назад

      ​@@user-kr4ei3ix5m Okay so i also need to change the hosting server or contact with the hosting provider to add the npm module.

    • @peta-stewart
      @peta-stewart  Час назад

      @programmingwithafaq3282 @Yousafzai112
      @user-kr4ei3ix5m I just uploaded another video with another method for deploying NODE app. See if your hosting has provided access for it. ruclips.net/video/uxKTMHfpuwY/видео.html

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

    Not fun!

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

    Can you help me with this solution Error: spawn app.js EACCES
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:19)

    • @peta-stewart
      @peta-stewart  8 месяцев назад

      Did you follow the steps in the video? At what point did you get the error?

    • @playbacktunes5521
      @playbacktunes5521 8 месяцев назад +1

      @@peta-stewart have solved the problem already. The problem was bcrypt but I change it to bcryptjs