We’re a big fan of cloud services on this blog, If you’re wondering how to host a website on Google Drive for free, well, I just did (and it took me 2 minutes!) so I’ll tell you all about it.
Even though the new Google Drive has made it harder to host websites, there’s still a pretty easy workaround I came across.
How to Host
In a easier way
To host a web page on Google Drive:
Create a folder in Google Drive and set the sharing permission to “Public on the Web.”
Select the HTML file, open it and click the “Preview” button in the toolbar.
Share the URL (it will look like www.googledrive.com/host/…) and anyone can view your web page!
But this is not easy that much as expected. Few things keep in mind that google drive hosts only static pages. ( No dynamic websites like WordPress). If your website is of few pages and css files then the google drive is best option to host ( Free of cost )
In a detailed way
- Put all your website files in a .zip file (.rar doesn’t work, I tried). I made a sample website in a .zip file by modifying Amit’s content, you can download it here if you don’t have any zipped webpages kicking around.
- Open the Google Script page and upload your .zip file.
- Hit upload file, and you should see this:
- Enjoy your free web hosting!
Hosted website on Google Drive
If you’re learning to host a site on Google Drive out of curiosity, you probably aren’t satisfied with having all the work done for you with a script. Unfortunately for you, it’s not particularly techy or in-depth, it just has more steps.
- Create a new folder in Google Drive
- Upload the contents of your website’s .zip file and move them to the folder.
- Right click the folder and choose ‘share’, then ‘advanced’ at the bottom of the popup.
- Choose ‘Public on the web’ and save.
- After hitting save, you’ll be given a public link but it will be a link to the folder your .html files are stored in on Drive, not an actual website.
- So the next thing we need to do is to change the link. Cut out the string of letters and numbers between id= and &usp, and paste it at the end of https://googledrive.com/host/
- Navigate to your new link, and you should see your web page!
To start, I’m not entirely sure how long this functionality will remain in Google Drive. It’s not a well-publicized feature, and so it probably also isn’t very highly utilized. Google tends to get rid of things that aren’t highly utilized, so we’ll see how long this lasts.
In addition, this hosting solution should only be used for rapid prototyping. DO NOT host your website on Google Drive permanently and tell all your friends to go visit that link, because it probably isn’t as secure as actually hosting your website on a dedicated or shared hosting site. This should only be used for personal or internal development purposes