How to use google drive for web hosting

How to Host a Website on Google Drive for Free

We’re a big fan of cloud services on this blog, and Vinay has written on Process Street about Dropbox vs Google Drive in the past as well as a great guide on how to migrate to the cloud.

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. It comes in the form of a Google Script written by an expert in the field, Amit Agarwal. First I’ll show you this way — the easy way — then I’ll explain how you can do it without the script.

How to Host a Website on Google Drive using a Google Script

1. 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.

2. Open the Google Script page and upload your .zip file.
host website with google drive script

3. Hit upload file, and you should see this:

Host a website using Drive width=

4. Enjoy your free web hosting!

hosted website on Google DriveThe Hard(er) Way

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.

1. Create a new folder in Google Drive

2. Upload the contents of your website’s .zip file and move them to the folder.

3. Right click the folder and choose ‘share’, then ‘advanced’ at the bottom of the popup.

Hosting a website in Google Drive Sharing

4. Choose ‘Public on the web’ and save.

Make hosted website public on Google Drive

5. 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.

How to host a website on Google Drive Sharing Link

6. 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

How to host a website on Google Drive Link

7. Navigate to your new link, and you should see your web page!

For a video tutorial on how to host a website on Google Drive see below:

Bonus tip:

If you’re not a fan of your huge and ruthlessly forgettable URL, there’s always, a service for people serious about hosting with Google Drive that allows you to use your own URL, unlimited sites and free SSL. Other options for using your own domain are impractical, hacky or unprofessional, such as frame forwarding or using a shortening service like GDrives. For now, it seems like is the best option we’ve got.

To learn more about Google Drive, check out 25 Google Drive Tips You’ve Probably Never Heard Before. Google Drive is a great way to host simple sites, but if you’re looking to build a blog for your company, you should see this post.

Preconfigured and Click to Deploy

WordPress on Compute Engine

Deploy WordPress, a website creation and publishing platform, to Google Cloud with a range of hosting options.

View pricing

  • Blogs

  • Simple websites

  • Best for low to medium traffic

  • Open-source content management system

LAMP stack on Compute Engine

Deploy a development stack featuring Apache HTTP Server, MySQL, and PHP on Compute Engine. 

View pricing

  • Linux, Apache HTTP Server, MySQL, and PHP

  • Host websites and web applications

  • Dynamic content

Static websites

Firebase Hosting

Deploy static content to a global CDN with a single command. Get started with the Firebase Hosting guide.

View pricing

  • End-to-end HTTPS serving for custom domains

  • Web apps and static content

  • Global CDN

Dynamic websites

Cloud Run

Develop and deploy your favorite language and framework on a fully managed serverless platform that scales automatically.

View pricing

  • Go, Python, Java, Ruby, Node.js, and more

  • Access SQL database on Cloud SQL

  • Autoscaled HTTPS endpoint

  • Fully managed infrastructure

If you want to host your webpages quickly but don’t have any web sever to host, then google drive is a greate alternative. You can use Google Drive to host your basic websites or even complex javascript based web app like angularJs, backbone, etc. You may publish any kind of static contents on your website including HTML pages, images, CSS, icons, audio and video files.

Steps to be followed:

  1. Create a folder in google drive.
    Google Drive web hosting
    Google Drive web hosting

  2. Share the folder permission to “public on the web”.
    Google Drive web hosting
    Google Drive web hosting
    Google Drive web hosting

  3. Before uploading any files into the folder please make sure “convert uploaded files to google doc format” is not selected in settings. To check the settings please click settings icon and click Upload settings and uncheck convert uploaded files to google doc format.
    Google Drive web hosting

  4. Now you can drag and drop html, javascript, css and image files into the folder inside Google Drive.
    Google Drive web hosting

  5. Once the file has uploaded, now select index.html file and right click and select open with Google Drive viewer or Open the index.html file and click Open in the bottom-right corner.
    Google Drive web hosting

  6. Now click Preview button that will generate the public URL of your website.
    Google Drive web hosting

  7. Your share url looks like this
    Google Drive web hosting


Tips: Google Drives serves your website over HTTPS and thus can be be used for Facebook apps hosting, since Facebook requires that custom pages are only served over secure HTTP.



Note : You can’t use Google Drive for dynamic web pages generated by PHP scripts and etc.



Thanks to Jayavanath Hosatti



If you are looking for a place to quickly host your websites but don’t have access to any web server, Google Drive is a great alternative. You can use Google Drive to host basic websites or even complex JavaScript based web apps. You may upload and publish any kind of static content * on your website including HTML pages, images, CSS, icons, audio & video files including podcasts.

Free Web Hosting with Google Drive

If you are using the old Google Drive, you can easily host websites on Drive. First upload your website files to a folder inside Google Drive, set the sharing permissions of that folder as public, open the index.html file in the Google Docs viewer and then click the “Preview” link to get the URL of your website.

However if you have migrated to the new Google Drive, you’ll be disappointed to learn that Google has dropped the web hosting feature. You can still create public folders inside Drive but the option to publish that folder as a website is gone.

No worries as there’s still an easy workaround that will let you publish your websites on to Google Drive in a single step.

Also see: Host your Website on Google App Engine

From Desktop to Google Drive in one step

Just put all your website file in a zip file – or you may use this zip file - and then click here to upload that zip file to your Google Drive. Once the file has uploaded, the tool will generate the public URL of your website in the same step.

If you are using the tool for the first time, you may have to click the “Authorize” button since the script needs permission to upload that zip file to your Google Drive.

Internally, this little Google Script is doing all the hard work for you. When you click upload, the app creates a folder inside your Google Drive, changes the sharing permissions to public (anyone can view, you can edit) and then generates the URL using the ID of the new folder.

There are a few things you need to know before hosting websites on Google Drive. One, you need to have an index.html as that file will be served when someone tries to access the homepage of your site. Second, Google Drive websites have a URL structure like and there’s no way to change the default URL.

Google Drive Websites on Custom Web Domain

If you are hosting a website on Google Drive but wish to serve it under your own custom domain, that’s not possible yet but you can follow a workaround.

I’ll show an example here. This website is hosted on Google Drive and here’s the same website but hosted on a different web domain. The trick is easy – you just have to wrap your Google Drive website URL inside an IFRAME tag as shown in the following snippet:

<html> <head> <style> body { margin:0; padding:0; } iframe { position: absolute; height: 100%; width: 100%; } </style> <title>Google Drive Website</title> </head> <body> <iframe src="" frameborder="0"></iframe> </body></html>

The height and width attributes of the IFRAME tag should be set to 100% for the Google Drive website to occupy the entire screen. The only downside is that the URL in the address bar won’t change if you open a different page of the website since you are now browsing inside an embedded page. ?

Google Drives serves your website over HTTPS and thus can also be used for hosting custom Facebook Pages since Facebook requires that custom pages are only served over secure HTTP.

PS:Google Drive cannot be used for serving dynamic pages like those generated through PHP scripts on a WordPress website.

Serverless Web Hosting

By signing in, you agree with the Terms .

DriveToWeb lets you host web sites on cloud drives. You don’t need to maintain a server anymore. How?

DriveToWeb liberates website creation by enabling you to quickly spin up full HTML sites (CSS, Javascript, and media files included) using files stored on popular cloud drives, such as Google Drive and Microsoft OneDrive. Enterpreneurs, developers, educators and students all over the world find great advantages using DriveToWeb over conventional web hosting services. Publishing becomes a simple 3-step process:

  1. Upload your website folder to Google Drive or OneDrive;
  2. Share that folder for public access;
  3. Sign-in above and obtain links to your content.

We ask for your generous donation to keep this service running for countless educators, students, non-profit organizations and web enthusiasts. Thank you in advance for your support.

Written by Jane