Google Drive is not just for storing files - you can also use it to host simple static websites for free! In this article, we'll see how to deploy and share a website using Google Drive.
Why Use Google Drive for Hosting?
Here are some benefits of using Google Drive for hosting:
- It's completely free.
- Files are synced and have high availability.
- Websites are automatically HTTPS enabled.
- Easy to deploy updates by overwriting files.
- Quick setup with no server configuration needed.
Of course, there are limitations too. Google Drive has lower uptime guarantees compared to full-fledged hosting services. The free usage has bandwidth limits, so it's best for low traffic sites. Complex websites with server-side code are not supported.
Overall, it's a simple option for hosting small static sites or as a proof-of-concept before investing in paid hosting.
Step 1 - Create a Public Folder
First, create a new public folder in Google Drive that will contain the website files:
Login to Google Drive and click New > Folder.
Name the folder (e.g. "my-website").
Right click on the folder > Share
In the dialog box that appears, change the access to "Public on the web" and click "Save".
Grab the URL next to "Link to share." This will be your website URL.
Step 2 - Add your Website Files
Now, put your website files like HTML, CSS, Javascript, images etc in this folder.
For example, your folder could contain:
- index.html
- style.css
- app.js
- images/logo.png
Make sure your main HTML file is named index.html
- this will be loaded when people visit the website URL.
Step 3 - Customize Domain (Optional)
The Google Drive public URL tends to be long and cryptic. You can optionally set up a custom domain for more branding.
Some options for custom domains:
Subdomain: Use a subdomain on a domain you own to point to the Google Drive URL.
Forwarding: Forward or mask a domain to the Drive URL using services like netlify.
Google Sites: Use Google Sites to get a sites.google.com domain for free.
And that's it! Your website should now be live and accessible to anyone on the web. Keep adding more content and make changes by overwriting the public folder.
While basic, Google Drive hosting is a neat way to quickly launch sites as a proof-of-concept or for sharing with a limited audience. With custom domains and regular updates, you can even run production websites.
Top comments (9)
Interesting
very interesting
Glad you like it!
The "website link" just takes you to the Google Drive directory page, it doesn't "load" index.html into the browser
this doesn't work for me when i append index.html to the drive folder url it returns 400 error
drv.tw site is not responding unable to host my website
This is BS. Can't believe DEV just let such BS articles be published.
No it didnt worked for my food blog
Tnks i'll try it out