Тёмный

Easily Deploy Full Stack Node.js Apps on AWS EC2 | Step-by-Step Tutorial 

Sam Meech-Ward
Подписаться 85 тыс.
Просмотров 47 тыс.
50% 1

Learn to deploy a Node.js or Bun app connected to a PostgreSQL or MySQL database on AWS EC2 Ubuntu Instance. This video covers the setup of a continuous background run for the app using SystemD, and setting up a reverse proxy with Caddy for handling HTTP requests and SSL certificates. Finally, I show how to configure a custom domain with AWS Route 53 for easy access and SSL security.
Chapters:
0:00​ Setup EC2
3:10 Connect using SSH
4:55 Update Ubuntu
6:06 Install Node/bun
7:26 rsync code to server
10:25 Run Node.js App
12:40 Modify Security Group
14:18 Install Postgres/MySQL
17:47 systemd
22:56 Caddy server/reverse proxy
25:35 DNS & SSL
28:09 Summary
Help support me make more videos: ko-fi.com/meechward
🔗 Code Snippets: www.sammeechward.com/deployin...
🔗Moar Links
My Website: www.sammeechward.com
Instagram: / meech_ward
TikTok: / meech.s.ward
X: / meech_ward
Threads: www.threads.net/@meech_ward
Github: github.com/orgs/meech-ward

Наука

Опубликовано:

 

6 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 123   
@nasrularif9570
@nasrularif9570 3 месяца назад
Finally a video from A to Z... Most video of AWS tutorial I found start from Y to Z...
@govinda399
@govinda399 11 дней назад
true!!
@astronautonmars
@astronautonmars 4 месяца назад
Your videos are always straightforward and I absolutely love them 🥰
@and_ppv
@and_ppv 4 месяца назад
Stumbled upon the video, and watched the whole thing - at normal speed and rewinding along the way. Great material
@cashamigos
@cashamigos 3 месяца назад
this is exactly what I was looking for. After taking notes I am excited to practice this many times to ensure foundational knowledge. Awesome stuff!!
@ScriptCodec
@ScriptCodec 4 месяца назад
Ive been waiting all my life to understand what my boss had me do my computer via Google cloud run 😅. This is a hrll of a revision. thanks man.
@bigbadcatbigbcy2933
@bigbadcatbigbcy2933 Месяц назад
Thank yo so much for this tutorial. This is the only working tutorial in the internet and explains everything so good and it only takes 28 minutes
@yanfung9081
@yanfung9081 4 месяца назад
You always deliver an amazing RU-vid tutorial for the viewers! Your explanations are always spot on! Thank you so much!!! :)
@TimothyHuey
@TimothyHuey Месяц назад
Your video was very well done. I was able to deploy a nodejs webapp on my first attempt. Your 30 minute video took me about 7 hours to complete and I was filled with dread when you said at the end that you had a short 7 minute video explaining how to buy a domain name. I knew that was gonna take me 30 mins to an hour. But time is not an issue, understanding is, when it's your first time. I invested the time to thoroughly understand your instructions and deploy the app. It went off well and my app is up now and ready to be tested by users. Well done!!!!
@AlfredoGuako
@AlfredoGuako 2 месяца назад
this was incredibly helpful, got my first custom domain web app running!
@devaa7076
@devaa7076 4 месяца назад
Woahhh...Woahhhh. What a great tutorial sir!. I was thinking to learn how to host a server in cloud and what is ssh what is reverse proxy how to map domain name to our server...like man i got all the answers in a single 30min video. Thank you so much for producing these high quality videos and keep on doing em! Hats-off.
@tuscala
@tuscala 4 месяца назад
Man, this is the greatest tutorial video that I've ever seen!
@SamMeechWard
@SamMeechWard 4 месяца назад
Thank you 🤗
@Beyram1501
@Beyram1501 3 месяца назад
Man your videos are amazing and really clear. you gained a subscriber. Thanks
@georgemwaniki
@georgemwaniki 14 дней назад
Your way you explain things makes you one of the best tutor i know, Thank you so much
@user-iz2ge2fl4x
@user-iz2ge2fl4x 2 месяца назад
Thanks so much, your way of teaching makes things simpler. Waiting for more videos 💫
@ApeToot
@ApeToot Месяц назад
Got my first "Full Stack" data analysis app up with this video. You helped connect a lot of dots that were not connected by amazons documentation. Thanks!
@SamMeechWard
@SamMeechWard 29 дней назад
Glad it helped 🤗
@armaandhanji7151
@armaandhanji7151 4 месяца назад
Fantastic walkthrough!
@SamMeechWard
@SamMeechWard 4 месяца назад
Fantastic comment!
@samyip
@samyip 5 дней назад
Brilliant tutorial !!
@michaelzinzun-zu1py
@michaelzinzun-zu1py 12 дней назад
I've been looking for straight forward instructions for months. Thanks to you My site is hosted. Still need to figure out how to install and configure a MongDB database
@khashe
@khashe 3 месяца назад
This was really great.
@ShreyasSreedhar2
@ShreyasSreedhar2 Месяц назад
Super helpful, Thanks!
@manuel.blanco
@manuel.blanco Месяц назад
Thanks, this helped me a lot!!
@yemam4156
@yemam4156 Месяц назад
Thanks bro a lot for this tutorial
@JunaidAzizChannel
@JunaidAzizChannel 4 дня назад
Insane value!!
@youssouf.abachouch
@youssouf.abachouch Месяц назад
the best tutorial, thank you so much
@courtneynel7433
@courtneynel7433 3 месяца назад
This is a really great video.
@bigbrain720
@bigbrain720 Месяц назад
broooo this video is so solid
@quangtranoannhat2930
@quangtranoannhat2930 4 месяца назад
awesome !!! love this content
@ecko3383
@ecko3383 2 месяца назад
You are incredible kind sir. Thank you for this
@SonAyoD
@SonAyoD 4 месяца назад
Great plugins thanks!
@ImpendingSole13
@ImpendingSole13 4 месяца назад
You're amazing. Thanks alot !!
@endfine9230
@endfine9230 18 дней назад
Thank you!
@rangaswamireddy8683
@rangaswamireddy8683 4 месяца назад
Fantastic the way you explained. And i request you make a tutorial on pm2 load balancer etc... thanks
@XavierTheRapper
@XavierTheRapper 2 месяца назад
Dope!!!!!
@thequang9234
@thequang9234 4 месяца назад
top notch content Sam! Would you care to explain what you meant by 'I have a migration system on my app". Why did you have to run npm run migrate? Thanks!
@Tubee1234
@Tubee1234 3 месяца назад
really amazing tutorial
@kjsharp
@kjsharp 3 месяца назад
Fantastic video
@dekooks1543
@dekooks1543 4 месяца назад
banging video mate ! Do you mind if I ask what software you use to edit your videos ? The transitions and zoom effects are top class
@SamMeechWard
@SamMeechWard 4 месяца назад
I use a few different pieces of software, but my main video editing is done in Camtasia. It's pretty easy to use and all the basics are covered in their intro 45 minute video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AE1Hfy-yw4s.html
@ustav_o
@ustav_o Месяц назад
absolute legend
@valtronicsza
@valtronicsza 5 дней назад
Thanks!
@erlend1587
@erlend1587 4 месяца назад
Great tutorial! I did something similar using Linode, but used nginx instead of Caddy. Caddy seem like a simpler choice with the automated ssl.
@SamMeechWard
@SamMeechWard 4 месяца назад
I only recently started using it, but it's been awesome and I trust the community behind it
@ervispojana118
@ervispojana118 Месяц назад
Thank you !!!
@solo-yl8uc
@solo-yl8uc 2 месяца назад
thank you so much.
@omarabdelrahman180
@omarabdelrahman180 14 дней назад
Fantastic
@anjanshomodder6463
@anjanshomodder6463 4 месяца назад
Really helpful video. Would be nice if you could create a video about how to automate all these stuff with github actions. Thanks
@dianab536
@dianab536 6 дней назад
Can you please make video setting up Nginx to Nextjs? Definitely an insightful video, thank you for introducing me to caddy. 😊
@AdarshMadrecha
@AdarshMadrecha 2 месяца назад
Can you do a follow-up video, just covering changes required if using Bun instead of Node Js?
@elitdesign3867
@elitdesign3867 4 месяца назад
Awesome job! thank you. What about MongoDB and nginx, I hope you explain that someday. Another question, please: How can I get the client's IP (remote ip)?
@noahmilliken4259
@noahmilliken4259 4 месяца назад
can anyone explain to me how the server file and the react app both run? I am having a lot of troulble starting my vite app in the front end directory and the server from the systemD command?
@somnathgolui2912
@somnathgolui2912 3 месяца назад
Great video! Can you also tell us how to do continuous delivery?
@andreabiaggi3198
@andreabiaggi3198 4 месяца назад
Awesome job! Would be great to see how to move from this infrastructure to one more scalable, with a dedicated RDS instance, a load balancer and maybe different ec2 instances for different microservices, maybe using terraform. But as you said this is foundational and it's very well done!
@truth8690
@truth8690 4 месяца назад
great
@SamMeechWard
@SamMeechWard 4 месяца назад
Thanks for watching! I'm glad you enjoyed it.
@MilindMishra
@MilindMishra 4 месяца назад
quick question can we not add our git credentials to the server and then use them to pull changes and deploy from the server or if that is not a standard practice ?
@jcarneiro91
@jcarneiro91 21 день назад
if i already have a .env on my project directory to be consumed by my node app I still have to do the env variables part for systemd ?
@EmanuelCovelli
@EmanuelCovelli Месяц назад
I really would like a similar tutorial that uses Docker on ec2
@HenryOsim
@HenryOsim 4 месяца назад
great video thanks. Can you create a video about doing same with Terraform please?
@SamMeechWard
@SamMeechWard 4 месяца назад
Thank you. That's a bit more of a challenge because terraform isn't really used for single instance configuration. You would end up using something like packer to create an ec2 image of the node app, then use terraform to create a new instance based on the image. Terraform is used for immutable infrastructure, which this is not. However, I do have a series of videos on how to use terraform and packer for this kind of stuff, but you'd end up with many ec2 instances instead of just one.
@Benjaminmcp0
@Benjaminmcp0 23 дня назад
Hi I'm new to AWS cloud computing, could you explain why you used EC2 rather than AWS amplify in this instance :)
@WIBEDRILLMusic
@WIBEDRILLMusic Месяц назад
Hi Sam, can you make one video for the Serverless approach??
@marioshadj8409
@marioshadj8409 4 месяца назад
Thanks for the video! Can you make a video on how to handle new version of the app without downtime?
@SamMeechWard
@SamMeechWard 4 месяца назад
With one server, you wold always experience some amount of downtime. It could be minimal though, just the amount of time it takes to restart caddy, so a few milliseconds. The only way I know of to get absolute 0 downtime is to use multiple ec2 instances with a load balancer, which is much more complex
@DheerajKumar-ik4mi
@DheerajKumar-ik4mi 3 месяца назад
Have you put the frontend requests to localhost or a specific IP?
@charithlakshan8382
@charithlakshan8382 4 месяца назад
this might be a dumb question. instead of copying your files from the local machine to the remote machine. you can install git on ec2 and pull from repo ?
@khaledsanny4817
@khaledsanny4817 4 месяца назад
Yeah but it's too much hassle just for this video. You will have to create and delete the repo
@israelafangideh
@israelafangideh 4 месяца назад
Yes, you can
@snakefinn
@snakefinn 3 месяца назад
I imagine that there will be some files that won't be located on the repo you may want to copy over. For example .env files
@austinm8823
@austinm8823 2 месяца назад
​@snakefinn but he didn't copy over the .env files using rsync either lol.
@switchlyrics.
@switchlyrics. Месяц назад
imagine u lose ur git account
@marvellousadesanya8480
@marvellousadesanya8480 3 месяца назад
Any alternatives o rysnc? Does not work on git bash
@bigdinorino
@bigdinorino 3 месяца назад
at 9:56 how do you go to my app git(main)
@jitx2797
@jitx2797 4 месяца назад
Wow this is good. I have questions and suggestion. Does that systemd replaces the use of pm2? Why didn't you use pm2 Suggestion: Moving forward with this with setting up basic testing and CI CD.
@KratosCY
@KratosCY 2 месяца назад
Good question and suggestion.
@jitx2797
@jitx2797 2 месяца назад
I am currently using pm2...For CI CD I found this ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-fkzpywlJcMA.html@@KratosCY
@sunilmaurya6594
@sunilmaurya6594 4 месяца назад
Can u please make video on automatic things? Would be appreciated 🙏
@lebronjaimeslannister
@lebronjaimeslannister 4 месяца назад
thank you for the vid, would you explain how to protect ec2 against something like ddos? i’d like to try ec2 but in fear of overcharging by aws
@SamMeechWard
@SamMeechWard 4 месяца назад
ddos wouldn't increase the cost of a single ec2 instance like this. It would grind your app to a halt, but no additional costs. I'm pretty sure all services, including ec2, are protected from basic ddos attacks with aws shield aws.amazon.com/shield/
@amansagar4948
@amansagar4948 Месяц назад
12:32 i clicked the "open address" from AWS console rather than copying the address so it was opening the app in https not http and i was unable to access it. I was stuck on this for a day
@haha7836hahah
@haha7836hahah 4 месяца назад
How can i setup the database so that it is in a private subnet and can be accessed only by the ec2 instances within my vpc
@P.Shivakrishna
@P.Shivakrishna 2 месяца назад
hey can you explain more about migrate postgres sql db into ec2 how to create migrate.ts file and other things
@programmer9809
@programmer9809 2 месяца назад
👍
@fahadahad2815
@fahadahad2815 25 дней назад
hey i am unable to copy my folder from windows to ubuntu. I got the public key and invalid hostname error. Any solution?
@MilindMishra
@MilindMishra 4 месяца назад
Great work! but isnt pm2 a better practice instead of systemd ?
@MilindMishra
@MilindMishra 4 месяца назад
latter in the video i understood the mindset of you teaching the basics first so it makes sense, thank you!
@MKtechnoverse
@MKtechnoverse 24 дня назад
Bro how much it could cost for storing Mern stack
@ramendrasoni3368
@ramendrasoni3368 24 дня назад
Can I host many websites on single EC2 instance
@Jeremiahking101
@Jeremiahking101 2 месяца назад
I have an App.js running on port 3000 and a Server.js (Backend) running on port 5000. How would this work?
@kincaidschmitt7811
@kincaidschmitt7811 2 месяца назад
+1
@vikneswaran6186
@vikneswaran6186 Месяц назад
I am assuming that you are having your app.js using server.js files , so that eventually it is able to connect to it how it connect on local computer , because you could see that it is still now being running on local host 3000 so that would be able to access the 5000 port server running on it .
@spare4337
@spare4337 3 месяца назад
Can u create SSR on aws with React
@solo-yl8uc
@solo-yl8uc 3 месяца назад
are these all free within free tier usage?
@UcheagwuOnyike
@UcheagwuOnyike 4 месяца назад
Can you share the codebase? Would you like to do some practice? I can't find it on your Github
@martinoveer9483
@martinoveer9483 3 месяца назад
OCD speed?
@ayushgursal1627
@ayushgursal1627 2 месяца назад
It asks for password if i do chmod 400 so what password should i write there for that instance
@leanderchristmann2981
@leanderchristmann2981 4 месяца назад
Note on 19:18 that if you installed Node.js differently, like via the NVM Node Version Manager, you have to set different ExecStart path in the .service file - or else you'll receive an error "Active: failed [...] Process: .... ExecStart=/usr/bin/node index.js (code=exited, status=203/EXEC)" when doing "sudo systemctl status myapp.service".
@ichigokuro3986
@ichigokuro3986 3 месяца назад
what changes are to be made?
@astb01
@astb01 4 месяца назад
Wouldn’t it be easier to just dockerize the application and use docker compose on the ec2 instance by using ansible? Feel it would be much cleaner to build images and bundle them into a compose file 🤔
@SamMeechWard
@SamMeechWard 4 месяца назад
Docker makes some things easier and some things more complex. My issue with docker is that there's a learning curve in the beginning, in order to use docker, you have to learn docker. And in the end, you still have to understand how VMs work. So I avoid using docker or teaching with docker, unless it's absolutely necessary.
@rduballday
@rduballday 4 месяца назад
Hello , can you point me to the code for this tutorial?
@purplemoon-media
@purplemoon-media 4 месяца назад
is it okey if I add source code via github ?
@abdulganiyuzziwa8555
@abdulganiyuzziwa8555 Месяц назад
😆😆Dude u actual have a DRIZZLE folder are you in the movement too🤣🤣🤣woow
@prayaspatel6325
@prayaspatel6325 3 месяца назад
Don't mind me brother, you look something like Eliot Anderson
@phantazzor
@phantazzor 4 месяца назад
can you migrate to t2.small later on ?
@SamMeechWard
@SamMeechWard 4 месяца назад
Yes, you just have to stop the instance first.
@hotwings9382
@hotwings9382 2 месяца назад
Couldn't this be done inside nginx?
@austinm8823
@austinm8823 2 месяца назад
Did you watch the video? Honest question. He addresses that he normally would use Nginx.
@vernevens1598
@vernevens1598 2 месяца назад
We use AWS to insure more food shortages and plandemics.
@yiannis_p
@yiannis_p 3 месяца назад
Yall never heard of git and docker ?
@canadahq6926
@canadahq6926 2 месяца назад
😂
@yazanalzubi5446
@yazanalzubi5446 2 месяца назад
Do you have any courses that I can buy? Please take my money
@user-lx6lp3jg2c
@user-lx6lp3jg2c 3 месяца назад
Please show the same detailed video, but deploy the finished project in Amplify + Lambda
@SamMeechWard
@SamMeechWard Месяц назад
Honestly, I avoid amplify at all costs. My recommendation is to try SST.dev
@namesare4fools
@namesare4fools 4 месяца назад
this is far from easily, why are you not using SST
@SamMeechWard
@SamMeechWard Месяц назад
I love SST, when I want a serverless environment
@pruthveshshetkar1263
@pruthveshshetkar1263 2 месяца назад
Thanks!