Cabinet is a lean, self-hosted file locker. It focuses on a fast, mobile-friendly web experience, secure sharing, and high-speed uploads without the bloat of background sync engines.
Cabinet is optimized for mobile screens and can be added to your home screen as a Progressive Web App (PWA):
- Mobile-First UI: Responsive React frontend with custom bottom-sheet action drawers.
- Authenticated At-Rest Encryption: New files use chunked AES-256-GCM so tampering is detected while range requests remain streamable. Existing legacy AES-CTR files remain readable for migration compatibility.
- Smart Previews: Auto-generated thumbnails for images, videos, and PDFs.
- Public Sharing: Generate short link hashes with optional password protection, download count limits, and expiration dates.
- Single Container: Frontend, modular Express backend, and SQLite database run together in one lightweight Docker image.
Cabinet requires a few security settings before it will start. Docker Compose reads these values from a file named .env in the same directory as docker-compose.yml.
The four settings every new installation should understand are:
-
JWT_SECRET: Required. Used to sign login/session tokens. It must be at least 32 characters long. Generate a strong random value with:openssl rand -hex 32
This produces a 64-character hexadecimal secret. Keep it private. Changing it later will invalidate existing login sessions, but it will not affect stored files.
-
ENCRYPTION_KEY: Required. Used to encrypt files stored by Cabinet. It must be at least 32 characters long. For a new installation, generate a full 32-byte random key with:openssl rand -hex 32
Back this value up somewhere safe. Do not casually change or regenerate it after you begin storing files. Cabinet needs the same key to decrypt existing files. Losing the encryption key can make stored files unreadable.
-
ADMIN_PASSWORD: Required. Password for the bootstrap administrator account created on first startup. It must be at least 12 characters long. Use a strong password that you choose yourself. For example:ADMIN_PASSWORD=replace-this-with-a-long-unique-password
Cabinet does not ship with a public default administrator password.
-
ADMIN_USERNAME: Optional. Username for the bootstrap administrator account. If omitted, Cabinet usesadmin.ADMIN_USERNAME=admin
Other supported settings are:
ALLOW_REGISTRATION: Defaults tofalse. Set totrueonly if you intentionally want users to be able to register.REGISTRATION_CODE: Optional registration/invite code. When set, new registrations must provide the matching code.STORAGE_PATH: Storage path inside the container. The supplied Compose file uses/app/users; normally you should leave this unchanged.CABINET_DATA_DIR: Host directory mounted at/app/users. Defaults to./user_data. Use a stable absolute path for production if the Compose directory may move.MAX_UPLOAD_SIZE: Maximum completed file size in bytes. The supplied Compose file defaults to 50 GiB.UPLOAD_CHUNK_SIZE: Browser upload chunk size in bytes. Defaults to 8 MiB so large uploads work through proxies with relatively small request-body limits.UPLOAD_REQUEST_TIMEOUT_MS: Node request timeout in milliseconds. Defaults to0(disabled) so slow/large uploads are not killed by the application server.TRUST_PROXY: Defaults tofalse. Set totruewhen Cabinet is behind a trusted reverse proxy such as Traefik, Caddy, or Nginx and you want Cabinet to trust the forwarded client IP.COOKIE_SECURE: Defaults totruefor production. Keep this enabled when Cabinet is accessed over HTTPS. Set it tofalseonly for an intentional plain-HTTP local/LAN deployment.
From the directory containing docker-compose.yml, copy the example file:
cp .env.example .envGenerate two independent random secrets:
openssl rand -hex 32
openssl rand -hex 32Use one output for JWT_SECRET and the other for ENCRYPTION_KEY. Do not use the same value for both.
Then edit .env so it looks similar to this:
JWT_SECRET=put-the-first-generated-secret-here
ENCRYPTION_KEY=put-the-second-generated-secret-here
ADMIN_PASSWORD=choose-a-long-unique-admin-password
ADMIN_USERNAME=admin
ALLOW_REGISTRATION=false
REGISTRATION_CODE=
TRUST_PROXY=false
COOKIE_SECURE=true
CABINET_DATA_DIR=./user_data
MAX_UPLOAD_SIZE=53687091200
UPLOAD_REQUEST_TIMEOUT_MS=0
UPLOAD_CHUNK_SIZE=8388608Do not commit your real .env file to Git. Cabinet's .gitignore excludes it by default.
Once .env is configured:
docker compose pull
docker compose up -dWatch the startup logs if you want to confirm initialization:
docker compose logs -f cabinetOn the first successful startup, Cabinet creates the administrator account using ADMIN_USERNAME and ADMIN_PASSWORD.
After Cabinet is running, open:
- Web UI:
http://localhost:4444 - API documentation:
http://localhost:4444/api/docs
For an internet-facing deployment, put Cabinet behind HTTPS before signing in and keep COOKIE_SECURE=true.
Cabinet stores its SQLite database, encrypted files, thumbnails, logs, and in-progress chunked uploads under /app/users inside the container. Docker Compose bind-mounts that path from CABINET_DATA_DIR on the host.
The default is:
CABINET_DATA_DIR=./user_dataFor a long-lived server, an absolute host path is safer because it does not depend on which directory you launch Compose from:
CABINET_DATA_DIR=/srv/cabinet/user_dataA normal image update may recreate the container without recreating Cabinet itself:
docker compose down
docker compose pull
docker compose up -dThat sequence does not delete the host data directory. Cabinet will reopen the same database.sqlite, users, files, and folders after the new container starts.
To preserve an existing installation:
- Keep the same
CABINET_DATA_DIR. - Keep the same
ENCRYPTION_KEY; existing encrypted files require it. - Keep the existing
.envfile. - Do not delete or replace the host data directory when updating.
If you use the relative default ./user_data, run Compose from the same project directory each time or switch CABINET_DATA_DIR to an absolute path.
Browser uploads use a chunked upload API instead of sending one enormous multipart request. The default chunk size is 8 MiB, so a 1 GiB file is transferred as many small requests and then finalized server-side. This makes uploads much more tolerant of reverse proxies, tunnels, and CDNs that enforce per-request body limits.
Relevant settings:
MAX_UPLOAD_SIZE=53687091200
UPLOAD_CHUNK_SIZE=8388608
UPLOAD_REQUEST_TIMEOUT_MS=0The defaults allow files up to 50 GiB, send browser uploads in 8 MiB chunks, and disable Cabinet's own Node request timeout. Your reverse proxy may still have its own request-body or timeout settings, but each chunk only needs to fit through that limit.
Cabinet logs chunked-upload initialization/completion and aborted/failed HTTP requests. The web UI also displays the actual upload failure instead of silently leaving a stalled progress item.
Cabinet supports configurable logging through LOG_LEVEL.
Normal operation:
LOG_LEVEL=infoFor active troubleshooting:
LOG_LEVEL=debugThen recreate the container:
docker compose down
docker compose pull
docker compose up -d
docker compose logs -f cabinetAt debug level Cabinet records additional diagnostic context including:
- request IDs, request start/completion, HTTP status, and request duration
- client IP plus forwarded IP/protocol information when present
- request content type and content length
- authentication acceptance/rejection reasons without logging tokens or passwords
- quota reservation and release decisions
- chunked-upload initialization, expected chunk count, every received chunk, byte counts, percentage, and per-chunk write timing
- upload status/finalization requests
- hash, thumbnail, encryption, and finalization timings
- aborted connections and HTTP client connection errors
- startup configuration such as upload limits, chunk size, timeout, proxy mode, cookie mode, storage path, and active log level
Cabinet deliberately does not log JWT values, cookies, passwords, registration codes, or the encryption key.
Every response also receives an X-Request-ID header. When investigating one failed browser request, that ID can be matched against the server log entries for the same request.
The structured log file is stored at:
/app/users/cabinet.log
which means it is persisted inside CABINET_DATA_DIR alongside the database and user storage.
Useful commands:
# Follow container output
docker compose logs -f cabinet
# Last 300 lines
docker compose logs --tail=300 cabinet
# Search persisted structured logs for uploads/errors
grep -Ei 'upload|aborted|failed|error|quota' "${CABINET_DATA_DIR:-./user_data}/cabinet.log"
# Follow the persisted log directly
tail -f "${CABINET_DATA_DIR:-./user_data}/cabinet.log"For routine operation, switch back to LOG_LEVEL=info once troubleshooting is finished so per-chunk/request debug messages do not generate unnecessary log volume.
The Compose file uses ghcr.io/soltros/cabinet:latest and pull_policy: always. To update to the newest published image:
docker compose down
docker compose pull
docker compose up -dKeep the same .env, CABINET_DATA_DIR, and ENCRYPTION_KEY when updating.
-
Pull the published image
docker pull ghcr.io/soltros/cabinet:latest
-
Run the container
docker run -d \ --name cabinet \ -p 4444:4444 \ -e ENCRYPTION_KEY="$(openssl rand -hex 32)" \ -e JWT_SECRET="$(openssl rand -hex 32)" \ -e ADMIN_PASSWORD="replace-with-a-strong-password" \ -v "$(pwd)/user_data:/app/users" \ ghcr.io/soltros/cabinet:latest
-
Access
- Web UI:
http://localhost:4444 - Swagger Docs:
http://localhost:4444/api/docs
- Web UI:
The Compose file deploys the published GHCR image rather than building locally:
docker compose pull
docker compose up -ddocker-compose.yml uses ghcr.io/soltros/cabinet:latest with pull_policy: always and bind-mounts ${CABINET_DATA_DIR:-./user_data} at /app/users. Local source builds remain available for development and CI with docker build.
Cabinet is designed to run behind a reverse proxy (like Nginx, Traefik, or Caddy) for TLS termination. The container listens on port 4444. Set TRUST_PROXY=true only when requests reach Cabinet through a trusted proxy.
Because Cabinet packages all configurations and files under a single mapping directory, complete backups are easy. Simply archive the ./user_data folder on the host:
tar -czf cabinet-backup-$(date +%F).tar.gz ./user_data-
Install Dependencies
npm install
-
Run the Dev Environment This launches the Express backend API and Vite server concurrently:
npm run dev

