Last active
August 4, 2022 11:41
-
-
Save AhmedAliAbdAlMowla/3b7b9d9f73778887cab989ca03fb54b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo " | |
---------------------- | |
Author:Eng/Ahmed Ali Ahmed Abd Al Mowla. | |
Create at:4/4/2021. | |
---------------------- | |
" | |
echo " | |
---------------------- | |
NODE & NPM | |
---------------------- | |
" | |
# install nodejs and npm | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash | |
. ~/.nvm/nvm.sh | |
sudo nvm install node | |
echo " | |
---------------------- | |
MONGODB | |
---------------------- | |
" | |
# import mongodb 4.0 public gpg key | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 | |
# create the /etc/apt/sources.list.d/mongodb-org-4.0.list file for mongodb | |
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list | |
# reload local package database | |
sudo apt-get update | |
# install the latest version of mongodb | |
sudo apt-get install -y mongodb-org | |
# start mongodb | |
sudo systemctl start mongod | |
# set mongodb to start automatically on system startup | |
sudo systemctl enable mongod | |
echo " | |
---------------------- | |
PM2 | |
---------------------- | |
" | |
# install pm2 with npm | |
sudo npm install -g pm2 | |
# set pm2 to start automatically on system startup | |
sudo pm2 startup systemd | |
echo " | |
---------------------- | |
NGINX | |
---------------------- | |
" | |
# install nginx | |
sudo apt-get install -y nginx | |
echo " | |
---------------------- | |
UFW (FIREWALL) | |
---------------------- | |
" | |
# allow ssh connections through firewall | |
sudo ufw allow OpenSSH | |
# allow http & https through firewall | |
sudo ufw allow 'Nginx Full' | |
# enable firewall | |
sudo ufw --force enable | |
echo " | |
---------------------- | |
All thing is done (^_^) | |
---------------------- | |
" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment