1
00:00:02,190 --> 00:00:04,320
And this starts a wizard

2
00:00:04,320 --> 00:00:07,910
where we can configure this to be launched instance,

3
00:00:07,910 --> 00:00:11,730
so this to be launched cloud server.

4
00:00:11,730 --> 00:00:15,540
And here you should choose this Amazon Linux AMI,

5
00:00:15,540 --> 00:00:17,930
this will basically be the operating system,

6
00:00:17,930 --> 00:00:19,670
which is installed on the server,

7
00:00:19,670 --> 00:00:24,480
and there this first choice in the 64 bit version here

8
00:00:24,480 --> 00:00:28,450
x86 should be the version you choose,

9
00:00:28,450 --> 00:00:31,140
and simply click Select there for it.

10
00:00:31,140 --> 00:00:36,100
Next, make sure you choose a free tier eligible option here,

11
00:00:36,100 --> 00:00:39,220
in my case, the t2 micro instance.

12
00:00:39,220 --> 00:00:41,350
Generally on this screen,

13
00:00:41,350 --> 00:00:44,580
you can choose which kind of instance you want to launch,

14
00:00:44,580 --> 00:00:47,140
and there are a lot of instances,

15
00:00:47,140 --> 00:00:50,600
from very small ones, which are not very powerful,

16
00:00:50,600 --> 00:00:54,350
which have only limited memory and CPUs,

17
00:00:54,350 --> 00:00:57,060
all the way up to very powerful instances,

18
00:00:57,060 --> 00:01:01,350
which can be used for compute intensive work,

19
00:01:01,350 --> 00:01:03,770
but obviously these more powerful instances

20
00:01:03,770 --> 00:01:07,560
will be way more expensive and therefore, for this demo,

21
00:01:07,560 --> 00:01:09,720
we're going to use the T2 micro one,

22
00:01:09,720 --> 00:01:11,400
which is not very powerful,

23
00:01:11,400 --> 00:01:14,113
but which we can get started with for free.

24
00:01:14,960 --> 00:01:18,510
So then click on Next: Configure Instance Details

25
00:01:18,510 --> 00:01:22,130
and make sure that a VPC is created on here,

26
00:01:22,130 --> 00:01:25,030
that a default VPC is selected on here.

27
00:01:25,030 --> 00:01:29,330
If that's not the case, click create new VPC

28
00:01:29,330 --> 00:01:32,950
and leave all the other default settings as they are.

29
00:01:32,950 --> 00:01:35,580
You don't need to configure anything else here,

30
00:01:35,580 --> 00:01:37,733
unless you know what you're doing.

31
00:01:38,780 --> 00:01:41,760
So next, you can click Review and Launch already,

32
00:01:41,760 --> 00:01:43,500
and you should be on this screen

33
00:01:43,500 --> 00:01:46,490
where you can review your setup,

34
00:01:46,490 --> 00:01:49,030
and all the defaults should be fine here.

35
00:01:49,030 --> 00:01:53,750
Verify that you used t2 micro, and then click Launch,

36
00:01:53,750 --> 00:01:55,773
and this will bring up this screen.

37
00:01:56,660 --> 00:01:58,380
This is an important screen.

38
00:01:58,380 --> 00:02:02,280
Here you can create a new key pair

39
00:02:02,280 --> 00:02:04,670
and you will need this key pair,

40
00:02:04,670 --> 00:02:06,500
which will be a file in the end,

41
00:02:06,500 --> 00:02:10,530
to later connect to your instance via SSH

42
00:02:10,530 --> 00:02:13,130
and to run commands on it.

43
00:02:13,130 --> 00:02:15,790
So choose create a new key pair here

44
00:02:15,790 --> 00:02:17,860
and then give it any name of your choice,

45
00:02:17,860 --> 00:02:20,393
in my case example-1,

46
00:02:21,620 --> 00:02:23,617
and then click Download Key Pair,

47
00:02:23,617 --> 00:02:25,570
and that's very important.

48
00:02:25,570 --> 00:02:28,590
You'll only be able to download this once

49
00:02:28,590 --> 00:02:30,640
and you need this to connect,

50
00:02:30,640 --> 00:02:33,220
so if you lose this key,

51
00:02:33,220 --> 00:02:36,880
you will have to shut down your instance and start a new one

52
00:02:36,880 --> 00:02:40,440
because you'll not be able to connect to it anymore.

53
00:02:40,440 --> 00:02:43,210
So I downloaded and saved this key file

54
00:02:43,210 --> 00:02:46,100
into my project folder here, though I will say,

55
00:02:46,100 --> 00:02:49,680
you should not share this key file with anyone

56
00:02:49,680 --> 00:02:52,850
because everyone who has this file will be able

57
00:02:52,850 --> 00:02:56,050
to connect to your launched remote machine here,

58
00:02:56,050 --> 00:03:00,043
so store it somewhere where only you have access to it.

59
00:03:01,040 --> 00:03:03,840
And once you did that click Launch Instances,

60
00:03:03,840 --> 00:03:07,480
and this will now launch this demo virtual instance,

61
00:03:07,480 --> 00:03:11,000
so this demo cloud-based computer.

62
00:03:11,000 --> 00:03:12,950
Click View Instances thereafter,

63
00:03:12,950 --> 00:03:17,160
and then let's wait until this is up and running,

64
00:03:17,160 --> 00:03:19,410
which can take a couple of minutes of course.

65
00:03:21,520 --> 00:03:24,490
So now my instance is up and running here,

66
00:03:24,490 --> 00:03:28,310
and as I said, we're going to connect via SSH.

67
00:03:28,310 --> 00:03:30,870
SSH stands for Secure Shell,

68
00:03:30,870 --> 00:03:32,890
and in the end, it's a protocol

69
00:03:32,890 --> 00:03:37,120
for connecting to a remote machine from your local machine

70
00:03:37,120 --> 00:03:40,130
via the command line or terminal you have

71
00:03:40,130 --> 00:03:41,583
on your local machine.

72
00:03:42,830 --> 00:03:45,520
Now, on Linux and Mac iOS devices,

73
00:03:45,520 --> 00:03:48,080
this is super simple because there,

74
00:03:48,080 --> 00:03:50,500
you will be able to use the regular terminal

75
00:03:50,500 --> 00:03:53,260
and you already have a SSH command there,

76
00:03:53,260 --> 00:03:56,830
which you can use to establish such a SSH connection

77
00:03:56,830 --> 00:03:58,103
to a remote server.

78
00:03:59,150 --> 00:04:01,500
On Windows, this is not built-in.

79
00:04:01,500 --> 00:04:06,500
On Windows, you either need to set up WSL 2 on Windows 10,

80
00:04:07,610 --> 00:04:11,840
which in the end is Linux running on your Windows machine,

81
00:04:11,840 --> 00:04:14,810
and you can look into the official Microsoft Documentation

82
00:04:14,810 --> 00:04:16,033
on how to do that,

83
00:04:17,600 --> 00:04:20,240
or you use a tool like PuTTY,

84
00:04:20,240 --> 00:04:22,370
which you can simply download and install

85
00:04:22,370 --> 00:04:25,040
on your Windows machine to then use that

86
00:04:25,040 --> 00:04:29,640
to run SSH commands because PuTTY is a SSH client.

87
00:04:29,640 --> 00:04:33,490
Once you got it installed, you will get a command prompt,

88
00:04:33,490 --> 00:04:35,630
you could say, built into PuTTY,

89
00:04:35,630 --> 00:04:39,000
which you then can use to run SSH commands.

90
00:04:39,000 --> 00:04:42,880
So you need to do either that or use WSL 2

91
00:04:42,880 --> 00:04:47,880
in order to connect to a remote machine with SSH on Windows.

92
00:04:48,690 --> 00:04:51,000
Now, once you've finished all these preparations

93
00:04:51,000 --> 00:04:54,440
and you ensured that you can run SSH commands,

94
00:04:54,440 --> 00:04:57,100
here's how we can connect to our instance.

95
00:04:57,100 --> 00:05:00,580
We simply click on Connect here in the AWS,

96
00:05:00,580 --> 00:05:05,580
EC2 dashboard, and then choose a standalone SSH client,

97
00:05:06,660 --> 00:05:08,810
and here you then get the detailed steps

98
00:05:08,810 --> 00:05:11,440
you need to execute in order to connect

99
00:05:11,440 --> 00:05:13,400
to your machine here,

100
00:05:13,400 --> 00:05:16,330
your virtual EC2 instance running in the cloud

101
00:05:16,330 --> 00:05:17,930
from your local machine,

102
00:05:17,930 --> 00:05:20,840
and this will be required in step three

103
00:05:20,840 --> 00:05:22,590
in order to install Docker

104
00:05:22,590 --> 00:05:26,280
and run our container on that machine.

105
00:05:26,280 --> 00:05:29,540
But wait, didn't I skip a step here?

106
00:05:29,540 --> 00:05:33,210
What about step two, configuring security groups?

107
00:05:33,210 --> 00:05:36,040
Indeed, that's a step we all should take care of,

108
00:05:36,040 --> 00:05:37,770
but we can also do this

109
00:05:37,770 --> 00:05:41,340
after starting our Docker container on that instance,

110
00:05:41,340 --> 00:05:43,320
the exact order doesn't matter here

111
00:05:43,320 --> 00:05:46,970
and therefore, let's continue with this for now.

112
00:05:46,970 --> 00:05:51,970
So open PuTTY on Windows, or the WSL 2 batch on Windows,

113
00:05:52,260 --> 00:05:57,260
or your regular terminal or batch on macOS or Linux,

114
00:05:57,580 --> 00:06:00,550
and I did this here in my project folder,

115
00:06:00,550 --> 00:06:03,250
where I also have this key file,

116
00:06:03,250 --> 00:06:07,290
and then we need to run this command here first

117
00:06:07,290 --> 00:06:10,363
in order to ensure that this key file can be used.

118
00:06:11,220 --> 00:06:13,180
Important note right away,

119
00:06:13,180 --> 00:06:15,410
if you're on Windows and using PuTTY,

120
00:06:15,410 --> 00:06:17,540
you can skip this step.

121
00:06:17,540 --> 00:06:21,010
This command, the chmod command won't be available

122
00:06:21,010 --> 00:06:24,830
in the regular command prompt on Windows anyways,

123
00:06:24,830 --> 00:06:26,220
and you will also be able

124
00:06:26,220 --> 00:06:29,010
to later skip this command line approach

125
00:06:29,010 --> 00:06:33,200
of running the SSH command if you're using PuTTY on Windows,

126
00:06:33,200 --> 00:06:36,720
because PuTTY gives you a graphical user interface

127
00:06:36,720 --> 00:06:38,940
where you can enter the host address

128
00:06:38,940 --> 00:06:41,870
and point at your key file,

129
00:06:41,870 --> 00:06:43,520
and attached, you'll find a link

130
00:06:43,520 --> 00:06:47,450
with detailed step by step instructions on how to connect

131
00:06:47,450 --> 00:06:50,940
to the EC2 instance via Windows PuTTY.

132
00:06:50,940 --> 00:06:53,070
That's just one important side note.

133
00:06:53,070 --> 00:06:54,990
What I'm showing here will work

134
00:06:54,990 --> 00:06:57,950
if you're using WSL 2 on Windows,

135
00:06:57,950 --> 00:07:00,660
or if you're using the batch on Linux

136
00:07:00,660 --> 00:07:02,383
or the terminal on macOS.

137
00:07:03,880 --> 00:07:07,130
So paste in this command and execute it

138
00:07:07,130 --> 00:07:10,770
to ensure that this key file has the right permissions

139
00:07:10,770 --> 00:07:12,433
in order to continue.

140
00:07:13,810 --> 00:07:17,730
Now, once you did that, we can continue with the next step,

141
00:07:17,730 --> 00:07:21,230
which in the end, is copying this command here,

142
00:07:21,230 --> 00:07:23,560
which you find down there,

143
00:07:23,560 --> 00:07:26,240
and then simply executing it here.

144
00:07:26,240 --> 00:07:29,290
Make sure you're running this in the same folder

145
00:07:29,290 --> 00:07:33,190
as your permissions file lives in.

146
00:07:33,190 --> 00:07:36,640
Hit Enter and then type yes here

147
00:07:36,640 --> 00:07:39,180
when you're getting this question,

148
00:07:39,180 --> 00:07:41,063
whether you want to connect or not,

149
00:07:41,900 --> 00:07:44,750
and thereafter you should be connected,

150
00:07:44,750 --> 00:07:47,660
and you can tell by the fact that it's saying something like

151
00:07:47,660 --> 00:07:51,303
ec2-user@, and then some IP address.

152
00:07:52,210 --> 00:07:55,270
Now, all the commands you execute here

153
00:07:55,270 --> 00:07:56,940
in this terminal window

154
00:07:56,940 --> 00:08:00,040
will be executed on the remote machine,

155
00:08:00,040 --> 00:08:02,360
so not on your local machine anymore,

156
00:08:02,360 --> 00:08:04,660
but on the remote machine.

157
00:08:04,660 --> 00:08:07,740
And now here, we need to install Docker

158
00:08:07,740 --> 00:08:09,980
and then somehow get our image,

159
00:08:09,980 --> 00:08:13,440
which we build locally onto that remote machine,

160
00:08:13,440 --> 00:08:15,520
and then we need to run a container,

161
00:08:15,520 --> 00:08:18,550
configure the security groups and we'll be done.

162
00:08:18,550 --> 00:08:21,023
So let's go for these steps next.

