How to Install a Free SSL Certificate with Let's Encrypt (on Nginx and Apache websites)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys what's up this is tony teaches tech i'm tony and by popular demand in this video we're going to be looking at installing your free ssl certificate from let's encrypt now while this tutorial uses linode this will work on pretty much any other hosting platform that runs on the apache or the nginx web server as long as you have ssh root access to that server and you have a domain name so if you can check off those couple boxes let's get right into the tutorial okay right here i have my wordpress website it is installed at this domain name site2.xyz and like i said i'm running it on top of a linux virtual private server at this ip address the only way i can think about to prove that that's actually the case is to ping the site so i'm going to ping site2.xyz and you'll see that the ip address matches up with what we saw in the linux dashboard the only other kind of like pre-configuration step that you might have to take is to set up your dns settings for your domain so i bought my domain name site2.xyz from namecheap and you'll see here that i have my a records point to that same exact ip address so once you're at that point we can actually go ahead and start looking at installing the ssl certificate so we'll open up a terminal window if you're on mac or linux if you're on windows you can use putty to do the same exact thing and what we're going to do is ssh into our web server so i'm going to type in ssh root at site2.xyz you'll type in your domain name here and that will go ahead and log us onto our server so let's look at our configuration file first for our web server this a lot of you probably won't care about this but i just want to show you guys what you're actually doing so if there is a problem in the future you can come back in here and debug what's going on so this website this wordpress website is running on an apache server some of you will be running on an nginx server so if that's the case just change out apache for nginx in this tutorial i'll i'll make sure i point it out to you so for example let's go to the etc apache 2 directory for those of you using nginx go to the nginx directory and you'll see in here that you'll have this folder called sites available so let's go into the sites available folder directory whatever you want to call it and you'll see that we have these two basic default configuration files we're not going to worry about them the one we're interested in is wordpress.com so let's look at wordpress.com and you'll see here that we have just a basic virtual host at this domain name and some error logs blah blah blah nothing too exciting i just want you guys to see what this looks like because we're going to come back in here after we install the certificate to see what actually happened under the hood because that's the the the installer that we're going to use in just a couple seconds is going to modify this file okay so now that we took a look at that let's go ahead and install the installer so let me explain what i mean by that so let's encrypt uses something called cert bot to automate the process of installing the ssl certificate on your website so we're going to install that first let's go ahead and do that i'm going to use my cheat sheet over here and copy the command to do that it's going to be this one right here so app dash get install certbot and we also want to install python dash sort bot dash apache again for those of you who are using nginx you want to install python-certbot.nginx that's nginx okay so go ahead and do that just hit enter it's going to take up some space 15 megabytes or so hit yes to kick that off and this will take you know at most 10 seconds while that's doing that i'm gonna go to my cheat sheet again and copy the next command that we're going to execute excuse me so the command that we're going to execute now that that's installed is cert bot dash dash apache nginx users type insert bot dash dash nginx okay so go ahead and hit enter and now we're beginning the installation of our ssl certificate so right here enter our email address this does not have to be your domain name that's associated with the ssl certificate or will be associated with the ssl certificate this could be a gmail address this could be another email address i'm going to use my tony at tony teaches.tech email address go ahead and hit enter do you agree with the terms yes i do do you want them to send you other potentially relevant but not really no emails i'm gonna say no um okay so now what the installer is doing is it's reading that configuration file that we looked at and it found out that we have one website on this web server site2.xyz so we only have one option in this case to install an ssl certificate for that so we're going to go ahead and type one which is associated with that domain name now what it's doing in the background is it's verifying that you actually own that domain name not sure specifically how it's doing that but as long as it works you're good to go and it did work for us so that's good the next step here it's asking us if we want to redirect our traffic from the https version of our website to the h sorry it's asking us if we want to redirect the traffic from the http version of our website to the https version of our website i don't see many cases where you would not want to do that so in this case let's pick redirect which is number two and hit enter and that's it guys we now have an ssl certificate on our website let's um just come out of the terminal window here for a second and refresh our web page take note that it's not secure at this point we'll hit enter and we now see that lock on our website don't worry if you see some weird garbage on your screen like this we'll go ahead and fix that in just a second um we'll do that first so yeah let's go on our wordpress admin dashboard and we are getting some privacy errors because uh you see it redirected me to my ip address it's okay you can proceed nothing nothing goofy's going on so i'm going to log in here and once i get to the admin dashboard there's just one there's two urls that we have to reconfigure that are hard coded as http so one this works there we go uh go into your admin dashboard settings general and you'll see that uh which i probably should have did this earlier but make sure even if you have this at this point site2.xyz and site2.xyz or whatever your domain name is you want to come in here and make sure you add that s https and save that so if we go back into the website itself it should look normal so that happens when you have a mix of insecure content with secure content that's where it gets all funky like that if you're interested in this aspect you're done at this point by the way there's nothing else to do but for those of you are interested in some of the behind the scenes let's open up the terminal window again and do an ls in our sites available you'll see that we now have a new configuration file there was only these three ones before the installer created this one so let's look at this new configuration file for the web server the apache web server and basically what it did was it took a copy of our old configuration file which is basically this and this and dropped in these lines that are kind of you know formatted differently so these these are should be indented in here that's okay it's just the formatting thing but these are the new lines that it added this is our link this is of the path to the certificate file and the key and some some other configuration options so that's basically what it did in the background it also modified our original wordpress configuration file which is redirecting all traffic from the http version of our website to the https version of our website and that's what these three lines here do and i'm pretty anal about this so i'm gonna tab these in as well don't mind me um okay so that's that's it guys um i don't know what else to say about this it's really simple um in the future actually yeah let's take a look at this actually let's our certificate is good it's issued by let's encrypt it expires november 14th 2020. today is august 16th 2020 so august september october november three months every three months you'll have to come back in here and re-install the ssl certificate that is a very manual way to do it but in a future video i'm going to make a tutorial on how to automate that with a cron job so if that's something you're interested in definitely subscribe to this channel for when that is published if it's already published by the time you're watching this i'll link it somewhere in the upper what is at the upper right hand corner of the video and down in the description below so you'll have that information as well so um yeah guys if you like this video give it a thumbs up and like i said if you really liked it subscribe to this channel and if you do i will see you in the next video [Music]
Info
Channel: Tony Teaches Tech
Views: 36,825
Rating: undefined out of 5
Keywords: letsencrypt, letsencrypt nginx, letsencrypt certbot, let's encrypt, lets encrypt ssl, let's encrypt ssl, lets encrypt certificate, let's encrypt certificate, certbot, certbox nginx, install certbot, letsencrypt linode, letsencrypt apache, letsencrypt tutorial, lets encrypt tutorial ubuntu, lets encrypt linux command line, lets encrypt ssl tutorial, free ssl, free ssl certificate, free ssl certificate for wordpress, free ssl certificate for website
Id: PGDx3xxLGgA
Channel Id: undefined
Length: 10min 16sec (616 seconds)
Published: Mon Aug 17 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.