StarDomain

Running Node.js or Python Applications

Running Node.js or Python Applications

Deploy Node.js or Python apps on your hosting account.

cPanel — Node.js

  1. Go to Setup Node.js App in cPanel
  2. Click Create Application
  3. Select Node.js version
  4. Set the application root (e.g., myapp)
  5. Set the application URL
  6. Set the startup file (e.g., app.js)
  7. Click Create

Installing Dependencies

After creating the app:

  1. Click Run NPM Install in the cPanel interface
  2. Or via SSH: enter the virtual environment and run npm install

cPanel — Python

  1. Go to Setup Python App in cPanel
  2. Click Create Application
  3. Select Python version
  4. Set the application root and startup file
  5. Click Create

Installing Packages

  1. Use the Add Package button in the cPanel interface
  2. Or via SSH: activate the virtual environment and run pip install -r requirements.txt

Environment Variables

Set environment variables in the cPanel app configuration. Common ones:

  • NODE_ENV=production
  • PORT=3000
  • DATABASE_URL=...

Troubleshooting

  • App not starting: Check startup file path and logs
  • Module not found: Run npm install or pip install
  • Port conflict: Use the port assigned by cPanel, not a hardcoded one
  • Static files not loading: Configure Apache to proxy correctly