-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall_installations.sh
53 lines (45 loc) · 1.09 KB
/
all_installations.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
#!/bin/bash
# Update and install Git
echo "Installing Git..."
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install -y git
sudo git --version
# Install Node.js
echo "Installing Node.js..."
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
sudo apt-get install -y nodejs
sudo node -v
# Install and check Nginx
echo "Installing and checking Nginx..."
sudo apt update
sudo apt install -y nginx
sudo systemctl enable nginx
sudo service nginx status
sudo nginx -v
# Install and configure PM2
echo "Installing and configuring PM2..."
sudo npm install -g pm2@latest
sudo pm2 startup
sudo pm2 --version
# Install and configure UFW
echo "Installing and configuring UFW..."
sudo apt install -y ufw
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
sudo ufw status
# Install Certbot
sudo apt-get install certbot python3-certbot-nginx -y
# Install fail2ban
sudo apt install fail2ban -y
# Final Server hardening
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
sudo node -v
sudo nginx -v
sudo npm -v
sudo git --version
sudo pm2 --version
sudo ufw status