How To Host Website on Raspberry Pi and Access Worldwide!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone what's up this is me maybe Shakil and you are watching it says take tutorial so guys today in this video I'm going to show you that how you can host a local web server on your Raspberry Pi and can share it over the internet using the port forwarding on your router in this video I'm going to show you the step-by-step guide how to do that so further Ado let's get started but before that if you're new to this channel then please do subscribe this YouTube channel and if you have already subscribed then thank you so much so guys to host a website or a web server on your local Raspberry Pi you need to set up a Raspberry Pi with a operating system in this case you can use Raspberry Pi official operating system on your Raspberry Pi board I had already set up a Raspberry Pi like this if you don't know how to set up or install Raspberry Pi operating system on a Raspberry Pi board and how to access that board using the SSH then there is a dedicated playlist about Raspberry Pi you can watch that playlist and learn how to set up or use Raspberry Pi board for different type of DIY projects so so here is my Raspberry Pi board this is the Raspberry Pi 3B plus model and I had already installed the operating system into this board now to power it on I am going to use a USB power cable okay now my Raspberry Pi board is powering up it's going to take some time to boot the Raspberry Pi and get connected with my Wi-Fi automatically again guys if you don't know how to set up the Raspberry Pi like this that is going to start up and automatically connect to a Wi-Fi network then I will highly recommend you to watch my dedicated playlist about the Raspberry Pi Port okay now you need to get the IP address of your Raspberry Pi to do that you can log into a router admin panel let me log into mine so my router default gateway is 192.168.0.1 then I am going to log into my router admin panel okay now from here I'm going to DHCP and DHCP client and here you can see there is a device named Pi server this is the MAC address and this is the IP address so my Raspberry Pi board get this IP address 192 168.0.102 Now using this IP address I am going to take excess of my Raspberry Pi using the SSA so let me minimize the browser and from here I'm going to click on start and search for terminal okay then I am going to SSH into my Raspberry Pi then here I am going to type SSH I at the rate 192.168.0.102 then I'm going to press enter then type yes then I need to give the password of my Raspberry Pi here I'm going to type my password okay now here you can see I got SSH access into my Raspberry Pi so first of all what you need to do you have to update the Raspberry Pi board packages so type here sudo apt update now this one I'm going to update all the Raspberry Pi packages okay now to create a website on this raspberry file we are going to take use of the Apache web server to install this Apache server type discover sudo app install Apache 2 then press enter now this command going to install the Apache to web server on your Raspberry Pi okay now the Apache server has been installed on our Raspberry Pi now we start this web server type this command sudo service Apache to start now this command going to start the Apache 2f server okay now we have to put our HTML files our web application files into this Apache web server HTML folder for this we have to go to CD slash bar slash www HTML so this is the default path of Apache web server now in this HTML folder we need to put the HTML files of our web application or the website so for this I'm going to open up my browser and go to my GitHub account now into this GitHub profile I have a test website or web application which I created for my student to practice bhagwanti hunting this Repository takeover.github.io so now I am going to clone all of this file into that HTML folder so that my Raspberry Pi can host this website let me show you the demo of this website if I go to my settings and pages and if I visit to this URL so this is the website now I am going to host this website into my Raspberry Pi so for this I am going to go to code and copy this repository from here then get back to my Raspberry Pi terminal and first of all we need to set up the git software for this to install it type this sudo app install git now this command will install the git on our Raspberry Pi you can see git is already installed in this Raspberry Pi now we are going to clone the table story and for this we are going to type here sudo git clone then I'll paste the GitHub repository URL then press enter now this command going to clone that GitHub repository in this Raspberry Pi board if I type here LS here you can see here we have a folder called takeover.github.io now we are going to change our directory to that folder so here I'm going to type CD takeover github.io and now we are going to copy all of these files into this HTML folder or directory One Directory back so here I am going to type sudo CP Dash R then start then space then we are going to type dot dot slash that mean copy all of this file into one directory back that means this HTML folder if I press enter you can see every file has been copied now if I go back to my HTML directory One Directory back and type here LS here you can see we have all the files into this HTML folder now we need to restart our aperture web server for this we are going to type here sudo service Apache to restart then press enter now if I open my browser and visit to my Raspberry Pi IP address which is 192.168.0.102 and if I press enter now here you can see I have hosted this web server into this Raspberry Pi board using this IP address now this web application is only accessible using my own network or my local network now we have to set up port forwarding on our router so that we can set the public IP address to this web server so again I'm going to log into my router admin panel so here I'm going to type 192. state.0.1 so this is my router admin panel now from here I'll click on this forwarding option then click on Virtual server then I'm going to click here add new and here I'm going to type the service for foreign web application the default Port is 80. and here I'm going to type the IP address of my Raspberry Pi so here I'm going to type 192.168.0.102 and for the internal Port also I am going to type here 80 and from the protocol I am going to set up TCP any status should be enabled then click on Save now any request come to this 80 Port will forward to this Raspberry Pi IP address then I am going to set the portugali so for this I'm going to click on Port triggering then click on add new then here I'm going to type 80 for the port and for the trigger protocol I am going to say TCP and the open port will be 80. so if anyone visit my public IP address it can trigger to 80 port and which is going to forward to this Raspberry Pi IP then from the open protocol I am going to select TCP and Status enable then you have to click on Save okay now the port forwarding is enabled to my router now let's check this 80 Port is accessible from the Internet or not so for this I am going to take use of can you see me this website so take another Tab and type here can you see me then go to this first website can you see me.org and here you need to type Port 80 because we forward this port 80 on my public IP address then if I click on check port and now here you can see this is a success and it's showing I can see your service on my this public IP address on this port number so that means my port forwarding working very well now if anyone visit my public IP address let's copy it from here and if I visit my public IP address here you can see now I can access this web application or website from this public IP address so like this you can easily host any web application or website on a Raspberry Pi and can forward it over the Internet so that anyone can from the internet access your web application or website so guys that's all for today I hope you like this video If you really like this video and enjoy this video then please give it a big thumbs up and share this video with your friends and guys if you're new to this channel then please do subscribe this YouTube channel and don't forget to press the Bell icon to get all the latest upcoming video tutor notification I'm mehdi Shakil you're watching history tutorial and I'm signing out
Info
Channel: SSTec Tutorials
Views: 10,585
Rating: undefined out of 5
Keywords: How To Host Website Locally and Access From Anywhere, Hosting website on raspberry pi, Accessing Raspberry pi Website from internet, Can I host my own website on my computer?, How do you host a website?, How do you host website without buying hosting, How to Host Your Own Website from Home, How to Host Your Own Website for Free, How do I host my own website at home?, steps to host a website, website, how to host a webserver in home, host a website in raspberry pi, sstectutorials
Id: PVy-8vTV6PA
Channel Id: undefined
Length: 9min 2sec (542 seconds)
Published: Sat Dec 17 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.