DEV Community

Cover image for How to Use Google Drive to Host Your Website
Matin Mollapur
Matin Mollapur

Posted on

315 1 1 1 1

How to Use Google Drive to Host Your Website

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:

  1. Login to Google Drive and click New > Folder.

  2. Name the folder (e.g. "my-website").

  3. Right click on the folder > Share

  4. In the dialog box that appears, change the access to "Public on the web" and click "Save".

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

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Googleโ€™s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (11)

Collapse
 
robinamirbahar profile image
Robina โ€ข

Interesting

Collapse
 
rcmisk profile image
rcmisk โ€ข

very interesting

Collapse
 
matinmollapur0101 profile image
Matin Mollapur โ€ข

Glad you like it!

Collapse
 
adamk0887 profile image
Adam K โ€ข โ€ข Edited

Thank you for sharing this insightful guide on using Google Drive to host website. It's a valuable resource for anyone looking to explore efficient and creative hosting solutions!

Collapse
 
roger_kaplan_2f812575dc97 profile image
Roger Kaplan โ€ข

The "website link" just takes you to the Google Drive directory page, it doesn't "load" index.html into the browser

Collapse
 
hmaqbl profile image
HMQBL โ€ข

No it didnt worked for my food blog

Collapse
 
edjchapman profile image
Ed Chapman โ€ข

It doesn't work

Collapse
 
chahat_rajput_f391895c2ea profile image
Chahat Rajput โ€ข

drv.tw site is not responding unable to host my website

Collapse
 
oldsnakenewtrik profile image
oldsnakenewtrik โ€ข

this doesn't work for me when i append index.html to the drive folder url it returns 400 error

Collapse
 
happy_marshmallow_6e6450b profile image
Happy Marshmallow โ€ข

This is BS. Can't believe DEV just let such BS articles be published.

Collapse
 
nwakonobi_chinedu_70296df profile image
Nwakonobi Chinedu โ€ข

Tnks i'll try it out

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay