Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6875131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:16:57+00:00 2026-05-27T04:16:57+00:00

I have just gotten a VPS to bring my first node.js project online, but

  • 0

I have just gotten a VPS to bring my first node.js project online, but I am wondering where do I place the node files like app.js if I want it to be accessible at http://www.mywebsite.com:3000?

Right now, to host a website, I am using WHM to create a cPanel account, which creates /home/cpanelusername and my HTML/PHP files all go into /home/cpanelusername/public_html. Where does node.js files go to? Or did I get this step wrong as well?

On my Mac where I developed the node app, I simply cd into the directory containing the node file and run node app.js

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:16:58+00:00Added an answer on May 27, 2026 at 4:16 am

    You have to execute app.js file using the node binary, just like you do in local development. That means that you should probably make that execution a service call, the details of which depend on your linux distro. If it’s not a service call, then executing it in ssh will mean that the app stops working once you log out of ssh.

    For example, in Ubuntu server (which I use) I have an Upstart script which automatically runs my node.js app automatically on system start and log to /var/log. An example of the file, named /etc/init/myapp.js.conf is:

    description "myapp server"
    author      "Me"
    
    # used to be: start on startup
    # until we found some mounts weren't ready yet while booting:
    start on started mountall
    stop on shutdown
    
    script
        # We found $HOME is needed. Without it we ran into problems
        export HOME="/root"
    
        exec node /home/me/myapp/myapp.js 2>&1 >> /var/log/myapp.log
    end script
    

    Replace names, etc. as necessary.

    Edit to add: You can then start and stop your service by running:
    sudo start myapp.js or sudo stop myapp.js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been doing simple multi-threading in VB.NET for a while, and have just gotten
I have just installed C# for the first time, and at first glance it
We have just gotten TFS 2010 up and running. We will be migrating our
I'm learning Ruby and have just gotten into some stuff about arrays and ranges.
I am new to Xcode and have just gotten to the point where I
I'm having a great time learning Python, but I've just gotten a bit stuck
I have just gotten Visual Studio 2010 Pro Academic Version today with the MSDN
I have just gotten an email (20th Feb) from the Apple developer portal saying
I have just started with the new graph api for facebook. I have gotten
I'm following the MVC Music Store tutorial, but I've just gotten a bit stuck

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.