Skip to content

Instantly share code, notes, and snippets.

@reducio
Last active May 12, 2018 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reducio/1731ebf52fad4708843fa2bdd55cd9a7 to your computer and use it in GitHub Desktop.
Save reducio/1731ebf52fad4708843fa2bdd55cd9a7 to your computer and use it in GitHub Desktop.
Shell script for deploy node.js app (express.js app)
#!/bin/bash
# shell script for deploy node.js app (express.js app)
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt install -y nodejs
nodejs --version # need version 8.11.1 lts, includes npm 5.6.0
npm --version # need version >= 5.6.0
sudo apt install git
cd /var/www/
git clone git@github.com:user-account/repo-name.git
cd repo-name/server
npm install
nohup node server.js & # also use systemd or upstart
# proccess run on 3002 port or this which is specified in the file server.js, you can change port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment