- Ensure latest Ubuntu updates
$ sudo apt-get autoclean && sudo apt-get autoremove && sudo apt-get update && sudo apt-get upgrade -y
- Install
curl
, make
, g++
, libkrb5-dev
and git
$ sudo apt-get install curl make g++ libkrb5-dev git -y
- Install node version manager
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- Install latest available Node.js
- Install PM2
- Install redis-server
$ sudo add-apt-repository ppa:chris-lea/redis-server
$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install redis-server -y
- Install MongoDB for your Ubuntu version.
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install -y mongodb-org
- Enable MongoDB to automatically startup when systems boots up
$ sudo shutdown -r now
$ sudo systemctl daemon-reload
$ sudo systemctl start mongod
$ sudo systemctl enable mongod
- Deploy
ewea
into your server
$ git clone https://github.com/CodeTanzania/ewea.git
$ cd ewea
$ npm install
- Copy and ensure correct environment variables
- Setup
ewea
into your server
$ npm run process:start
$ npm run process:save
$ npm run process:startup
You will receive directions to finalize setup by copy/paste given commands.
- Whenever
source codes
updated make sure you update running processes
by:
$ npm run process:reload
$ npm run process:restart
- Verify everything is working
$ sudo shutdown -r now (optional)
$ curl http://0.0.0.0:5000