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
-
Install Node: (Using one of these options)
-
Install PM2
-
Clone this repository:
cd ~/tmp git clone https://github.com/JLFdzDev/hestiacp-nodejs.git cd hestiacp-nodejs
-
Use install.sh
sudo chmod 755 install.sh sudo ./install.sh
-
🚀 You are ready to install an App!!!
- Create new user (If you have one no need to create)
- User needs bash access for app to work, go to User edit > advanced options > SSH Access > bash
- Add new web (Ex. acme.com)
- Go to edit this new web and go to Quick Install App
- 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 yourpackage.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)
-
- Go to Edit web > Advanced Options > Proxy Template > NodeJS
- Upload your app with filemanager, clone with git... in
/home/<user>/<domain.com>/private/nodeapp
- 🎉 Congratulations you're done!!!
First change proxy template to default, reconfigure the app using the QuickInstall and finally change the proxy template to NodeJS.
Remove it normally, open the filemanager and remove hestiacp_nodejs_config/web/<domain.com>.