Deploy Laravel to Shared Hosting With Mysql And FREE SSL – The EASY Way! | Laravel 9 Tutorial

If you wanna learn today How to Deploy Laravel to Shared hosting server, Launch MySQL Database and connect to Laravel project and install free SSL Certificate, You are in the right place.

🔔 Get 73% discount 😍 from SiteGround for web hosting 🔔
https://www.siteground.com/go/zmzbi0zdv2

In this laravel 9 tutorial, I will share with you the easy way to Deploy laravel to shared hosting:

– Prepare laravel project for uploading (Create zip file and sql dump file)
– Uploading files to Shared-Hosting server
– Fixing Laravel domain url
– Connect To MySQL database
– Set FREE SSL Certificate (HTTPS)

Feel free to follow for more amazing aws tutorial

http://www.youtube.com/channel/1UCKoRFn8Id1YUOa65uLSDBkg?sub_confirmation=1

======= Deploy laravel to shared hosting Step By Step ======

[00:00] Intro – Deploy laravel to shared hosting
[01:35] [Step 1]: Prepare laravel project for uploading
[03:02] [Step 2]: Uploading files to Shared-Hosting server
[06:44] [Step 3]: Fixing Laravel domain url
[07:58] [Step 4]: Connect MySQL database
[11:14] [Step 5]: Set FREE SSL Certificate (HTTPS)

============= Topics covered include ============
– Laravel Deploy
– Connect laravel to mysql database
– Install free ssl on shared hosting

#Laravel #Hosting #Deploy


If you want to learn today how to deploy laravel 
project to a shared hosting connect to mysql   Database and install free ssl you are in the 
right place so stay tuned we are about to start   And feel free to follow for more amazing tutorial 
about laraval okay welcome back guys i’m so happy   To see you today i’m going to show you how i’m 
taking my local laravel project and uploading or   Deploying to share hosting it’s very easy very 
straightforward and if you guys don’t know how   To install your own laravel on your own computer 
you can follow my youtube video that i did a few   Weeks ago about how to install laravel on your 
local computer and also how to create your first   Skeleton with laravel breeze also everything in my 
youtube and this is basically what you’re getting   If you follow those two video you’re getting a 
local laravel project with a login authentication   Login logout and a dashboard a beautiful 
skeleton to start with everything is working well   So today i’m gonna show you also how you can 
take this local project if if it’s on your   Computer or if it’s from git how you can compress 
it and upload it into a shared hosting i’m gonna   Use siteground siteground is one of the best 
website hosting or web hosting they have amazing   Customer service compared to other shared hosting 
companies i’ve been in the past i love them and   They help me a lot they increased the speed of my 
website and it’s very easy their so simple to use   So if you guys ready let’s start so the first 
step for today we’re gonna prepare our file for   Uploading so we’re gonna take our local project 
and we will compress it to a zip file very simple   Right so if you guys have your file on github 
or any other git you can download the zip okay   Download it to your local computer and i’m also 
gonna export my mysql database with all the table   That i created in my recent video about laravel 
breeze okay this is like i have like a few tables   I’m going to take them and basically 
create a sql dump so i can upload it   Later to my mysql database that i 
will set on the web hosting service So if you guys using the 
table plus you just need to   Choose all the table and press export i’m 
going to use the sql option and export I’m going to save it to the 
same place that i save my   Valet project so everything’s 
going to be organized in one spot   So i have the project i have the zip file 
of the project and i have the mysql dump Okay perfect step one completed as you see 
it’s very fast and very easy so we have all   The files so now what i’m gonna do i’m gonna go 
to my shared hosting server to siteground i’m   Gonna login to my account if you guys don’t 
have an account you can uh follow the link   In the description below and basically open your 
account with a 73% discount for the first year   Is very affordable and it’s very cheap compared 
to other hosting so what we need to do we need   To create empty websites so i’m gonna press on 
new website and i’m gonna create a temporary   Domain because i don’t have a domain but if you 
have a domain you can choose different option  

Okay this is my temporary domain it’s under my 
name with a domain of the siteground hosting   I’m gonna use start new website and 
i’m gonna skip and create empty site We don’t need this scanner so we can skip it 
and basically it’s going to take few seconds   But I just got it in the video so as you 
can see now we have our website without so   It’s at the moment under construction and we 
have the cPanel okay side gone have a very simple   CPanel that you don’t need to go to go and losing 
yourself there it’s very simple you can look   How the design is flowing and you 
can find everything in the left menu   So you have the site you have the file manager 
you have the mysql you have the security where   You define backup ssl that i’m gonna show 
you very very soon you have the caching   You can you can set a caching and even memcache 
dynamic cdn you have the domain if you have sub   Domain park domain you can also open an email smtp 
account and you have also the option to use git   And basically connect to your server to the site 
siteground server and and run any code that you   Want to run like you have your own virtual private 
server so let’s review the directory so basically   This is the main project the main hosting world 
is where is my hosting found and i have the public   Html so i’m gonna upload now the zip code that i 
created of my project i’m gonna upload it to the   Main folder and our purpose basically now is to 
extract the content of the zip folder the zip file Will take few seconds and then what we need to do   First of all of course delete the 
file because you don’t need it And now what you want to do you want 
to take the inside of the folder of   Your project and just transfer 
it or move it inside public html Okay so you can have your project name then you’re 
gonna have public html and then you’re gonna have   Example app or your folder name that contain 
all the laravel files so now as you know laravel   Index.php it’s inside public folder so in order to 
reach it we’re gonna do the domain name and then   We’re going to do the folder name of our project 
and then we’re going to do a public and as you   Can see we uploaded the file to shared hosting 
server and it’s take us like less than five minute   But now we need to fix the URL of the domain url 
so when we’re gonna press the domain name we’re   Gonna get immediately our reliable project so 
the first step what we need to do we need to copy   All the content we have in the public 
directory and we need to move it or copy it to   Public html directory so it will be at the 
same level where is your laravel folder   Found okay so we have your label folder and you 
have also all the content in the public at the   Same directory level next thing we need to update 
the index.php that we just copy or remove and we   Need to change to line this is the first line we 
just need to add our project name to this line   And also in line 47 we need to add our project 
name so the index redirect will know where is the   Index file found and as you can see now it’s 
working and we have a lag of a file a project that  

Is also inside the ground on shared often but when 
i will try to login there is no mysql database so   How we will solve it are we basically launching a 
new mysql database so you will see with siteground   Is very simple just with a few click you’re gonna 
have your uh mysql database so first of all let’s   Open our .env file because we need to change all 
this mysql credential we need to update those data   And then let’s say opening a 
new tab let’s open the mysql   Page and let’s create new database as you see 
it’s very simple it took me like few seconds   Now let’s copy the database 
name and pass it to the n file And now let’s create a user we need 
to add a user to mysql database   So you press in here and you have create 
user so we created the user us something   Okay let’s copy it name and transfer it also 
to the end file i love to use the double quote   So i’m not gonna have any issue when we need to 
do the login to the mysql with laravel itself   But you don’t have to and now let’s attach our 
user to the mysql database that we just opened   Okay so they are attached and now i’m gonna 
create or change the password the default password   And i’m gonna add it to the n file and basically 
we done with the n file we just need to save it   Perfect we did first step and now remember that we 
created a zip file not the file sorry uh sql dump   With our calling table so now we’re gonna upload 
it to php in my admin as you have in every c panel   We’re gonna go to our database 
and then we’re gonna press import   We’re gonna upload the sql dump that we 
created few minutes ago and after a few   Seconds it’s basically uh uploaded and the sql 
job run and we have all the table now in our   New mysql on our shared hosting server so 
when i’m gonna try to do the login again And bam shakalaka everything is working we 
connect our mysql database and basically we have   A working laravel project in a shared 
hosting everything is working we have   The php version we have the dashboard with all 
the features that we uploaded working perfectly   And you also use the register if you want 
just to show you that it’s working and i’m not   Like um doing something in between so we just 
created a new user let’s go to our phpmyadmin   And you can see that it’s writing or inserting the 
user data to the user table that we just created   Everything working under or less than 10 minutes 
and you have your website your laravel project   On shared hosting service and now i’m going to 
give you a bonus and basically help you to create   Or set free ssl certificate as you know 
it’s helping with the seo and it’s very   Good to have a secure website so what you 
want to do you want to go to security you   Want to go to ssl manager and then you’re 
going to choose your domain and you’re going   To choose the ssl the let’s encrypt it will 
take few seconds i just run it skip to that   And after a few seconds the ssl is created 
and installed on your web of string server   So you don’t need to do anything you don’t need to 
change any configuration and if you’re gonna go to  

Https and your domain website bam you have your 
free ssl with your website on shared hosting in   Less than 10 minutes enjoy guys thank you guys 
for watching please like subscribe and leave   Comment in the comment section below feel free 
to ask any question you want and feel free to   Follow for more amazing tutorial about laravel 
aws and scale up your system have a nice day

You May Also Like