A self-hosted, single-user web app for storing passwords, payment cards, and notes in an AES-256-GCM encrypted SQLite database. Runs in a single Docker container and is published only on the host loopback interface.
- Three item types out of the box: passwords, payment cards, and notes. Each type shows only the fields that are relevant — no card-specific fields cluttering a login record.
- Image attachments per item (PNG / JPEG, auto-resized to 800px on upload, stored encrypted in the same record).
- Category-aware icons: a category named
mail,facebook,twitter, orwebrenders a recognisable icon and brand colour on the card; other items show a generic type icon. - Search and filter by type, category, or keyword. Sort by recent, oldest, or alphabetical title. Preferences persist in
localStorage. - Light and dark theme with a manual toggle. The default is light; the choice is remembered between sessions.
- Encrypted CSV export wrapped in a password-protected AES-256 ZIP file (openable in 7-Zip, WinRAR, macOS Archive Utility 11+ and similar). Plain CSV export is also available for trusted contexts.
- CSV import with smart column detection — accepts files from 1Password, Bitwarden, LastPass, and similar tools.
- Built-in "Clear vault" action that wipes every item and the master password verifier (requires typing
DELETEto confirm).
Local Vault is a minimal stack:
- Backend: a single
server.jsNode.js HTTP server (no framework). Persistence is handled bysql.jsagainst a SQLite database file (vault.db). - Frontend: vanilla JavaScript that builds the DOM with
createElement/createElementNSonly. The production bundle is obfuscated withjavascript-obfuscatorbefore being served. No inline scripts and no third-party JS calls leave the page. - Encryption: payloads are encrypted with AES-256-GCM. The key is derived from the master password via
scrypt(N=32768, r=8, p=1). The original password is never stored — only a salt and a deterministic HMAC verifier are kept. - Sessions: in-memory
Mapkeyed by a random 32-byte session id, stored in anHttpOnly; SameSite=Laxcookie. Restarting the container invalidates all sessions, which is by design.
- Docker Desktop 4.x or later on Windows / macOS, or Docker Engine 24.x with the Compose plugin on Linux.
- About 200 MB of disk for the image plus whatever your vault grows to (typically under 5 MB even with several image attachments).
- A modern browser. The clipboard copy buttons rely on the Async Clipboard API, which only works in secure contexts.
http://127.0.0.1:8124qualifies as secure in all major browsers.
From the localVault directory:
docker compose up -d --buildThe first build runs in three phases:
- Pulls
node:20-alpine(about 90 MB compressed). - Builds the obfuscated frontend bundle inside the build stage.
- Assembles the slim runtime image with only production dependencies.
Expect 1–2 minutes the first time and only a few seconds afterwards (Docker caches each layer).
Once docker compose ps shows the container as running, open
http://127.0.0.1:8124
If vault.db does not yet exist, the very first page lets you create a master password (minimum 8 characters). After that the same page becomes an unlock screen.
Two batch files are included at the project root for users who prefer not to remember the Docker CLI.
start.bat runs docker compose up -d --build, waits a moment for the container to come up, then opens http://127.0.0.1:8124 in the default browser. Double-click to start the vault from File Explorer. If Docker is not running or the build fails, the script pauses so you can read the error before the window closes.
stop.bat runs docker compose down, which stops and removes the container. Your encrypted data in ./data is untouched — the next start picks up where you left off.
Both scripts use cd /d "%~dp0" so they always work regardless of where you launch them from. They are simple wrappers around the same Compose commands shown elsewhere in this README; nothing prevents you from running those commands directly in a terminal if you prefer.
The container accepts the following environment variables. Defaults are shown:
| Variable | Default | Meaning |
|---|---|---|
HOST |
0.0.0.0 |
Interface the server binds inside the container. Compose maps host-side 127.0.0.1:8124 onto this. |
PORT |
8124 |
Listening port inside the container. |
DATA_DIR |
/data |
Directory where vault.db is written. |
NODE_ENV |
production |
Disables verbose Node warnings. |
To override any of these, edit docker-compose.yml:
services:
local-vault:
environment:
PORT: "8124"
DATA_DIR: "/data"
ports:
- "127.0.0.1:8124:8124"If you change PORT inside the container, remember to update the right-hand side of the port mapping accordingly.
The most common change is making the vault listen on a different port of your machine — for example because something else already uses 8124. The internal port can stay the same; only the left-hand side of the mapping needs to change.
Edit docker-compose.yml:
ports:
- "127.0.0.1:9000:8124"The number on the left of the colon is the host port (the one your browser uses); the number on the right is the port inside the container and should remain 8124 unless you also change the PORT environment variable.
Apply the change without rebuilding:
docker compose up -dThen open http://127.0.0.1:9000 (or whichever port you chose).
If you use the included start.bat, update the URL on the last line so it opens the right port automatically:
start "" "http://127.0.0.1:9000"Click the + button on the top bar or the floating action button on mobile. A bottom sheet (mobile) or a centered modal (desktop) appears.
Choose the type first — the form re-renders to show only the fields that matter:
- Password: title, username, password, URL, category, tags, notes, metadata, images.
- Card: title, cardholder, card number, expiry, CVV, bank, category, tags, notes, metadata, images.
- Note: title, URL, category, tags, notes, metadata, images.
The title field is required; everything else is optional. When you switch the type mid-edit, the values you have already entered are preserved.
Tap the + tile inside the Images section to pick one or more PNG / JPEG files. They are downscaled in the browser so the longest side is at most 800 pixels, then encoded as base64 and saved encrypted with the rest of the record. Tap an image to enlarge it in a lightbox; use the arrow keys or the on-screen buttons to flip between multiple images. The small × button on each thumbnail removes that image (the deletion is committed when you press Save).
On the vault list, tap any card to open its detail sheet. Each field has a copy icon that places the value on the clipboard and shows a brief toast. Passwords, card numbers, and CVVs are masked by default — the eye icon toggles visibility for that single field.
From the detail sheet, Edit reopens the form prefilled with the current values. Delete asks for a single confirmation tap before removing the item. There is no soft-delete; once confirmed, the record is gone.
A search box lives in the top bar (visible only on the vault page) and performs case-insensitive substring matching across title, username, URL, bank, cardholder, category, tags, notes, and metadata. Three dropdown filters below the top bar control item type, category, and sort order. The three selectors are persisted in localStorage and survive logout and refresh; search resets every time the page reloads.
Click Import CSV in the menu and choose any CSV. Column detection is lenient — the importer recognises typical headers from 1Password, Bitwarden, LastPass, and generic spreadsheets. Supported column names include
title, name, account, service, label, username, login, password, pass,
secret, url, website, notes, type, category, folder, tags, payload_json,
cardholder, card_number, expiry, cvv, bank, images
If a column called payload_json is present, the importer parses it as JSON and merges the resulting fields into the row. The images column, if present, must contain a JSON array of data:image/...;base64,... strings (this is the format Local Vault itself produces during export).
If no header row is detected, the importer falls back to positional defaults (title, username, password, url, notes, ...). Empty rows are skipped silently; rows without a title fall back to the first non-empty field of up to 80 characters.
Two options live under Export ZIP in the menu:
- Encrypted ZIP (recommended). Asks for a password (4+ characters), produces an AES-256 encrypted ZIP that contains a single CSV file. The ZIP opens in 7-Zip, WinRAR, macOS Archive Utility 11+, p7zip, and any other tool with AES-256 ZIP support.
- Plain CSV is still served at
GET /api/export.csvfor trusted scenarios such as scripting. It includes a UTF-8 BOM so Excel reads non-ASCII characters correctly.
Both exports include image attachments serialised as a JSON array in the images column, so a round trip (export → import) preserves attachments faithfully.
The destructive Clear vault button at the bottom of the menu opens a confirmation sheet that requires typing DELETE in uppercase. Confirming wipes all items and the master password material so the next visit starts fresh.
Because vault.db is bind-mounted into ./data on the host, backing up is just a file copy:
# Hot copy (safe; SQLite is in WAL-less mode and only written via an atomic rename)
cp ./data/vault.db ./backups/vault-$(date +%F).dbTo restore, stop the container, replace data/vault.db with the desired snapshot, and start again:
docker compose stop
cp ./backups/vault-2025-12-31.db ./data/vault.db
docker compose startThe encrypted ZIP export is the best off-machine backup because it travels with its own password.
If you change anything in server.js, src/app.js, or src/theme.css, rebuild:
docker compose up -d --buildOnly changed layers are rebuilt thanks to Docker's layer caching, so most rebuilds finish in seconds. The image is rebuilt as a new container; your ./data/vault.db is unaffected.
To upgrade the base image (security patches in node:20-alpine):
docker compose build --pull
docker compose up -d- Threat model: Local Vault assumes a single user, a single trusted machine, and a trusted browser. It is not designed for multi-user environments or for being exposed to the public internet.
- Confidentiality at rest: every record is encrypted with AES-256-GCM before being written to
vault.db. The key never leaves the running container's memory. - Key derivation: scrypt with parameters
N=32768, r=8, p=1and a random 16-byte salt that is stored once when the master password is created. - Master password verifier: an HMAC-SHA-256 of the literal string
local-vault-master-verifier-v2keyed with the derived key. This lets us detect a wrong password without revealing the key. - Transport:
http://127.0.0.1:8124is served plain HTTP. Browsers treat127.0.0.1as a secure origin so the Clipboard API andSet-Cookiework, but the bytes never leave the loopback interface and never touch a router. - Headers include a strict
Content-Security-Policy(script-src 'self', no inline scripts),X-Content-Type-Options: nosniff,Referrer-Policy: no-referrer,Cache-Control: no-store, andframe-ancestors 'none'. - Session cookies:
HttpOnly; SameSite=Lax. Sessions live in process memory for eight hours of inactivity and are cleared on restart and onClear vault.
If you need remote access from another device, do not change the port binding. Use SSH local port forwarding (ssh -L 8124:127.0.0.1:8124 user@host) or Tailscale Serve (tailscale serve --https=443 http://127.0.0.1:8124) so the traffic stays on a private channel.
All endpoints are same-origin and authenticated by the lv_session cookie issued by /api/unlock. Status codes follow standard semantics; failures return a JSON { "error": "..." } body.
| Method | Path | Body | Notes |
|---|---|---|---|
| GET | /api/status |
— | Returns { configured, authenticated, count }. |
| POST | /api/unlock |
{ password } |
Creates the vault on first call, otherwise verifies and starts a session. |
| POST | /api/lock |
{} |
Drops the current session. |
| GET | /api/items |
— | Returns { items: [...] } (all fields decrypted). |
| POST | /api/items |
item fields | Returns { item }. |
| PUT | /api/items/:id |
item fields (partial allowed) | Merges with the existing record. |
| DELETE | /api/items/:id |
— | Hard delete. |
| POST | /api/import |
{ csv } or { rows: [...] } |
Imports inside a transaction; rolls back on failure. |
| GET | /api/export.csv |
— | Plain CSV with UTF-8 BOM. |
| POST | /api/export.zip |
{ password } (≥ 4 chars) |
AES-256 encrypted ZIP containing the CSV. |
| POST | /api/clear |
{ confirm: "DELETE" } |
Wipes items, settings, and sessions. |
localVault/
├── server.js Single-file HTTP server (~26 KB).
├── src/
│ ├── app.js Frontend source. Loaded by the build stage; removed from the runtime image.
│ └── theme.css Stylesheet. Served as-is at /theme.
├── dist/ Build artefacts (generated inside the image; gitignored).
├── data/ Bind-mounted into the container at /data. Holds vault.db.
├── package.json
├── package-lock.json
├── Dockerfile Two-stage build (Node 20 Alpine).
├── docker-compose.yml Single service, bind mount, loopback-only port mapping.
├── start.bat Windows one-click: build + run + open browser.
├── stop.bat Windows one-click: stop and remove the container.
├── .dockerignore
├── .gitignore
└── README.md
If you want to edit the frontend locally without Docker:
npm ci
npm run build
node server.jsnpm run build runs javascript-obfuscator against src/app.js and writes the obfuscated bundle to dist/app.bundle.js. The runtime expects dist/app.bundle.js to exist; src/app.js itself is never served. src/theme.css is served verbatim.
During iteration you can shorten the loop by lowering obfuscation cost — temporarily disable control-flow-flattening and dead-code-injection in package.json while you debug, then restore them for production builds.
http://127.0.0.1:8124 doesn't respond. Check that the container is running with docker compose ps. If it shows as restarting, run docker compose logs --tail=100 local-vault to see the start-up error.
Login screen still says "Create vault" although I already set a password. The container is reading a different vault.db than you expect. Confirm the bind mount target in docker-compose.yml matches the file you intended.
Copy buttons do nothing. Make sure you are visiting http://127.0.0.1:8124 (not the IP of another machine). The Clipboard API refuses to work over non-secure origins, and the fallback document.execCommand("copy") is no longer reliable in current browser versions.
Imported CSV ended up with the entire row in a single field. The file is probably not comma-separated (e.g. semicolons from Excel in some locales). Re-save it from your spreadsheet tool with comma delimiters.
The obfuscator build fails with Given input path must be a valid .js file. src/app.js is missing or empty at build time. Verify the file exists in the build context — .dockerignore should not exclude src/.
Released under the MIT License. See the LICENSE file for the full text.
Copyright (c) 2026 Suwatchai K. <suwatchai@outlook.com>