How to Host a Laravel Livewire Project Using Hostinger VPS Hosting - Laravel Livewire for Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
thanks to hostinger for sponsoring this video are you looking for a reliable and affordable VPS hosting hostinger offers an exclusive Black Friday deal under VPS subscription plan you can get a 12mon VPS hosting plan for just $6.99 per month which is a whooping 63% discount but wait there is more you can also use my code which is code with Ari to get 10% discount on top of the discount that hosting or offers don't miss out on this amazing offer and take your website to the next level with hosting or powerful VPS hosting what's up developer say Dari here and welcome back to the ninth video of my larel life fire video series where we will be looking at how we could deploy our project on hosting or its VPS hosting now what is a VPS hosting a VPS stands for virtual private server which is a web hosting type that uses virtualization technology to create several virtual servers on a single physical server each virtual server works independently with its own operating system CPU and rum allowing users to have more control and customization over their server environment compared to Shared hosting now you might wonder what advantages hosting a Laro application on a VPS hosting has since there are so many different hosting options firstly it includes great control and customization over server environments as each virtual server works independently with his own operating system CPU and rum this allows for more efficient resource utilization and better performance compared to Shared hosting VPS hosting also provides increased security and flexibility with the ability to scale resources up or down as needed now as you might have noticed throughout this entire course we're going to use hostinger as our hosting provider hostinger is a web hosting provider but it even adds more to that you could set up a shared hosting Cloud hosting VPS hosting email hosting and SSL certificates but those aren't specifically the reason reasons why you should choose hostinger since there are tons of other web hosting providers available on the web one of the biggest advantages that vs hosting on hosting or offers is there well let's open it for a moment scroll down to the bottom right here is their storage and processors with The Cutting Edge technology you can experience Rock Solid performance for your Web projects and the best part it's available on industry leading HP and Dell servers spread across four continents you'll have full ownership of your Hardware resources thanks to the industry standard KVM virualization platform so if you got an exciting project idea hostinger has the technology to make it happen secondly hostinger offers lightning fast speed and reliable uptime with their fiber connected infrastructure hostinger offers a blazing fast 300 mb per second network speed this makes VPS hosting a pretty solid Choice when it comes to building e-com Comm merces gaming platforms streaming platforms or pretty much anyone who needs lighting fast website loading speeds finally backups and snapshots at hostinger your data is safe with your automated weekly backups this means that you can rest assure that your data is predicted in case of any unexpected errors or issue but what if you need to perform major changes to your system this is where manual snapshots come in with hostinger you can easily create a manual snapshot of your system at any time this gives you the ability to revert to a previous version of your system with a minutes in case anything goes wrong overall having backups and snapshot is crucial when it comes to VPS hosting with hosting is reliable and easy to use backup and snapshot features you can ensure that your data is always safe and secure now at the moment you will see that I'm located on the official website of hostinger on our VPS hosting packages as you could see because of Black Friday hostinger is offering a a 63% discount so let's scroll down and cover the different packages that they have available now looking at the prices I got to say that the prices are pretty affordable when it comes to hosting if you host a larel project on cloud hosting you most likely pay a little bit less or maybe even the same depending on where you're going to host your project if we take a look at the features that they have to offer you will see that the bottom five right here are on all packages it offers AI assistant it obviously offers full route access it offers a dedicated IP address which basically means that an IP address is assigned to a single virtual private server instead of being shared among multiple servers this has tons of advantages because it allows for greater control and customization over the server environment as well as increased security and flexibility and it finally offers a weekly backup dependent on the price you will receive more bandwidth and bandwidth refers to the amount of data that can be transferred between your website and your visitors within a certain amount of time typically measured in gigabytes per month this completely depends on whatever you need for your application a website with low traffic and small files may be fine with just 1GB or bandwidth but a website with higher traffic or larger files may require significantly more bandwidth to function properly secondly it offers a different nvme disk space nvme e SSD storage is a type of high performance storage technology that uses nonvolatile memory access they also offer a variable of rum and rum stands from random access memory which is a type of computer memory that allows data to be read and written quickly it is a crucial component for running applications and programming on a computer now finally they also offer different vcpu course vcpu stands for virtual censal Processing Unit it's the number of process ensing cores that are available to your virtual server the amount of vcpu cores that you will need will depend on the specific requirements of your project such as the amount of traffic that you expect as the complexity of your application that you will be running a good starting point is to choose a hosting package that offers at least two vcpu cores and then scale up whenever that's needed which kind of brings us to a dubbio the live rer project we created can easily be hosted on a KVM package but personally I would choose using 2v PCU course by default so for now let's choose the most popular package which is KVM 2 let's add it to work cart now right here you can see that we could easier choose to pay for 12 months for a single month which will increase the price significantly and for 24 months now quick note hostinger offers a 30-day money back guarantee which allows you to test it out and see where any type of Hosting suture requirements for now I'm going to choose the 12month deal which will save me $144 and if we scroll down you will see that for the second step we need to create a new account now once you have created your account you can continue on to step number three where you could choose the payment method you will find an overview of the services that you're going to purchase so a KVM 2 12-month plan for $83 but with taxes and everything it will turn out to be $11.49 but right under total you will see that you can add a coupon code so let's click on it and let's add the coupon code of code with Dari and once we click on apply you'll see that we have received a $10 discount and the price for a VPS hosting for one year comes down to $91 and trust me that's a great deal to have for now add your payment credentials right here and I'll see you back once you have created your account all all right after purchasing my VPS hosting I've been redirected to this page where I can start the setup so let's click on start now and right here you will see that it's prompting us with a question asking us to select the location for our VPS hosting the location of a VPS hosting server can and will have impact on website loading speeds and overall performance this is because the physical distance between the server and the user can affect the amount of time it takes for data to travel back and forth so you basically have to select a location closer to your target audience so it will ensure faster loading time and better user experience since I'm currently located in the Netherlands I'm going to choose the Netherlands right here now let's click on continue all right and for the next step it's asking us to choose an operating system there are three options right here and one of them is an option that we're not going to use which is the one to the right because it's for WordPress so we're left with the OS with control panel and a plane operating system now come on we're developers I completely understand that you want an OS with control panel but I personally prefer to use a plain OS so I can use a VPS manager that I want to use to connect later on so in our case let's click on plane OS the next step is for the type of control panel we would like to use and right here we need to select the operating system for our VPS hosting you will see three recommended options but you have a complete list of other options you have Debian Rocky and Ubuntu regarding Linux and Ubuntu they are both operating systems based on the Unix operating system Linux is an open-source operating system that is available in many different distributions while Ubuntu is a specific distribution of Linux the choice between Linux and Ubuntu would depend on your specific needs and preferences as well as the compatibility of the control panel you choose I person personally have always used with Ubuntu and I don't really have a specific reason for that so I just want to stick to that as well so let's click on Ubuntu let's click on continue for the next step we need to set up our VPS host name our root password and we have the option to add an SSH key so we can change our VPS host name we can do that later on let's create a secure root password and I'm going to leave the SSH key option open right now now so let's click on Save and continue it's showing us an overview of what we have selected the VPS location is in the Netherlands the operating system is Ubuntu and the host name is well generated by hostinger so let's finish our setup and this will take a moment or two so pause the video and I'll see you back once that's done all right as you could see we're located on our H panel where you will find an overview of the server on the VPS information tab you will find your dedicated IP address right here the status which is currently running the VPS op time which refers to the amount of time that a VPS has been running without interruption this is an important metric for assessing the reability and stability of a server currently it's nothing since we have just installed our VPS now we have covered the current operating system and the location and the node version now let's click on the second tab which is SSH access you will find information on how you can access your application through SSH and in the final tab which is plan details you will find some information that we have covered before now one pretty cool feature about VPS is that you can upgrade it on the go right at the bottom well in other words it's scalable meaning that you can upgrade your plan without having any trouble this needs to be done right here where you can upgrade your VPS now I don't want to cover everything in my VPS because we need to continue on with the installation part as well which needs to be done through a server manager the VPS manager that I recommend is server Avatar and I'm not going to cover the setup part because it's pretty straightforward just create an account add your payment credentials and you have access to server Avatar I'm simply going to log into my server right now and continue on so pause the video and continue on when you're ready as you could see I'm currently logged into my server Avatar account where I can connect my VPS hosting server like I just mentioned server Avatar is a VPS manager tool that allows you to manage your virtual private server through a graphical interface and I think the screen right now should make a lot of sense for most developers you can connect to a custom server which we need to do but you can also choose between all those other hosting providers then you need to add your details right here you need to select the text tack that you want to use the database type and you have the option to install node makes sense right the typical set up when you want to deploy a larvo application but this time on a VPS server so let's see how we can connect by default the custom option is selected which is the option that we need if we click on digital ocean you can see that we can simply link our account to it but since we're using VPS on hosting eror we need to set it up manually so first we need to add our server name which is the server name that hostinger has generated for us so let's navigate back to our overview let's copy the server name and let's paste it inside the server name field then we need to enter our ipv4 address so let's navigate back to our overview click on VPS information and copy our IP address let's paste it in right here we need to add our root password which will have set when you installed your hosting server but if you forgot it you can simply change the SSH password right here I'm going to leave it empty right now because it is not hidden otherwise you will see my password the port needs to be 22 the text tag that we're going to use is a lamp the database that I want to use is my SQL as well and I'm also want to add node.js to my server so I just cut out the part where I've have added my password so let click on connect now all right as you could see we're connected to our VPS now the installation part might take a bit so once again pause the video and I will see you back once this is done all right as you could see our environment has been set up and there are so many configurations you could see and configure right here from databases to server loads to memory usage swap memory application users and way more I can't cover these all so I want to continue on by setting up our project I want to deploy my project through git so let's click on back to servers because I want to click on Integrations right here because I want to deploy my project through git so let's click on git where right here you can link your GitHub account so let me actually quickly delete the previous one that I had all right now once again let's click on link GitHub all right as you could see my account has been successfully linked to server Avatar the next thing that we need to do is to create a new application so let's first click on our server let's open the server let's click on applications in the sidebar and let's create a new application so I'm going to make a test domain where my application name will be hostinger Livewire the test domain will be hosting our live wire as well we need to select a method in how we want to deploy our project into our application so we just linked our GTO repository and I have added my project in git so the most obvious reason for me is to use the git option then we need to select the provider which will be GitHub in my case the repository type for me at the moment is public so let's click on public click or we simply need to clone the https URL so if we navigate back to our repository click on code say htps copy it navigate back to server Avatar paste our htps URL right here select the branch that we want to use which in our case will be Master as well now we can add a deploy script right here but I simply want to continue on because it's a simple deploy so let's let's click on create application whoops I think I just made a mistake I had to add a dash right here all right create application well apparently I need to enter the branch as well I thought the default one would be Master create an application all right it's finally loading meaning that we did something right all right it has prompted us with a message saying our git application has been cloned successfully but if we think about it for moment there are some steps we have missed right we haven't created a database and we most definitely haven't set it up so the way we could do that is clicking on file manager in the sidebar let's scroll down for a moment open the public uncore HTML where you will see that our larvo application has been cloned successfully because well I'm actually seeing a larel project right here so the next thing that we need to do is setting up a database and and adding the EMV file for the credentials let's navigate back to our application let's click on databases in the menu and let's click on create a new database so the database name that I want to give it is hosting _ lifewire I'm going to set a custom username and password where I'm going to copy the usern name and I'm going to keep it as it is and I want to give it a password of something very Secrets now let's click on create a database and give it a moment as you could see we have impr prompted with a message saying that our database has been created successfully so what we could do right here is navigating back to our server open our application click on the application that we have cloned open the file manager scroll down open the public unor HTML and I'm actually going to toggle the show hidden files checkbox because I need the. example file right here so the first thing that I want to do is selecting it and I want to rename it Tov let's open it and let's change up a couple credentials the database name was hostinger lifewire the username was the one that I copied and my password was test 1 2 3 4 explanation mark then we need to change the application name which is hosting or Live Wire and let's actually open a new tab for a moment because we need to set our _ URL as well which you will see as our primary domain right here so let's copy it navigate back to the file editor paste it right here now let's scroll down and or up excuse me let's click on Save changes give it a couple seconds all right right let's save it if we open a new tab and open the URL that we just copied you will see that we have been prompted with a forbidden message this is happening because larel doesn't really understand our project structure and we can change that by creating a new hidden file inside our project named HD access so let's open our file editor again let's go back open the public oncore HTML folder again let's create a new file let's name it HD access all right give it a moment let's toggle the show hidden files let's open the that HD access file and right here I'm going to paste a piece of code which I will add as a comment as well since it is very easy to make mistakes within HD access file so just follow along or copy it from the comment or for my repost story so let's save the changes click on yes I'm sure navigate back to our local host and refresh it you will see that we have received a 500 error and I can tell you why if we navigate back to our file editor for a moment and go back once again open the public HTML show the hidden files in the EMV file you will see that our app key has not been set and that's why we can't open our project so what I recommend to do is simply navigating back to our H panel overview copying our IP address navigating to the terminal say SSH the user root at the IP I do want to use a fingerprint so let's say yes my password is a password that I have added myself and as you can see I have been connected so what I need to do right here is change directories into my home directory if I perform an LS you will see a codee withi directory so let's say CD code withi if we perform another LS you will find the directory that we have created ourselves so let's say CD hostinger another LS open the public directory perform another LS where you will see a larel project so pretty straightforward right here let's say composer update all right it's installing all packages that are required then we need to run the PHP artisen key colon generate command finally we can run the PHP artisen optimized colon clear command once we navigate back to the browser we are right here you will see that our project has been opened inside the browser now this was it for the final video of my live for your video series once again don't forget to use my discount code of codari when you're going to subscribe to a new to a New Black Friday hostinger plan where you will get an additional 10% discount if you do like my content and you want to see more leave this video a thumbs up and if you're new to this Channel please hit that subscribe button
Info
Channel: Code With Dary
Views: 1,356
Rating: undefined out of 5
Keywords:
Id: qbfMs4V7Gws
Channel Id: undefined
Length: 23min 12sec (1392 seconds)
Published: Fri Nov 17 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.