Skip to main content

How to host a web page on Google Drive

Google drive has been around since 2012 (opens in new tab). It's cheap, stable and easy to use, making it a good solution for small businesses and individuals. It's so stable that even small outages cause a furor (opens in new tab), but even it has the usual vulnerabilities (opens in new tab). One of its more underutilised features is hosting a web page for free. The basic steps are uploading an HTML file to google drive, finding the file's document ID from the sharing button and inserting that into this address where ID is the document ID.

Google has a small tutorial (opens in new tab) on the basics, but it's essential to use the Google Drive application or an app to edit the html in Google Drive, because every time a file is re-uploaded its effective address changes and renders links useless.


1. Upload the HTML and any other files associated with the website.

2. Find the document ID for the files by opening the sharing panel for a file and finding the series of characters in the sharing URL. For instance, if this is the link: id=0000000000000000000000000000&authuser=0, the ID would be where the zeros are in this example. The link format might also look like this: 0000000000000000000000000000/view?usp=sharing.


(opens in new tab)

3. Combine the ID with to create the address for that file by replacing ID with the ID found step 2, e.g.

4. Using the google drive application, update the HTML files with the new addresses, using absolute links.

Benefits and Drawbacks

The advantages are obvious: Google Drive is a reliable host (opens in new tab)and allows custom HTML, CSS and Javascript. It saves the hassle of relying on an unknown company's policies and having to renew your domain. It's a good solution if you need to host a company bracket or get a portfolio site up. Privacy can be controlled using Google Drive's sharing features. The disadvantages are less obvious.

Although you can navigate to the site with a ~60 character URL, once you arrive at the site it displays as about 100 characters. Nobody's going to remember an address that long, let alone one with a series of random characters. The less technically savvy won't know how to use TinyURL to put that in a tweet, either. There are gTLD services (opens in new tab) out there to provide a shorter URL to redirect to the Google Drive site's landing page, but that can impact the site's perceived trustworthiness. If hosting a public oriented site and custom HTML isn't needed, other services like Google Sites or paid hosting may be better.

The other major disadvantage comes when using webmaster tools. You can't set level domain settings, so a few tools may not be accessible. Anything which requires HTML editing (e.g. establishing a canon URL or establishing ownership) is still possible.

For a professional business with high web traffic, paying for site hosting is worth the cost, but for an individual or a small group, this trick could save some time and effort; having custom HTML, CSS and Javascript opens up a host of options when compared to more narrow free web hosting like Google Sites. It works for other file types as well so give it a try with images, videos and other media.