Looking for current product documentation?
Important operational guides are being maintained in the new documentation library.
Browse Docs

Guide: How to Deploy Your First Node.js App on SVR4U

Guide: How to Deploy Your First Node.js App on SVR4U

Welcome to SERVEFORU HOST INTEGRATED! Our infrastructure is built to support modern web applications. Follow this step-by-step guide to get your Node.js application live in minutes.

Step 1: Create the Application Environment

  1. Log in to your cPanel account.

  2. Scroll down to the Software section and click on Setup Node.js App.

  3. Click the Create Application button.

  4. Fill in the following details:

    • Node.js Version: Select your preferred version (we recommend the latest LTS).

    • Application Mode: Choose Production (Development is only for debugging).

    • Application Root: Enter the folder name where your code will live (e.g., my_app).

    • Application URL: Select the domain and the path (leave the path blank to use the main domain).

    • Application Startup File: Usually app.js or index.js.

  5. Click Create.


Step 2: Upload Your Project Files

Now that the environment is ready, you need to add your code:

  1. Go back to the cPanel home and open File Manager.

  2. Navigate to the folder you named in the "Application Root" (e.g., /home/username/my_app).

  3. Upload your files. > Pro Tip: Do NOT upload the node_modules folder. It is much faster to upload just your package.json and let our server install the libraries for you.


Step 3: Install Dependencies (NPM Install)

  1. Go back to Setup Node.js App and click the Edit (pencil icon) next to your app.

  2. Scroll down to the Detected configuration files section.

  3. If you uploaded a package.json, you will see a button labeled Run NPM Install. Click it.

  4. Wait for the process to finish. This ensures all your libraries are installed correctly in our secure environment.


Step 4: Start and Test Your App

  1. At the top of the interface, click Restart to ensure all changes are applied.

  2. Click the Open button next to your Application URL.

  3. Congratulations! Your Node.js app is now live on the SVR4U network.


???? Advanced: Using the Terminal

For developers who prefer the command line, cPanel provides a virtual environment command.

  1. In the Setup Node.js App edit screen, you will see a command at the top starting with source /home/.../bin/activate.

  2. Copy this command.

  3. Open the Terminal in cPanel, paste the command, and hit enter.

  4. You are now inside your Node.js environment and can run npm, npx, or node commands directly!

Ha estat útil la resposta?

Articles Relacionats

Guide: How to Deploy a Ruby on Rails App

Guide: How to Deploy a Ruby on Rails App Deploying Ruby on SVR4U is simple. We use the Phusion...

Guide: How to Deploy a Python (Django/Flask) App

Guide: How to Deploy a Python (Django/Flask) App Our Python Selector allows you to run modern...

Domain and DNS Basics for Hosting Customers

This article explains a common domain or DNS task and what to verify before and after making...

How to Point a Domain to Your Hosting Service

A domain can be connected to your hosting account either by changing nameservers or by updating...

How to Change Nameservers at Your Registrar

This article explains a common domain or DNS task and what to verify before and after making...