/
setup_ubuntu.sh
executable file
·81 lines (52 loc) · 1.48 KB
/
setup_ubuntu.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
79
80
81
#!/bin/bash
#
# Setup ubuntu server
if [ "$UID" == "0" ] ; then
echo "DO NOT USE sudo"
exit 1
fi
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
make \
build-essential \
software-properties-common \
-y
### Git
sudo apt-get update
sudo apt-get install git -y
### Node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
source ~/.bashrc
nvm install 10
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn -y
npm i pon pm2 npm@latest -g
echo "export NODE_ENV=production" >> ~/.bashrc
source ~/.bashrc
### Java
sudo apt-get install default-jdk -y
### Docker
sudo apt-get install curl software-properties-common python-software-properties -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce -y
sudo usermod -a -G docker $USER
docker run hello-world
### MySQL Client
sudo apt-get install mysql-client -y
### Nginx
sudo apt-get update
sudo apt-get install nginx -y
### Let's Encrypt
sudo apt-get update
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get update
sudo apt-get install python-certbot-nginx -y