-
Notifications
You must be signed in to change notification settings - Fork 0
/
systemSetup.sh
78 lines (55 loc) · 1.55 KB
/
systemSetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
echo "
----------------------
NODE & NPM
----------------------
"
# Add nodejs 10 ppa (personal package archive) from nodesource
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
# Install nodejs and npm
sudo apt-get install -y nodejs
echo "
----------------------
MONGODB
----------------------
"
# Import MongoDB public GPG Key
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
# Create the /etc/apt/sources.list.d/mongodb-org-5.0.list file for MongoDB
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
# Reload local package database
sudo apt-get update
# Install the MongoDB packages
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
----------------------
"
# PM2 is a production process manager for Node.js applications with a built-in load balancer
# 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