How to Host Images using Google Drive

Updated onbyAlan Morel
How to Host Images using Google Drive

In this post, we'll learn how to host images on Google Drive. From there you can create public links to your images, which can be shared with anyone or embedded on your website.

Google Drive is a great hosting service because it is widely available and free. We're going to use Google Drive to create a public image URL to this image:

The cat image we will host on Google Drive

Hosting images on Google Drive

To begin, make sure you have a Google account. From here, access your Google Drive.

From here, hit the New button and upload an image to Google Drive.

The New button in Google Drive

After you upload the image, locate the file, click on it, then hit Get Link.

The Get Link button in Google Drive

From here, set the file to public by setting the visibility to Anyone with the link. Copy the link and hit Done.

You should get something like this:


With the link above, you'll need to get the image's unique ID. You can get the image's ID by copying everything after and before /view?usp=sharing.

The structure of the link above is:


The unique ID of our image is:


From there, we can now create a public link to our image by following the below structure:


Just replace {UNIQUE_ID} with the unique ID of our image.


And that's it! If you visit that link, you should see your image being served by Google Drive.

The cat image we hosted on Google Drive

Then, you can embed it on your website, like so:

<img src="" alt="My image on Google Drive" />


We've seen how you can use Google Drive to create public URLs to images, essentially using Google Drive as your own image hosting service.

Hopefully, you've found this post helpful in case you want to host images on Google Drive yourself.

Thanks for reading!

To learn more about web development, founding a start-up, and bootstrapping a SaaS, follow me on X!
Copyright © 2017 - 2024 All rights reserved. Made with ❤ in NY.