Giter Club home page Giter Club logo

hestiacp-nodejs-plugin's Introduction

HestiaCP add multiple NodeJS apps using QuickApp Installer.

You can add multiple websites to your HestiaCP using diferent ports to each one.

When you create create the app with the installer it automatically create:

  • /home/%USER%/%DOMAIN%/private/nodeapp directory
  • Config for nginx to use the selected port
  • ecosystem.config.js with the necessary command to connect pm2 and run your app Ex. npm run start
  • .nvmrc file with node version if you use NVM

How to install

  1. Install Node: (Using one of these options)

  2. Install PM2

  3. Clone this repository:

    cd ~/tmp
    git clone https://github.com/JLFdzDev/hestiacp-nodejs.git
    cd hestiacp-nodejs
  4. Use install.sh

    sudo chmod 755 install.sh
    sudo ./install.sh
  5. ๐Ÿš€ You are ready to install an App!!!

How to use

  1. Create new user (If you have one no need to create)

  2. User needs bash access for app to work, go to User edit > advanced options > SSH Access > bash

  3. Add new web (Ex. acme.com)

  4. Go to edit this new web and go to Quick Install App

  5. Select NodeJS

    • Node Version: If you manage node with nvm, it put a `.nvmrc file in root of nodeapp with selected version. If you installed node without nvm you can remove this file.

    • Start Script: It creates a ecosystem.config.js file in root of nodeapp with the script that you fill (it should be the one you have in your package.json) for PM2 can manage the app.

    • Port: You can manage multiple apps with different ports, put different port for each app you have (Ex. 3000). It creates .env file in root of nodeapp with the selected port, if your app don't use this .env file you can remove.

    • PHP Version: This is only for HestiaCP you can put any value (NOT IMPORTANT)

  6. Go to Edit web > Advanced Options > Proxy Template > NodeJS

  7. Upload your app with filemanager, clone with git... in /home/<user>/<domain.com>/private/nodeapp

  8. ๐ŸŽ‰ Congratulations you're done!!!

  9. Save PM2 & Run Forever

    sudo pm2 save
    sudo pm2 startup systemd
    sudo systemctl start pm2-root

FAQ

How to change the port if i have a web running

First change proxy template to default, reconfigure the app using the QuickInstall and finally change the proxy template to NodeJS.

I want to remove the domain

Remove it normally, open the filemanager and remove hestiacp_nodejs_config/web/<domain.com>.

hestiacp-nodejs-plugin's People

Contributors

amin-is avatar jlfdzdev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.