Python for the .NET developer Transcripts
Chapter: Deploying Python web apps
Lecture: Creating a virtual machine

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Whether or not you agree with my assessment
0:01 just, let's follow along and get started
0:04 over on DigitalOcean.
0:05 We're going to create a Droplet, and we can click here.
0:07 Droplet is like, their dyno or whatever
0:11 It's their virtual machine.
0:12 Okay, so we're going to create a a Droplet.
0:13 We're going to do Kubernete's Clusters
0:15 Data bases, volumes, DNS, etc.
0:18 We're just going to create this.
0:20 When we come over here and we can pick Ubuntu
0:22 or a whole bunch of other options
0:24 and down here and or even different categories.
0:26 We can pick later ones
0:27 I'm just going to go with 18.04.
0:29 Latest LTS longterm support version.
0:32 I'm going to pick a standard plan
0:34 no-no we don't really need that
0:35 lets go for this one.
0:37 Honestly this is way more than enough, this $5 one
0:40 for what we're doing here.
0:42 Normally I would put it in New York or somewhere
0:44 on the East Coast.
0:45 Virginia, something like that, because it's a good
0:47 trade off between the US market and the European market
0:51 uh- the best you can do with one server
0:53 I mean, you know, focusing on Australia
0:55 sorry that doesn't help, I know.
0:56 It's probably the best we can do by picking
0:58 any one of these spots but
0:59 I'm going to pick San Francisco
1:00 'cause I'm on the West Coast right now.
1:03 All right so we'll turn on monitoring.
1:04 We're going to use SSH keys
1:06 so we don't log in at all.
1:08 Uh we just well, we log in
1:09 but we don't use a username and password;
1:11 We just register to the SSH keys in our machine
1:14 and then we're just, let in because we have them
1:16 and without them you cannot get in.
1:18 So, I don't remember which ones I have on this profile
1:20 so I'mma check them all off, that's a little overkill
1:23 I'm going to delete this machine anyway. Okay
1:25 One droplet we'll call this "Guitary Web".
1:29 There we go, apparently that's a valid host name
1:31 I can put some tags, I can put it in different groups
1:33 I can have back-ups. They recommend it, I don't want them.
1:37 Alright, so I think that should do it
1:38 let's go ahead and create our Droplet...
1:40 And for this I'm going to leave it running real time
1:42 I won't speed it up or anything.
1:44 You'll see about how long it takes
1:46 to get this thing up and running
1:48 and we can log into it. Boom! There it is.
2:07 Well I didn't have a stop watch but I'm... estimating
2:10 25 seconds or something like that.
2:13 Let's go see our new machine!
2:14 Let's go pay it a visit.
2:16 It's... excited to meet us, I'm sure.
2:18 Who over here at SSH at this.
2:22 Still turning on... Let's give it a few more seconds.
2:25 Here we go... They- Yes we want to trust it
2:29 It's going to let us log in.
2:30 What is the very, very first thing we should do
2:32 when we log into a computer? Make sure it is up to date
2:35 So apt, update, this is like checking for updates
2:39 on Linux. Talk more about the commands in a minute
2:43 but you can tell that there is a lot of stuff
2:45 going on here.
2:46 I think it's also checking for updates on itself.
2:54 Okay. Apt upgrade.
2:58 There's a whole bunch of stuff going on
2:59 and if you see this Linux image thing here
3:03 this generally means there's a new release of Linux.
3:06 If we were to look, go back to the top
3:09 what does it say we- Oh, ran out of space but
3:12 uh, we're not on this version of Linux.
3:13 This is some old so there's like a deep upgrade
3:15 along with a bunch of other stuff.
3:16 So, let's go ahead and upgrade those.
3:19 Say yes. Sometimes it will say it needs to update this
3:31 particular file like Bootklub LST.
3:34 And I'm just going to leave it
3:36 anytime it asks me this question
3:37 I just accept the defaults, that's probably the safest.
3:41 All right, well, It's been updated so
3:43 that's a good thing, let's log back out
3:45 and then log back in here.
3:47 And It's very, very likely because it updated
3:50 the Kernel, that we're going to have to do a reboot
3:52 so we just type reboot.
3:54 Usually it takes about 10 seconds...
3:59 Try again... Not quite, There we go.
4:03 All right, super so here is our machine
4:05 and we can do all sorts of fun stuff with it.
4:07 We're ready to start setting up our web server
4:10 and installing some monitoring tools
4:11 and things like that.
4:13 Before we start running commands
4:15 Let's jump back and look at the higher level
4:17 architectural pictures and things like that.
4:20 This web server is up and running
4:22 It's ready to have all of it's stuff installed
4:24 and most importantly, it's patched.
4:25 So it's relatively secure, there's a few more things
4:29 we'll do to make it more secure
4:31 but it's got a good start.