Deploy Angular Application On AWS EC2 Linux Server With Nginx Configuration

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello welcome to my YouTube channel in this video we are going to discuss how we can deploy angular application on AWS so let's start first of all we need to discuss our agenda we need to follow all these six points to complete our deployment first of all we will create ec2 instance then we will create build of our angular project then we will connect with ec2 instance via SSH then we will transfer our build from local machine to ec2 instance okay then we will set up nginx and some paths okay then we will do testing and we will check our website in browser okay okay let's start with our first task which is to create ec2 instance okay so first of all if you don't have AWS account you can create AWS account okay then you need to get it Linux based ec2 instance okay then you need to some set some security groups and then we will connect with the SSH okay so let's move with our Point number one foreign before we start creating our awscc2 instance I want to tell you that we are going to use this article we will follow this article along with our video okay there are some steps and some commands are written in this article so we will use this article it will help us to execute our commands and process very quickly okay I'm on my AWS dashboard so you can also go to ec2 you can just type ec2 instance and then it will just enter ec2 and then you will be on the ec2 dashboard okay and it will be look like this then you need to just launch an instance you need to just click on launch instance so I'm going to create Linux base ec2 instance thank you okay let me give a name angular demo then we need to select machine so it's automatically selected Amazon Linux machine okay then we need to select our instance type so we will keep it default then we will need to create a Pim file it we will use it for connecting with our ec2 instance via SSH I will give a name okay I will just download it okay okay so then we need to uh set up this some security groups okay then we need to just click on launch instance okay we can see our instance is ready so I can go to the dashboard I can see it's being started so it will take one minutes so it will be ready okay our AWS ec2 instance is ready so let's start with step number two okay so this is our step number two what we will do we will create our build okay and then we will just copy our build so we can go to our article and we can follow the furthest apps from there okay as we are done with our ec2 instance setup so we will move to the step number two so first of all we need to connect with the pem file with our ec2 instance using the Pim file okay so you need to just run these two commands so where you can find commands let me show you okay you have to come to your AWS ec2 dashboard and then you need to click your instance and then you need to select as I said client so we will use this command and this one so I will just copy this command and I will go to my terminal and I will execute this and then second I will execute this command okay so then I will be able to connect with my ec2 instance for this make sure you are in the same directory where your Pim file has been downloaded okay so let's move to the terminal okay so I will just paste my first command okay because I am in not in the same directory where my Pim file is so what I will do I will go to my directory so I can execute the command okay it's very simple okay okay I just copied and then I will paste it here yes okay you can see we are connected with our Linux ec2 instance okay so let's follow the next steps okay as we done with our uh instance connection so let's move to the point number two we need to copy our project build and we need to place it in ec2 instance for this if you have not created your build you can use this command to create your angular project field okay then you need to use this command and then copy the build to the ec2 Strand so I will show you this okay you can see this is my ec2 instance and this is my local okay so I will copy the files from local terminal to the ec2 instance okay so what I have to do I have to go to my project okay so this is my folder for build so what I will do I will just copy it if you don't have the build you can just use NG build command to create build okay I have already so I will just copy this build I will copy the path okay and then I will just move to the article okay it's okay so I will use this command and I will replace the path okay you have to just replace your Bim file path okay and then you have to place uh the path where your files exist okay and then you have to just uh replace the path of your ec2 instance so I will just uh change these paths so you will see how you can do as well foreign [Music] okay first of all you need to copy this path okay and then you need to go to your terminal okay then you have to just replace this okay I will first of all cut this okay so I have updated then you have to update this path okay this is the path so I have already updated this path you need to just replace your build path with this okay this is a build path okay of the build path you need to just add the star okay and then you you can see this is a build path okay and this is our ec2 SSH key okay we have replaced this and we copied from AWS okay and then this is our uh Pim file path okay I will just update it because the name is different so I will just update it and Google them okay so I am done I will just hit enter so it will copy all the files from build and it will replace it on my instance okay so if I show you here you will see there is nothing so I will just click hit enter okay it's starting copying the files so it will hardly take one to two minutes so it will copy your all Bill files to your terminal your ec2 terminal so you can check from easy to terminal then all the places all the files will be on AWS so let's wait okay we can see uh all the files are copy so we can just verify I will go to my ec2 I will just type LS so you can see the build folder is copied okay okay so we are done with our this path we have done uh build and we have copied so let's move to the sub number three so now we will need to set up our nginx okay so and then we will test our project okay so let's uh go to the article and we will follow next our article and and then we will finish our further remaining task okay so as we are done with our build files copy to our ec2 instance so let me uh step by step run these commands first of all I will update my system then I will install nginx Okay and then I will start engineering so I will confirm that nginx is started working okay okay let me copy first two commands so I will run these two commands together yes okay it's updated and then I will copy the next command let me confirm again if nginx is installed not okay extraordinary something is sort of young and small nginx okay let me okay let me copy this yeah this is our next command so you can also copy this from article as well this is yeah this command we need to run this is this will not work okay so we need to just copy this and okay so nginx is installing I will go and copy the next command okay we will start nginx okay nginx is started so we can confirm that nginx is started or not so I will just run this command to check the status the nginx is started or not okay so we can see nginx is running so we can confirm it in our browser as well you need to just go to your browser and you need to just copy your IP address and place in your browser okay I will just copy my browser and I will place in the browser okay I have just copied so let's see nginx is installed or not okay we can see nginx is installed okay good so let's move to our next remaining steps okay as we are done with our nginx setup so then we will need to update one file which which is nginx configuration file okay when we will update this file then we will be done with our almost a configuration and then we will just give some permissions and then we will test the website okay so you need to run this command so then you can updates few lines okay so if I okay you need to go to locations so yeah there you need to add okay so okay we need to insert few lines I will just hit enter okay so let me tell you which lines you need to copy okay this line is already there okay so if it's not there then you can also place this okay so I will copy these lines okay and then I will replace there okay I will just make sure thank you okay yeah we are done so let me save this file Okay so nginx configuration file setting is done then move to our next tab okay we need to give some permission to our build okay so then nginx will entertain our website so we will be able to access okay so you need to just step by step copy these first of all copy this first command and then directly go and paste it okay so you can see our user has currently uh no uh permission so we will give permissions using these commands okay so I will copy the next command to give some permissions okay and then I have to just replace my build name which is web okay I will hit enter okay then I will need to copy the next command which is this one it will assign the permission to our build folder okay then we can test confirm the permission or given or not okay so we can see the permission is given okay okay so we are done with this as well so you last you need to just run this command to reload the nginx because we have updated nginx file okay and then last you need to copy this and just run this command oh you need to go to again okay so we are done with our configuration and generic setup everything so let's uh move to the browser okay you can see our website is now live okay we are super duper we are done okay so now let me show you something okay as we are done with our deployments you can further you can follow me on YouTube medium GitHub okay and you can ask any query if you have you can comment below okay I will also place this uh medium article link to my description so you can also use it okay so thank you for watching my video and don't forget to subscribe my channel thank you goodbye
Info
Channel: CodeWithMuh
Views: 5,465
Rating: undefined out of 5
Keywords: deploy angular application on aws, deploy angular application on linux, deploy angular application on nginx, deploy angular application on ec2 instance, deploy angular build on aws ec2 linux instance, deploy angular application, deploy angular project, deploy angular project in azure, dep, deploy angular application in nginx, deploy angular application in aws, deploy angular application on linux server, aws, ec2, linux, angular, build, linux server, muhammad rashid, devops
Id: wlmRcOi1kaU
Channel Id: undefined
Length: 18min 25sec (1105 seconds)
Published: Mon Dec 05 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.