Deploy your next website for $4/month and break into tech!

Phil Choi walks through deploying a website for $4 a month using Namecheap for the domain, AWS Route 53 for DNS, and Lightsail for hosting. He covers SSHing into a Node.js instance, pulling code from GitHub, and setting up HTTPS with S3, CloudFront, and AWS Certificate Manager.
Chapters
The first thing you need to do is buy a domain. So I like to use namecheap.com. i think it's like one of the cheapest places. So pretty sure I have one. Let me just sign in real quick.
There you are. All right, cool.
So we have some domains and let me just go here. Let's do something really cheap like Leadville or something. I was eating chips earlier. Do you like the lay's salt and vinegar chips? Put a thumbs up in the comment or something. All right. Let's look for a cheap website. Lead fill XYZ. That seems to be pretty cheap. It's $2 and $2. I think I have some money here. We can buy some. We can buy something.
Let's check here. Have.
Where's my payment method.
View card?
I just want to see if I have money left over. Just try to buy something. Then let's buy that. Lead fill xyz.
Here we are.
Add to cart. Cool. Just press the checkout button. Subtotal 218. I'll buy it for one year. Cool. We'll confirm the order. Pay now. One second. What's good? Thank you for your purchase. Your order $2. Now we have another domain called Leadfill XYZ here. If we click the manage button we'll see that we have some DNS thing somewhere advanced DNS probably just under domain for sharing and transferring.
I forget.
Domain contacts, Private email redirect domain left field xyz destination URL and then we'll do inside of the name servers.
Whoops.
We're going to put custom DNS and we'll make one right now. So aws.com we'll go to aws.com that's where I have my. So if you don't have an account already, you just sign up real quick. Doesn't take too long. You just have to add some like billing information, your email and password. So I'll just go in here. I'll sign in using. Crap. I'll sign in using the root user email.
There you are.
Next. This is where it always gets me.
There you go.
Now we'll sign in and let's just point the domain that we bought to AWS real quick. So I'll just do Route 53 and that's like the domain manager of AWS. Go here I'll create a hosted zone. I'll just call it Let Fill XYZ and make it public Hosted zone. I'll create it. So now I have this record and I have some name servers. You'll Notice the ns. So I'll just copy this stuff here and then I will get some. You just put like docs new like this. And then I will get this name server. I'll put it here. I'll get the next one. I'll put it here. So this. I bought the domain here, but I need to control the domain with aws. So I'm just, I'm just putting. Pointing it over to AWS now and.
There, there, there, there.
Then I'll just click the green check mark and. Cool. So now. Oh wait. Okay, now this is pointing over here. So that should be good. And let's just make something real quick. So I'll just open another aws.com so I can have the Route 53 open. I will press this will take me to the dashboard and I'll show you like the easiest way. I feel like the easiest way maybe like lightsail and lightsail is like some kind of EC2 server, but it's got like a wrapper. I'll just create an instance here and it comes with like a web server already installed everything. So you can like come. You can choose a configuration for your cloud service. So I choose Node JS all the time. If I'm gonna like do something real quick, I'll use this one. I'll just click this one. It's the first 90 days is pretty free. And then a month after that it's $5. I'll just call it let fill XYZ so I know which one I'm talking about. Create the instance. We just have to wait for a second. So now it's starting. And then while we do that, we'll go back to the. We'll go get a static ip. Just give me a second. We'll go to domains and DNS.
Go.
To the instances, press on this, not this for now. And you go to networking. And then we'll create a static IP. We'll click let fill XYZ and we'll just do let fill XYZ staticip and create this. So now the public static IP address is 527-93975. We'll just connect that over here. And now that's going to point to our bitnami type of thing here. So just bear with me for a second. We'll go to Amazon lightsail. Now we'll go to. We'll connect the ssh. Just go to make it a little bigger.
There you go. Whoops.
That's big enough.
Hopefully.
Now inside of here I just go into HTDOCs and then the index HTML will be the one that I'm serving on that page right now. So I'll just do like just to show you guys, do vi.index whoops/HTML.
Let's do. What do I do?
Go to the bottom, let's add something.
Here like H1 hello world.
Hello lead fill. Now if I go back to the website at that domain on the bottom I should see some kind of. So it says hello, let fill here. So that is the index that's being served. So if I wanted to serve some kind of like website, let's say like the lead fill website. I think I have it packaged here. Just give me a second. I'll go to GitHub.com done here. Now I'll go to. Let's go to the website. So I think it's in the lightfield.dev.
I go here.
I'll get the HTTPs thing here and then I'll go back.
To here and then I'll.
I'm just going to remove the index HTML for now. I feel like this is the easiest way to do to deploy a website. So let's go git clone. There you go.
And fail choice 17.
Password.
Let me go find it real quick. There you go.
So now I see lead fill site inside of here. So from here I'll just run the NPM install. I think you should fast forward through this part, you know, just installing some packages that we use in the website. So now if I run NPM run build because that's a command inside of the package JSON.
So if we look here, it has.
A build command and I'll just run it now NPM run build.
So it'll.
Build the static react pages. This is the easiest way to deploy a website. So now I think it created a.
Dist folder sudo cpmsr to the htdocs.
So I move it over there. And now if I go to the htdocs folder, it has the index HTML which is going to serve my web page. And now if I go here, I refresh it. I should see the website onto this 527-93975 and now I mean I could point this over into my domain. So I just need to go create record and then the a and I can just do like this.
And then I think you can just.
Put key blank to record. Okay, the root domain and then I can just create the record. This may take bad request invalid. 400 value is not a valid IP address. Oh, I added the HTTP stuff.
Yes, I can.
There you Go create record. So now left field XYZ is going to be pointed to 527-93975 let that happen. Now if I go to left field XYZ Zoo. Give it a second. Yeah, it takes like sometimes it takes a couple hours. So that's going to point to that ip. So you can just go to Leadfield XYZ and it, it's here now the website, if you guys have not joined, it's on leadfield.com and anyways, so we can do this one and that. And then you're probably wondering, hey, this is not secure. You're going to have to add some kind of security. So there's, there's a. So that's the easy way to do things. And then there's. So what I like to do for like the cheapest way to host a website is if you look at my, if you look at our Route 53 at the actual website, theletfield.com go to the hosted zones leadfill.com there are some records here, some MX records for mailing and cname records and things like that. But the A record is actually pointing to something at Cloudfront if you guys see that. So the Cloudfront is what's helping us serve our Amazon certificate. So that's the Amazon certificate manager and you can register for one of those to get the HTTPs symbol on your website. And then I'm serving it over at, let me check here, AWS something called S3 and there's some documentation on how to host a website on S3 if it's static pages. So I have the leftfield.com here and it's serving my index HTML on the assets, very similar to what the lightsail is doing. And yeah, that's, that's how that's working. And then, and then I have that hooked up with the GitHub actions.
I can show you guys probably here.
One more thing. LS clear cd HD docs. Oh no, no, let's go to the.
Make it a little bigger.
LS CD left field site and then LS clear and then you'll see that there's a GitHub file folder and then I have some workflows here. So if I just CD into the workflows and then I just cat deploy. This is my YAML. This is the GitHub action that's connected to the GitHub and it has all my steps to do when I push on, push on a branch. So then it just deploys it automatically. And those kind of tutorials are all over online. And if you don't want. If it is not a static website and need the server running and everything, one other thing you can do is.
Let's see.
Oh, Docker command is not here. One other thing you can do is just run it through Docker. So I'll save that for a different video because I want to stop this. It's getting quite long. But you just do Docker compose YAML and then you'd run the Docker compose file. Docker compose up and it should run the code and that would be done through EC2 and you'd have to change the security credentials there. The steps would be to kind of like start an EC2 server and which is the EC2 here. And you'd start an instance and then you'd open up some security rules for the ports that you want to use and do something very similar there. So thank you for watching. Thank you for making us a part of your day. If you have any deployment stories or anything like that, or tips or tricks or tips, please let us know in the comments. We read all the comments, we'll respond and yeah, hope you learned something.
Thank you.
If I can do it, you can do it too. Coding saves lives.
More from Phil

day in the life of a software engineer | 5 hour productivity | building my dev agency 🔥

day in the life of a software engineer | 3 hour productivity | coding my 6-figure community startup

day in the life of a software engineer | 5 hour productivity | coding our sns startup app LFG

day in the life of a software engineer | 5 hour productivity | creating apps that makes big money






