#!/bin/bash
# update ubuntu server
sudo apt-get update
# upgrade ubuntu server
sudo apt-get upgrade
# install curl, make, g++ and git
sudo apt-get install curl make g++ git
# install mongoose dev dependencies
sudo apt-get install libkrb5-dev
# enable node to run in port 80
sudo apt-get install libcap2-bin
sudo setcap cap_net_bind_service=+ep /usr/local/bin/node
# if you have install node using nvm try below command
#sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``
#
# install mongodb
#
# import the public key used by the package management system
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
# create a list file for MongoDB
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
# reload local package database
sudo apt-get update
# install the latest stable version of MongoDB
sudo apt-get install -y mongodb-org
#
# install nodejs and global dependencies
#
# install node version manager
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
# ensure nvm changes made to your path are actually reflected
# exit your terminal and re-open new terminal
# install the latest available of your choice e.g 0.10.x release of nodejs
nvm install v0.10
# set default nodejs version
nvm alias default 0.10.3
# install PM2
npm install pm2 -g
Last active
May 20, 2020 07:23
-
-
Save lykmapipo/dd3999cf05bd2ae5be82 to your computer and use it in GitHub Desktop.
Ubuntu Setup for Production NodeJS Deployment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment