Open-source object storage, on the Drive you already have

Use Google Drive
as object storage.

Store your app's photos, documents and backups in Google Drive instead of S3. It speaks the S3 API, so your existing @aws-sdk/client-s3 code works by changing endpoint.

Set up drivebucket

Get a refresh token, check the setup and create your first bucket:

Terminal
$ npx @drivebucket/cli auth login --client-id ID --client-secret SECRET > .env
$ npx @drivebucket/cli --env-file .env doctor
$ npx @drivebucket/cli --env-file .env buckets create photos
Before you run it
  1. In Google Cloud Console, enable the Google Drive API.
  2. Create an OAuth client of type Desktop app.
  3. Publish the consent screen. In Testing mode, refresh tokens expire after 7 days.

Full walkthrough: Quick start in the README →

GitHub repository →

Source, issues and releases. MIT licensed.

Documentation →

Quickstarts for Express, Next.js and Docker, plus S3 migration.

npm packages →

Four packages, published with provenance.

How it works

drivebucket maps the object-storage model onto Drive. Buckets become folders, objects become files, and your keys live in private file properties that only your app can see.

  1. Bucket = folder

    Each bucket is a folder under one root: a folder the app creates in My Drive, or a shared drive on Workspace.

  2. Object = file

    Files sit flat in the bucket folder. The key, bucket and a SHA-256 lookup hash are stored in appProperties, and a key → file-id cache (memory, Redis or MongoDB) skips the search.

  3. Served by you, not Drive

    Uploads are MD5-checked end to end. Reads stream through your server with byte ranges and resizing. Files are never shared publicly in Drive.

How a photo travels through drivebucket, in 54 seconds. Turn the sound on.

Four packages

Use the adapter directly, put the S3-compatible server in front of it, or drop the Next.js route into your app.

@drivebucket/core

The DriveAdapter: buckets, put/get/head/list/copy/delete, resumable uploads, retries with backoff and a pluggable key index.

@drivebucket/server

Docker image with an S3-compatible API (SigV4, presigned URLs, multipart), a public read proxy, image resizing and Prometheus metrics.

@drivebucket/next

Next.js App Router route for uploads and serving, plus browser-side resize and upload with progress.

@drivebucket/cli

auth login with loopback OAuth, doctor to check your setup, and buckets, ls, cp, rm.

Pick your integration

Three ways in. Each one has a full guide in the docs.

upload.ts
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';

const s3 = new S3Client({
  endpoint: 'https://files.example.com', // your drivebucket-server
  forcePathStyle: true,
  region: 'us-east-1',
  credentials,
});

await s3.send(new PutObjectCommand({
  Bucket: 'photos', Key: 'cat.jpg', Body, ContentType: 'image/jpeg',
}));

Keep your S3 code

Point the AWS SDK at drivebucket-server. Signatures, presigned URLs and multipart uploads work as they do on S3.

It's a subset: path-style only, with no versioning, ACLs or object lock.

Migrating from S3 →

The limits, up front

Drive is not S3. drivebucket works well for an app with thousands of users and a CDN in front. Read these before you rely on it.

LimitValueWhat it means
Upload volume750 GB / user / dayAfter that, uploads and copies fail for 24 hours.
API quota325,000 units / minAn uncached download costs 200 units: about 27 per second per user.
Objects per bucket~500,000Drive's per-folder cap. Shard across buckets beyond that.
ListingScans the bucketDrive can't filter by prefix. Fine for thousands of objects, costly for hundreds of thousands.
ConsistencyNo atomic conditional writesIf-Match is best effort; concurrent writers can race.
Object size5 TBUploads above 5 MB use resumable sessions.

Good fit

  • User uploads for small and medium apps
  • Side projects that shouldn't pay a storage bill
  • Teams already paying for Workspace storage
  • Backups and documents behind your own auth

Use real object storage for

  • A busy public CDN origin without a cache
  • Millions of objects per bucket or a data lake
  • Strong consistency, residency or object lock
  • Serving video at scale

Full table, Google's terms and abuse notes: Limits in the README →

Documentation

Guides live in the repository. Start with the one that matches your stack.

Quick start →

Google Cloud setup, refresh token and first bucket.

Express →

DriveAdapter with a streaming multer storage engine.

Next.js →

createDriveRoute() and uploadFile() with client-side resize.

Docker + Cloudflare →

S3 endpoint and public image proxy behind a CDN.

Migrating from S3 →

Copy data with rclone, change endpoint, check what differs.

Drive API notes →

Quotas, property limits and how Drive v3 behaves.

Server reference →

Environment variables, S3 API coverage and resizing.

Examples →

Runnable Express and Next.js photo-upload apps.

Contributing →

Develop locally and test against a fake Drive.

↑ Top