Self-hosted service
subnub/myDrive avatar
subnub/myDrive

myDrive keeps metadata in MongoDB and chunks somewhere else

Node.js and mongoDB Google Drive Clone

4,226 stars488 forksTypeScriptGPL-3.0

At a glance

What is it?
myDrive is a self-hosted file storage server written in TypeScript, and its architecture is one sentence long: MongoDB holds the metadata, while the file chunks go either to the filesystem or to an S3 bucket depending on one environment variable. The details worth reading are the four secrets that decide whether an install survives a restart, the video thumbnail path that needs ffmpeg in both image stages and up to five gigabytes of temp space, and a version 3 upgrade that is a migration script rather than a pull.
Who is it for?
myDrive fits someone who wants a small private file server with the shape of Google Drive, runs a MongoDB instance anyway or accepts the one the compose file starts, and is willing to own the key that protects the files. It does not fit someone who needs large video libraries: streaming is listed as unreliable in Safari and thumbnails fall back to downloading whole files into temp.
Can I use it commercially?
Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository last received commits 65 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • subnub/myDrive4,226 ★ · -7
Star history
Repository2026-09-232026-11-14
subnub/myDrive4.2k4.2k

-7 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Metadata in MongoDB, file chunks in S3 or a directory

The architecture is stated in one sentence and the environment template implements it. MongoDB stores file and folder metadata. The chunks themselves go somewhere else, and one variable picks where: the filesystem or Amazon S3.

For the filesystem path, the template names a directory and insists the path must end in a slash, with an example under a home directory. For the S3 path there are three values instead: an identifier, a key and a bucket name. The image runs with the filesystem directory and a temp directory set as build-time defaults, so a container needs those two paths mounted.

The compose file starts a MongoDB 8 container alongside the app, with its own data volume, a ping healthcheck every ten seconds, and root credentials written into the file rather than read from the environment. It also declares no ordering between the two services, so the app can start against a database that is not ready yet.

For anyone putting this behind a reverse proxy the file has the answer ready: a commented-out expose section lists 3000 and 8080 as the alternative to the active port mapping, and an HTTPS mapping on 8080 is commented beside it.

Four secrets decide whether the install survives a restart

The environment template treats its own secrets as the most important values in the file, and two of them are irrecoverable in different ways.

The encryption key is the serious one. The template says not to lose or forget it, because all data will be lost if it is lost, and it is optional in the sense that leaving it unset makes the application prompt you to type one into the terminal when the server starts. Files are described as AES256 encrypted in the feature list, so this key is what stands between a stolen volume and readable files.

Then there are three token secrets for access tokens, refresh tokens and cookies, which the template says should each be a different randomly generated string. Losing them logs every user out; changing them forces a logout on purpose.

What is actually shipped as a default is telling. The template and the documented run command both use placeholder words for all four values, so an installer who copies either one and changes nothing ends up with a known encryption key and known token secrets. The tree also carries a key directory at the root, next to the template.

Thumbnails pull ffmpeg into both stages and five gigabytes of temp

Video and photo thumbnails are the feature with the most machinery behind it. There is a boolean to enable video thumbnails, a fluent media library in the dependency list, and a documented limit for the temp space thumbnails may use, set to five billion in the run example.

The container installs ffmpeg in both the builder stage and the runtime stage. Two scripts drive the work outside a normal request, one for production and one for development, and the page offers them as the fix when upgrading from version 3 without thumbnails.

The known issues list explains why the temp limit is so large. Generating a video thumbnail with the default method will often fail, and the fallback requires the whole file to be downloaded to temp first. With a five gigabyte allowance that is a large amount of disk and a long request for a long video, which is why the alternative method exists at all.

One image, two exposed ports, and only one is published

The Dockerfile is a two stage build. The first stage runs on Node 20 Alpine and installs a compiler toolchain plus ffmpeg, copies the manifest, installs dependencies, copies the source, builds, and then prunes the development dependencies. The second stage is the same base with ffmpeg and nothing else added, and it copies the built tree across from the first.

Two environment defaults are baked into that runtime stage: the filesystem directory and the temp directory, both pointing at the mount points the run command expects.

Then the port story. The image exposes 8080 and 3000, but the documented run command and the compose file publish only 3000, and the compose file's HTTPS mapping on 8080 is a commented line. So the second exposed port exists in the image and is left to the operator. The run command itself is short, and mounts exactly the two directories the image expects:

sh
docker run -d \
  -p 3000:3000 \
  --env-file ./.env \
  -v /path/example/mydrive/data/:/data/ \
  -v /path/example/mydrive/temp/:/temp/ \
  --name mydrive \
  kylehoell/mydrive:latest

The container's entry point is the same start script the package manifest uses, with the production environment set, which means the image and a local install run the same code path.

The build is a bundler and a compiler, and it can run out of memory

The package manifest splits the build in two: a frontend build driven by Vite, and a backend build that runs the TypeScript compiler against a separate configuration file inside the backend directory. The build script runs both in sequence, and the development script runs three things concurrently, the bundler, the compiler in watch mode, and the compiled server under a file watcher.

There is a version mismatch worth noting between the manifest and the page. The manifest requires Node 20.14.0 or newer, while the installation notes recommend Node 20 in general and do not mention a minimum.

The page also documents two failure modes with their fixes. A missing make binary shows up as a build tool error from the native module step, and the answer is the build essentials package for Linux. And the build itself can exceed the default memory Node allows, in which case the process aborts with a core dump, and the fix is a larger heap passed through an environment variable for that one command.

Both failures are documented as text and commands rather than as a troubleshooting page, which is more than most projects of this size bother with.

Coming from version 3 means running a migration, not pulling an image

The upgrade section is short and specific. If you are on version 3 there is data migration to run before version 4 works properly, and the command is a named script in the package manifest, with a note to make sure your environment variables are set first. A second command generates video thumbnails, which you need either because you are coming from version 3 or because you did not have thumbnails enabled and want them now, and it needs thumbnails enabled in your environment and ffmpeg installed.

Both migration scripts exist twice, once for production and once with the development environment set, which is the pattern used for the start and thumbnail scripts too. That is the tell for how this project separates environments: an inline variable in the script rather than a configuration file.

The live demo is described with the same candour. Creating, deleting and other features are disabled there, the service worker is off, thumbnails are not cached, and it runs on a 512 megabyte droplet.

Older dependency majors and a committed .DS_Store

The dependency list is long and the server libraries in it sit on older major versions. The web framework is on version 4 of its major line, the security middleware is on 3, the AWS library is the second generation SDK, and the environment loader is on 8. None of that is unusual for a project of this age, but it does mean a security review of this server starts with the dependency set rather than with the application code.

The repository layout has the same kind of history in it. A macOS finder metadata file is committed at the root, next to the environment template and the changelog. There is a second compose file used for testing alongside the main one, a key directory, an images directory for the screenshots, and separate TypeScript configurations for the app and for the tooling that builds it. Linting, testing and styling each have their own config file at the root.

Only one release is published, version 4.0.2, while the last push on the default branch is dated 2026-09-11, so the tag history tells you much less about the project than the commit history does.

Editorial conclusion

myDrive fits someone who wants a small private file server with the shape of Google Drive, runs a MongoDB instance anyway or accepts the one the compose file starts, and is willing to own the key that protects the files. It does not fit someone who needs large video libraries: streaming is listed as unreliable in Safari and thumbnails fall back to downloading whole files into temp. Before deploying it, check five things. Where your chunks live, because the filesystem and S3 paths are chosen by a single variable and the filesystem path must end in a slash. Which four secrets you generate, since the encryption key, the access token secret, the refresh secret and the cookie secret decide whether a restart logs everyone out or locks you out of your own data. Whether ffmpeg is installed if you enable thumbnails, because the image installs it in both stages and the fallback method pulls whole files into temp. How you upgrade, since coming from version 3 requires running a migration script with your environment variables already set. And what the security surface looks like, since the dependency set is pinned to older major versions of several server libraries.

Frequently asked questions

What is myDrive?

An open source cloud file storage server written in TypeScript, similar in shape to Google Drive, that you host on your own server or platform. MongoDB holds the file and folder metadata, while the file chunks are stored in Amazon S3 or on the filesystem, chosen by one environment variable.

Is Google Drive the same as myDrive?

No. myDrive is a separate server you run yourself, described on the page as an open source cloud file storage server similar to Google Drive, with file and folder upload, sharing, generated thumbnails, a media gallery and progressive web app support, plus a self-hosted demo instance.

How do I install myDrive with Docker?

Copy the compose file and the environment template into a directory, rename the template to the environment file, fill in the values, then start it with docker compose up -d and open localhost:3000. The compose file also starts a MongoDB 8 container with its own data volume and a ping healthcheck.

What do the myDrive environment variables control?

One variable chooses between the filesystem and S3 for file storage, the filesystem path must end in a slash, and three more set the access, refresh and cookie token secrets. The encryption key is separate and optional, and the template warns that losing it means losing the data.

What are the known issues with myDrive?

Video streaming does not always work, especially in Safari, downloads through the progressive web app do not work on iOS, folder uploads sometimes fail on complex folder structures, and generating a video thumbnail with the default method often fails and requires downloading the whole file to temp.

Official sources

  1. Issues
  2. License: GPL-3.0
  3. README
  4. Releases
  5. subnub/myDrive on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/subnub-mydrive.svg)](https://hysenlabs.com/projects/subnub-mydrive)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/subnub-mydrive.svg)](https://hysenlabs.com/projects/subnub-mydrive)

Was this useful?