100% Free Website Hosting using a Raspberry Pi Zero W, 2, 3, or 4 with Secure SSL (HTTPS) Encryption

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video i'm going to show you how to host a wordpress website or any html or php website on this small piece of hardware this is raspberry pi zero wireless and you can use a better hardware for example raspberry pi 3 or raspberry pi 4 and use it to host a fully functional website that can be accessed from anywhere with secure https connection all for free so let's get started and let me show you how to do this so for this tutorial i'm going to use my mac system you can use windows or linux if you have one so the steps remains the same what you need is raspberry pi imager tool first so download it install it and then launch it next you have to connect the microsd card to the card reader and then connect it to your system back on your system make sure you have launched raspberry pi imager click on choose os go to raspberry pi os other and then choose raspberry pi os light 64 bit light because it's not going to require a lot of resources it's not gui it's a command line based operating system so the resources will be available to host your website and run your web servers so for that we are going to use raspberry pi os light select it click choose storage make sure your storage sd card is connected to your system and then select it and also make sure the card is empty there is no data then click on the gear icon now you may see a prompt on mac os click on no and then click on set host name that's fine enable ssh and also set a username and password you can keep the username pi and password raspberry but i suggest that you change this and secure your username and password make make sure you use a very strong username and password next if you are going to use the wireless version of raspberry pi to connect to the internet although i don't suggest that i suggest that you connect this or the raspberry pi 304 to the router using an ethernet cable that has more reliable way of connecting your devices to your router and to internet and since you're hosting your website you want to make sure that it loads faster so to ensure that you don't want wireless connection it's not that reliable but for this tutorial sake and i mean your website is going to work anyway if you connect wirelessly also it's going to work no problem with that it's just that if you want faster load time use ethernet cable so we are going to fill our passwords make sure you enter the 2.4 gigahertz band here not the five gigahertz one so i'm going to do that enter the password you can also set your time zone and then click save once you do that click on write and then click yes on mac you will have to enter the password to allow the changes and on windows you don't know you don't need to do anything just wait for a while and it's going to write the image to your sd card so once the flashing completes you need to disconnect your sd card it will be auto ejected by your system so it's safe to eject it or disconnect it after disconnecting it you can insert the sd card to your raspberry pi 0 or if you're using raspberry pi 3 or 4 you can just insert it and then turn it on so i'm going to plug this now this may take a while to complete the boot process at first so you just have to wait and after that you need to know the ip address of this raspberry pi the simplest way is to go to your router setting or dhcp settings and then find out the ip address of raspberry pi or you can also use an app on your android or ios device called fing which helps you detect all the devices that are connected to your network so it basically scans your network and lists all the devices and then open the terminal app on your mac or linux or you can use the putty on windows on terminal what we need to do is ssh the username was pi for this tutorial at the rate the ip address of the raspberry pi press enter and it will ask you if you are sure you want to connect press y and press enter press type yes and then press the enter key and then you have to enter the password similarly if you connect through putty you will see a prompt click yes and then enter your username and the password so we'll enter the password and we are successfully logged in over the ssh now that we are connected we need to update the packages and for that what we need to do is we are going to run sudo apt update hand and sudo apt upgrade with y parameter and then wait this may take a while to complete so sit back and relax once this is done we need to move to the next step where we are going to install the apache servo and for that we are going to run a simple command sudo apt install apache 2 hyphen y and this is going to install the apache server and after the installation we need to test if apache is successfully installed and working and to check that there are two ways you can check the status of the apache server or you can visit the ip address of the raspberry pi on a web browser and see if a purchase server is installed or not it will show you a web page where it will show you the purchase server information and that indicates that apache is successfully installed and we can proceed to the next step next we need to go back to our terminal window and paste this command to install php wait for a while until this completes next we need to install the mysql server and for that we need to paste this command and then press enter key this is going to install the mysql server uh it will take a while to complete press yes or y press y key and then press the enter key to confirm the installation so it will download the packages and install it now once this is complete we need to secure our my sequel installation this is very important if you are going to open this website to public and since we are going to do that we need to make sure our mysql is secure and for that we need to run this command mysql secure installation so the command is sudo mysql underscore secure underscore installation press the enter key the password is nothing so just press the return or the enter key and then it will ask you if you want to switch to unix socket authentication press y press enter and then if you want to change your root password which is currently empty so press y and press enter key then enter the password you want uh make sure it's secure repeat it and if you want to remove anonymous user i highly recommend that you do that press y enter disallow root login remotely yes remove test database and access to it of course we want to remove that and reload privilege tables now yes this completes our securing my sequel installation now after securing the mysql installation we are going to create a database and a username so let's just do that and for that you need to enter the command so sudo mysql iphone you root iphone p enter password now let's create a database we name it wordpress so what database has created now we need to create a user account so so let's just do that create user ravi that's my name at the rate localhost identified by and this is going to be the password for the database for the user that you are creating to access that database so i'll keep it password but make sure you use a secure password here and that's it we have created a user now we need to grant access to the database i mean we want to give access to this user to the database we created which is wordpress and for that we need to enter this command grant all to grant all on the database name which is wordpress to the user which is ravi at the late at the rate local host identified by the password which is password in our case press the enter key or we did something wrong here so we are doing okay we need to grant access to entire database to the user and press enter key so this will give the access next we can run the first flush privileges command and then exit we have created a database now what we need to do is we need to go to the cd where html directory and here we are going to download the wordpress package extracted and fix the permissions and then we will be able to run our wordpress installation so the command is sudo w gate and then we need to enter the path of path to download the wordpress package which is wordpress.org latest dot r dot t z g z press the enter key and this will start downloading the package from the internet so we are going to extract it this is a tar package so yeah commands are confusing so sometimes i forget them excuse me for that so this will extract the package and if you want to look type ls and press the enter key and this will list all the directories so you can see wordpress is extracted now you can move files from wordpress all the files to the html directory or you can host your website at work in the wordpress directory we are going to move all the files from the wordpress directory to the html directory and for that we are going to paste this command and press the enter key and this will move all the files as you can see all the files have been moved to the html directory from the wordpress so if you want you can remove the wordpress directory at this stage because it's empty we have moved all the files and for that you can use rm since it's a directory i am the im rmdir remove directory command and this is going to remove that so now that we have moved all the files from wordpress directory we can also remove the wordpress download package sudo rm so this will remove the package also and make some more space so now we need to fix the permissions uh and we need we need to allow permission to the www hyphen data to this directory and first we are going to use so first we are going to use this command to make pi a member of the group www hyphen data so by press the enter key make sure if you have changed if your username is different make sure you change pi with your username and then we can set the permissions to the html directory we can grant the permission or basically we are changing the ownership from root to www iphone data and this will do that now we are ready and we can launch our website and we can start the installation so we'll open the web browser and we'll visit our the ip address of the raspberry pi press the enter key okay so this is still loading the apache debian default page so [Music] so to avoid this we need to remove the main index.html file which is in the main html directory so we are going to remove it and now we are going to refresh this ip and it should load the wordpress installation page there it is we have the wordpress installation page click continue after choosing your language and then click let's go now we have already named our database wordpress so we'll keep it like that the username we used was rovi and the password was password so make sure you change these values and keep the database host localhost and prefix as default whatever it is and click on submit and then click run installation finally you have to click on run on installation and then you have to put the site name the username and the password make sure you use strong password and username in order to protect your website for the back end and then enter the email that you have now this email will be used to reset uh your password in case you forget it and also to set your profile pictures and everything so make sure you enter the correct email address there so i'm going to put this information right here and i'm going to keep this password default but i'll copy this and keep it safe i'll enter my email and then click on install wordpress now this is going to finish the wordpress installation and from now onwards i can access my website which i have just created and it's running on the raspberry pi zero from my web browser and it's going to load very quickly since it's running locally and for that i need to enter the ip address of the raspberry pi so let me just put the ip address and press enter so this is the website as you can see it says welcome to my site on pi now i can access the wordpress admin center and i'm just going to show you quickly how you can log in so you have to go to your ip or the web address forward slash wp hyphen admin and then login using your username and password so i'm going to quickly change the theme and then we'll see if the changes are reflected so i'm again going to visit the ip and as you can see the changes are reflecting and we can now create post add articles blogs or if you want to convert it to e-commerce website you can install uh plugins woocommerce plugin and there are several other plugins there are tons of plugins that you can install to modify your entire website and to build your website the wordpress website now the final step is to expose this website it's running local so nobody can access it outside your network to allow public to access your website and visit your website you need to expose it to the internet and there are two three different ways i'm not going to talk about that because they are unsecured uh for your network for your home network the second method is cloud flare tunnel now it's the safest way and i'm going to discuss that in a separate video because uh the video will be too long and it's better that i keep it in parts so that if i create any other video which is related to website hosting or any other server hosting you can find the link in the description so watch that video and you will be able to expose your website to the internet for free with https connection and ssl certificate completely free i'm going to end this video this was all if you find this video helpful please hit the like button and also subscribe to our channel for more videos like this i'll be back with another video soon thanks for watching have a great day
Info
Channel: Ravi Singh
Views: 10,488
Rating: undefined out of 5
Keywords: How-to (Media Genre), tutorials, educational video, diy guide, host site on raspberry pi, host wordpress site on raspberry pi, host website on raspberry pi zero, raspberry pi 3, raspberry pi 4 web hosting, web hosting on raspberry pi, host html site on raspberry, host php website on raspberry, host website on raspberry pi, access raspberry pi web server from internet, raspberry pi website builder, raspberry pi secure web server, apache web server raspberry pi, free web hosting
Id: UHh77pj5AO4
Channel Id: undefined
Length: 19min 32sec (1172 seconds)
Published: Thu Aug 18 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.