ssh root@<the new ip>
fallocate -l 1G /swapfilechmod 600 /swapfilemkswap /swapfileswapon /swapfileecho '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabsysctl vm.swappiness=10nano /etc/sysctl.conf- At the bottom of the file add
vm.swappiness=10
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
apt-get install -y nodejs
npm install -g yarn
yarn global add pm2
useradd -m -s bash -G sudo <app name>
nano /etc/ssh/sshd_config- Find line about authorized_keys and home
Add public key we will access server with
From your local machine
ssh -v <app name>@<app domain or ip>
Generate a key for server and add to Github repo as deploy key
Connect to github with ssh to authorize host
ssh git@github.com
You should see a message from github with the repo and then get disconnected
sudo apt-get install postgresql postgresql-contrib
adduser <app name>
createdb <app name>
su <app name>psqlgrant all privileges on database <app name> to <app name>;
pm2 startup systemd -u <app name> --hp <app home directory>
pm2 save once the process is running to save it for restart