1
1

00:00:00,250  -->  00:00:01,860
<v Jose>Hi guys, and welcome back.</v>
2

2

00:00:01,860  -->  00:00:03,330
In this section, we're going to be dealing with
3

3

00:00:03,330  -->  00:00:05,320
deployment in DigitalOcean.
4

4

00:00:05,320  -->  00:00:06,900
So we're gonna go through this video
5

5

00:00:06,900  -->  00:00:09,340
and create out first server.
6

6

00:00:09,340  -->  00:00:12,060
In DigitalOcean, you can click here at the top right
7

7

00:00:12,940  -->  00:00:15,300
and create a new Droplet.
8

8

00:00:15,300  -->  00:00:17,963
A Droplet in DigitalOcean is a server.
9

9

00:00:19,130  -->  00:00:21,300
Now that we're about to create our Droplet,
10

10

00:00:21,300  -->  00:00:23,350
there are a bunch of configuration options
11

11

00:00:23,350  -->  00:00:25,090
that we have to choose from,
12

12

00:00:25,090  -->  00:00:27,010
what operating system we want,
13

13

00:00:27,010  -->  00:00:31,290
and we're gonna go for Ubuntu 18.04.
14

14

00:00:31,290  -->  00:00:33,670
That's because version 18.04 of Ubuntu
15

15

00:00:33,670  -->  00:00:35,550
is a Long Term Support version,
16

16

00:00:35,550  -->  00:00:38,580
which means it's gonna be maintained for many years,
17

17

00:00:38,580  -->  00:00:40,950
so if there's any security updates or anything like that,
18

18

00:00:40,950  -->  00:00:45,430
18.04 will receive them up until 2022, I think.
19

19

00:00:45,430  -->  00:00:49,910
Okay, so 19.04, 19.10 are not Long Term Support versions,
20

20

00:00:49,910  -->  00:00:52,380
so I will use 18.04.
21

21

00:00:52,380  -->  00:00:53,980
If you want to use any other version
22

22

00:00:53,980  -->  00:00:56,090
of these operating systems like FreeBSD,
23

23

00:00:56,090  -->  00:00:58,070
Fedora, Debian, or CentOS,
24

24

00:00:58,070  -->  00:01:01,230
which we used in a past version of this course,
25

25

00:01:01,230  -->  00:01:02,580
then feel free to do that,
26

26

00:01:02,580  -->  00:01:04,980
but the instructions that we talk about in this section
27

27

00:01:04,980  -->  00:01:06,270
will not apply.
28

28

00:01:06,270  -->  00:01:08,620
So the instructions in these sections
29

29

00:01:08,620  -->  00:01:11,590
will only be for Ubuntu 18.04,
30

30

00:01:11,590  -->  00:01:13,950
not any of the other versions of Ubuntu
31

31

00:01:13,950  -->  00:01:16,010
and not any of the other operating systems,
32

32

00:01:16,010  -->  00:01:19,470
so you must use 18.04 to follow these videos.
33

33

00:01:19,470  -->  00:01:21,550
Then we have to choose what kind of computer we want
34

34

00:01:21,550  -->  00:01:23,700
running our code.
35

35

00:01:23,700  -->  00:01:27,020
I would go for a Standard Droplet, a standard server,
36

36

00:01:27,020  -->  00:01:28,870
and you can left here.
37

37

00:01:28,870  -->  00:01:33,870
You can click left there and go to the $5 a month server.
38

38

00:01:33,900  -->  00:01:35,657
You don't need anything more expensive.
39

39

00:01:35,657  -->  00:01:37,800
$5 a month is plenty for what we're doing here,
40

40

00:01:37,800  -->  00:01:40,150
and it's plenty to learn how to deploy
41

41

00:01:40,150  -->  00:01:41,750
your application to it.
42

42

00:01:41,750  -->  00:01:43,700
Later on, if you feel like you need more power,
43

43

00:01:43,700  -->  00:01:45,573
you can always go more expensive.
44

44

00:01:46,760  -->  00:01:48,360
You have the option to add backups,
45

45

00:01:48,360  -->  00:01:51,790
which I'm gonna say No because this is a learning server,
46

46

00:01:51,790  -->  00:01:55,430
but if you are having a database storage
47

47

00:01:55,430  -->  00:01:56,390
in your application
48

48

00:01:56,390  -->  00:01:58,090
and you wanna make sure you don't lose it,
49

49

00:01:58,090  -->  00:02:00,090
then I would enable backups.
50

50

00:02:00,090  -->  00:02:02,950
Block storage is not necessary until you have more servers
51

51

00:02:02,950  -->  00:02:04,700
and you wanna store files and things like that
52

52

00:02:04,700  -->  00:02:06,380
so I'm not gonna add block storage.
53

53

00:02:06,380  -->  00:02:07,990
Then you've got your datacenter region
54

54

00:02:07,990  -->  00:02:11,210
or where in the world you want your server to be,
55

55

00:02:11,210  -->  00:02:13,230
and you should select here
56

56

00:02:13,230  -->  00:02:16,650
the server that is closest to your users.
57

57

00:02:16,650  -->  00:02:18,900
So whoever is gonna be using the application,
58

58

00:02:18,900  -->  00:02:20,800
you want the server to be close to them
59

59

00:02:20,800  -->  00:02:22,200
so that they will be able
60

60

00:02:22,200  -->  00:02:23,970
to use your application very quickly
61

61

00:02:23,970  -->  00:02:26,300
and it won't take very long to load.
62

62

00:02:26,300  -->  00:02:28,410
In my case, most of my students are in the United States,
63

63

00:02:28,410  -->  00:02:30,880
so we're gonna go for here, San Francisco,
64

64

00:02:30,880  -->  00:02:32,710
or you can go New York if they are mostly
65

65

00:02:32,710  -->  00:02:34,880
in the New York coast.
66

66

00:02:34,880  -->  00:02:36,350
Next, we've got some additional options
67

67

00:02:36,350  -->  00:02:38,870
that we're not gonna select any of,
68

68

00:02:38,870  -->  00:02:40,370
and you've got your SSH keys
69

69

00:02:40,370  -->  00:02:43,040
if you want to add those for login.
70

70

00:02:43,040  -->  00:02:46,490
Now, we're gonna use a password to log into our server,
71

71

00:02:46,490  -->  00:02:48,960
so I'm not gonna add any of these SSH keys,
72

72

00:02:48,960  -->  00:02:51,520
but if you know what SSH keys are and you wanna use them,
73

73

00:02:51,520  -->  00:02:53,340
feel free to add it there.
74

74

00:02:53,340  -->  00:02:56,140
Then, if you do that, you will not get a password.
75

75

00:02:56,140  -->  00:02:57,830
Instead, you'll be able to log in
76

76

00:02:57,830  -->  00:03:00,670
with a computer that has that SSH key.
77

77

00:03:00,670  -->  00:03:03,770
At the end, you can see How many Droplets?
78

78

00:03:03,770  -->  00:03:05,440
That means you can create multiple Droplets
79

79

00:03:05,440  -->  00:03:07,410
with the same configuration if that's what you wanna do,
80

80

00:03:07,410  -->  00:03:09,560
if you want multiple of them that are the same,
81

81

00:03:09,560  -->  00:03:11,380
and you can also give it a name,
82

82

00:03:11,380  -->  00:03:15,480
and here, we're gonna type deployment-learning-droplet.
83

83

00:03:15,480  -->  00:03:18,090
If you're using projects, which I am,
84

84

00:03:18,090  -->  00:03:20,650
just to organise your Droplets into different ones,
85

85

00:03:20,650  -->  00:03:22,910
you can also select your project down here,
86

86

00:03:22,910  -->  00:03:24,900
and you can also add tags to your Droplets
87

87

00:03:24,900  -->  00:03:25,860
in case you have a lot of them,
88

88

00:03:25,860  -->  00:03:27,570
and you wanna be able to search through them
89

89

00:03:27,570  -->  00:03:28,780
a bit more effectively,
90

90

00:03:28,780  -->  00:03:31,350
but for now, we don't really need them.
91

91

00:03:31,350  -->  00:03:32,183
That's it.
92

92

00:03:32,183  -->  00:03:34,050
Once you do that, you can press Create,
93

93

00:03:34,050  -->  00:03:36,040
and as soon as a Droplet is created,
94

94

00:03:36,040  -->  00:03:39,940
DigitalOcean will start charging you for every minute
95

95

00:03:39,940  -->  00:03:42,230
that the Droplet is live.
96

96

00:03:42,230  -->  00:03:45,630
So do remember that if you do delete this Droplet,
97

97

00:03:45,630  -->  00:03:48,550
you will only get charged for the amount of hours or minutes
98

98

00:03:48,550  -->  00:03:50,530
that this Droplet has been alive.
99

99

00:03:50,530  -->  00:03:52,047
So you're not gonna get charged
100

100

00:03:52,047  -->  00:03:53,780
$5 immediately at the beginning.
101

101

00:03:53,780  -->  00:03:55,350
If you delete this just now,
102

102

00:03:55,350  -->  00:03:57,450
you'll only get charged a couple of cents.
103

103

00:03:58,670  -->  00:04:00,280
So you can always recreate your Droplets
104

104

00:04:00,280  -->  00:04:02,093
up until you've run out of credit,
105

105

00:04:03,100  -->  00:04:03,933
and there you have it.
106

106

00:04:03,933  -->  00:04:05,150
That is our Droplet.
107

107

00:04:05,150  -->  00:04:08,530
You've got some IP address that you can use
108

108

00:04:08,530  -->  00:04:10,080
to access your Droplet,
109

109

00:04:10,080  -->  00:04:13,160
and you've got a bunch of information on the Droplet itself,
110

110

00:04:13,160  -->  00:04:16,560
and that will be populated as you use it.
111

111

00:04:16,560  -->  00:04:18,790
So when we wanna log into our Droplet,
112

112

00:04:18,790  -->  00:04:20,990
just copy this IP address
113

113

00:04:20,990  -->  00:04:23,650
and log into it via SSH.
114

114

00:04:23,650  -->  00:04:24,483
What's gonna happen is
115

115

00:04:24,483  -->  00:04:27,520
you're gonna get an email with your password,
116

116

00:04:27,520  -->  00:04:31,050
and so, you can SSH into the Droplet using the password
117

117

00:04:31,050  -->  00:04:32,650
that you got on your email,
118

118

00:04:32,650  -->  00:04:35,800
and you'll be able to log in and change your password there.
119

119

00:04:35,800  -->  00:04:38,790
Alternatively, you can also log in using the Console here
120

120

00:04:38,790  -->  00:04:41,860
up on DigitalOcean by clicking this Console button.
121

121

00:04:41,860  -->  00:04:45,360
However, I found this to be not great,
122

122

00:04:45,360  -->  00:04:47,910
so I will not use this thing here.
123

123

00:04:47,910  -->  00:04:51,220
Instead, I will go over to my Terminal.
124

124

00:04:51,220  -->  00:04:54,740
I've opened my Terminal app here on Mac,
125

125

00:04:54,740  -->  00:04:57,570
and all you have to do if you're using Mac or Linux
126

126

00:04:57,570  -->  00:05:02,500
is type ssh root@ your server's IP address,
127

127

00:05:02,500  -->  00:05:05,270
and then, enter the password.
128

128

00:05:05,270  -->  00:05:06,570
I have to type yes to this,
129

129

00:05:06,570  -->  00:05:08,280
but maybe you won't have to do that.
130

130

00:05:08,280  -->  00:05:10,910
Then enter your password to your root account
131

131

00:05:10,910  -->  00:05:12,360
that you've got on your email.
132

132

00:05:12,360  -->  00:05:14,400
If you're using Windows,
133

133

00:05:14,400  -->  00:05:17,780
then you may not be able to use SSH from your Terminal,
134

134

00:05:17,780  -->  00:05:20,350
which is called cmd.exe.
135

135

00:05:20,350  -->  00:05:22,130
On Windows, you may have to do download
136

136

00:05:22,130  -->  00:05:23,570
an alternative software,
137

137

00:05:23,570  -->  00:05:27,410
and I recommend one called PuTTY for Windows.
138

138

00:05:27,410  -->  00:05:28,350
Once you've logged in,
139

139

00:05:28,350  -->  00:05:31,020
the server will ask you to change the root password,
140

140

00:05:31,020  -->  00:05:32,930
so do that and change it to something
141

141

00:05:32,930  -->  00:05:34,220
that you can remember,
142

142

00:05:34,220  -->  00:05:36,030
and then, we can go into the server
143

143

00:05:36,030  -->  00:05:38,410
and start making some changes.
144

144

00:05:38,410  -->  00:05:39,960
I'll see you in the next video.
