-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupVM.sh
executable file
·58 lines (47 loc) · 1.32 KB
/
setupVM.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
#!/bin/bash
# Require script to be run as root (or with sudo)
function super-user-check() {
if [ "$EUID" -ne 0 ]; then
echo "You need to run this script as super user."
exit
fi
}
# Check for root
super-user-check
#Update System
apt update
apt upgrade -y
#Install java 17
apt install openjdk-17-jdk
#Install Docker
apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt update
apt-cache policy docker-ce
apt install docker-ce -y
#Install Docker-compose
if [ "$1" == 'DO' ]; then
DOCKER_CONFIG=/root/.docker
else
DOCKER_CONFIG=/home/ubuntu/.docker
groupadd docker
usermod -aG docker ubuntu
fi
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
sudo chmod 666 /var/run/docker.sock
#Install openJDK
apt install default-jdk
#Install certbot
snap install core
snap refresh core
snap install --classic certbot
#Install wireguard tools
apt install wireguard-tools
apt install wireguard
#Update and remove System
apt update
apt upgrade -y
apt autoremove -y