The Vaulty server. A Next.js app using SQLite (via libSQL) for storage.
Vaulty exposes a REST API for reading synced data.
API read access is authenticated via access tokens. Create and manage them in
the dashboard settings page. Tokens are prefixed with vault_ and validated
against the database.
You may choose to whitelist specific IPs to access the API. All whitelists are optional. If not set, all IPs are allowed.
On Vercel, IP detection works automatically. When self-hosting behind a reverse
proxy (nginx, Caddy, Cloudflare, etc), set TRUSTED_PROXY=true so the server
trusts forwarded headers like X-Real-IP and X-Forwarded-For. Without a
trusted proxy, these headers are trivially spoofable by clients and IP
whitelisting can be bypassed.
For rate limiting and other security considerations, see SECURITY.md.
When deploying to Vercel, you'll need a hosted libSQL database (e.g.
Turso). Set DATABASE_URL to your libsql:// URL and
DATABASE_AUTH_TOKEN to your auth token.
- Copy
.envand fill in your secrets:
cp .env.example .env- Start the stack:
docker compose up -dThis starts two containers:
- app — The Next.js server (exposed on port 3030 by default). The SQLite database is stored in a persistent Docker volume.
- cron — A lightweight Alpine container that calls the cleanup endpoint every 5 minutes
The database schema is applied automatically on startup via drizzle-kit push.
DATABASE_URL— libSQL connection string. Uselibsql://...for Turso orfile:./local.dbfor a local SQLite file.DATABASE_AUTH_TOKEN— Auth token (not needed for local SQLite)DASHBOARD_SECRET— Passphrase to access the web dashboardAPI_WRITE_SECRET— Secret for authenticating the Electron app when writing dataCRON_SECRET— Secret used to authenticate the cleanup cron job
DASHBOARD_IP_WHITELIST— Comma-separated IPs allowed to access the dashboardAPI_WRITE_IP_WHITELIST— Comma-separated IPs allowed to write dataAPI_READ_IP_WHITELIST— Comma-separated IPs allowed to read dataTRUSTED_PROXY— Set totrueif behind a reverse proxy that sets forwarded headers. Required for IP whitelisting to work when self-hosting.LOG_RETENTION_HOURS— Hours to keep logs (0 = no expiration)
Each source type also supports a <source>_RETENTION_HOURS environment variable
to control how long to keep data before cleanup. See .env.example for the
complete list.