{"id":20497955,"url":"https://github.com/logico/vestacp-nodejs","last_synced_at":"2025-08-21T20:32:11.102Z","repository":{"id":45447005,"uuid":"182580747","full_name":"logico/vestacp-nodejs","owner":"logico","description":"Run automatically Node.JS apps in VestaCP.","archived":false,"fork":false,"pushed_at":"2023-04-04T07:14:18.000Z","size":25,"stargazers_count":114,"open_issues_count":6,"forks_count":68,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-12-10T14:51:55.774Z","etag":null,"topics":["nginx","nodejs","vestacp","vestacp-templates"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logico.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-21T20:45:58.000Z","updated_at":"2024-11-04T01:27:29.000Z","dependencies_parsed_at":"2022-07-30T18:08:12.560Z","dependency_job_id":null,"html_url":"https://github.com/logico/vestacp-nodejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logico%2Fvestacp-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logico%2Fvestacp-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logico%2Fvestacp-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logico%2Fvestacp-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logico","download_url":"https://codeload.github.com/logico/vestacp-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230532443,"owners_count":18240792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx","nodejs","vestacp","vestacp-templates"],"created_at":"2024-11-15T18:12:35.481Z","updated_at":"2024-12-20T04:07:07.864Z","avatar_url":"https://github.com/logico.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VestaCP with Node.JS support.\n\nWith this repo you can run multiples NodeJs Apps at some time.\nThis template read `.env` file, `.nvm` for Node version, and `package.json` for get info and auto install modules.\n\n![VestaCP](https://logico.com.ar/img/2019/04/21/vestacp_proxy_setup.png)\n\n## Instalation\n\n***Auto \"With Script\":***\n* First download this Git in your `home` directory and run `chmod +x ./install.sh`, `./install.sh`. Script auto install `NVM` and `PM2` \n\n***Manually:***\n* Install PM2 `npm i pm2@latest -g`\n* Install NVM see [https://nvm.sh]\n* Upload `NodeJS.tpl`, `NodeJS.stpl`, `NodeJS.sh` to `/usr/local/vesta/data/templates/web/nginx/`\n\n## WHERE DEPLOY MY APP?\n\nIn VestaCp the user must be a enabled `bash` ssh, if set as `none` this si a cause to stack.\nUpload your app with ssh on this path: `/home/\u003cuser\u003e/web/\u003cdomain\u003e/nodeapp/`.\nHere you can use files `.env` with Enviroment variables, `.nvm` or `.node-version` for specify NodeJs version.\n\nIn your `package.json` you can specify your index file with \n```js\n    ...\n    \"main\": \"index.js\",\n    ...\n```\n\nIn your `index.js` you need run the express server or http with this parameters:\n```js\n    ...\n    //PORT IS PARSET WITH ENV VARIABLE FOR PROPER RUN IF YOU DON'T SET YOUR APP IS CRASH OR NOT RUN!!\n    app.listen(process.env.PORT); \n    ...\n```\nWhen your app is launched script create UNIX socket file in `/home/\u003cuser\u003e/web/\u003cdomain\u003e/nodeapp/app.sock` is set with 0777 permisses for allow access to NGINX.\n\n## DEBUG\n\nEach launch will be copied two logs files `\u003cdomain-name\u003e-error.log` and `\u003cdomain-name\u003e-out.log` to the `nodeapp` folder.\n\n## BLANK PAGES \"NODE DOWN\"\n\nWhen your app is down create simply html file in public folder `/home/\u003cuser\u003e/web/\u003cdomain\u003e/public_app/index.html`.\n\n### FAQ\n\n* How can restart app?: Select Proxy template as `default` click save button, select NodeJs template option and click save again.\n* How I can check if my app is running?: in nodeapp folder run `ls -l` and see if exist `app.sock` file, if yes, run `runuser -l \u003cuser\u003e -c \"pm2 list\"` or `runuser -l \u003cuser\u003e -c \"pm2 monit\"`\n* My app is not running, why?: Check setting of user account and set `bash` ssh. \n\n### Samples\n\nFor debug propose you can run script with this arguments `NodeJS.sh \u003cuser\u003e \u003cdomain\u003e 127.0.0.1 /home` full command: `/usr/local/vesta/data/templates/web/nginx/NodeJS.sh admin default 127.0.0.1 /home`\n\n* ***Remove all instances***: `runuser -l \u003cuser\u003e -c \"pm2 del all\"` for admin `runuser -l admin -c \"pm2 del all\"`\n* ***List all instances***: `runuser -l \u003cuser\u003e -c \"pm2 list\"` for admin `runuser -l admin -c \"pm2 list\"`\n* ***Show monitor of instances***: `runuser -l \u003cuser\u003e -c \"pm2 monit\"` for admin `runuser -l admin -c \"pm2 monit\"`\n\n#### Documentation\n\nPm2: [https://pm2.keymetrics.io/docs/usage/quick-start/]\nInfo about NGINX Proxy [https://serverfault.com/questions/316157/how-do-i-configure-nginx-proxy-pass-node-js-http-server-via-unix-socket]\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogico%2Fvestacp-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogico%2Fvestacp-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogico%2Fvestacp-nodejs/lists"}