A modern, dark, self-hostable cloud drive β upload, organize, and share your files from your own server. Nextcloud-inspired, rebuilt from scratch on a 2026 stack, and designed to run as a single service you can actually own.
Quick start Β· Self-hosting Β· Architecture Β· Roadmap
Stackfile is a self-hosted cloud drive: a single Next.js service backed by PostgreSQL that stores your files on your own disk and lets you browse, share and mount them over WebDAV. It is for individuals and small teams who want their own file storage without running a full Nextcloud install. The core phases (files, sharing, admin, 2FA/OAuth, search, WebDAV) are built; passkeys, versioning and content search are still on the roadmap, and there are no tagged releases yet.
Everything below is built and working today:
- Drag-and-drop upload with live progress (streamed straight to disk)
- Download, folders (create / rename), breadcrumb navigation, list & grid views
- Trash β soft-delete β restore β delete-forever (with blob cleanup)
- Favorites, a file details panel, and type-aware icons
- Search across your files & folders by name
- Mount as a network drive via WebDAV (Finder / Explorer / mobile) β secured with a per-user app password
- Public share links with optional password (scrypt-hashed) and expiry
- Password-gated public download pages; create / list / revoke from a file's details
- Email + password auth (better-auth), 7-day sessions
- Two-factor authentication (TOTP) with QR setup + backup codes β login is challenged and the session stays locked until the code is verified
- OAuth (Google / GitHub) β activates automatically when credentials are set
- Settings page: profile, change password, 2FA, connected accounts
- The first registered user becomes the instance admin
- Admin panel β instance stats + user management (promote/demote, delete)
- Per-user storage quotas, enforced on upload, with a sidebar usage bar
- Activity log β uploads, folder ops, shares, trash / restore / delete, favorites
Stackfile is a dark, three-pane file manager β sidebar Β· file list Β· details β
on a near-black #010003 canvas with a purple β magenta β coral brand gradient.
Clone it and run locally (below) to explore; the demo seeds a few files.
| Layer | Choice |
|---|---|
| Framework | Next.js 16 (App Router, React 19) β full-stack, one service |
| Language | TypeScript 6, end to end |
| Styling | Tailwind CSS v4, Inter + Azeret Mono |
| Database | PostgreSQL 17 + Drizzle ORM (type-safe, snake_case) |
| Auth | better-auth β password, 2FA (TOTP), OAuth, sessions |
| Storage | Pluggable StorageProvider β local disk today, S3-ready |
| Infra | Docker Compose (Postgres + Redis + migrate + app) + GitHub Actions CI |
Built as a modular monolith: one deployable service, cleanly split internally
(auth Β· files Β· sharing Β· admin Β· activity). See ARCHITECTURE.md.
pnpm install
cp .env.example .env # then set BETTER_AUTH_SECRET
docker compose up -d postgres redis # Postgres :5544, Redis :6379
pnpm db:migrate
pnpm dev # β http://localhost:4000The first account you create becomes the admin.
cp .env.example .env # set a strong BETTER_AUTH_SECRET
docker compose up -d --build # Postgres + Redis + migrations + appServes on http://localhost:4000; uploaded files persist in the storagedata volume.
All config is via environment variables (see .env.example):
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | β |
BETTER_AUTH_SECRET |
Auth signing secret (openssl rand -base64 32) |
β |
STORAGE_LOCAL_PATH |
Which disk / folder files live in | ./storage-data |
STORAGE_MAX_UPLOAD_BYTES |
Max single-upload size | 5 GiB |
GITHUB_CLIENT_ID / _SECRET |
Enable GitHub OAuth | β |
GOOGLE_CLIENT_ID / _SECRET |
Enable Google OAuth | β |
Choose where files live: point
STORAGE_LOCAL_PATHat any disk or folder (D:/StackfileData,/mnt/bigdisk/stackfile, β¦).
src/
app/
(auth)/ sign in / sign up
(app)/ files Β· search Β· activity Β· trash Β· admin Β· settings
s/[token]/ public share pages
api/ upload Β· download Β· auth Β· public share download
lib/
auth/ db/ storage/ files/ sharing/ admin/ activity/ env.ts
drizzle/ generated SQL migrations
docker-compose.yml postgres Β· redis Β· migrate Β· app
| Phase | What | Status |
|---|---|---|
| P0 | Foundation β scaffold, config, storage, schema, Docker, CI | β |
| P1 | Auth β email/password + sessions | β |
| P2 | Files β upload/download/folders/trash/favorites | β |
| P3 | Sharing β public links (password + expiry) | β |
| P4 | Admin β panel + per-user quotas | β |
| P5 | Advanced auth β TOTP 2FA, OAuth, settings | β |
| P6 | Search + activity log | β |
| Flex | WebDAV β mount as a network drive | β |
| β | passkeys, organizations, versioning, realtime, content search | π |
MIT Β© Fizzexual