Kanbun overview and setup
Features
- Boards, columns and cards with drag and drop that works with a mouse, on touch screens (long-press) and with the keyboard (Space, arrows), with screen-reader announcements. Every card also has a "Move to" action.
- Search everything with Cmd/Ctrl+K: boards, card titles, descriptions and comments (SQLite FTS5 or PostgreSQL full-text search), plus quick commands.
- Board, list and calendar views, saved filters shared with the board, and a "My tasks" page grouped into overdue, today, upcoming and done this week.
- Swimlanes: group the board into rows by assignee, priority or tag (
?group=in the URL). Drag a card, or move it with the keyboard (Shift+Up/Down while moving), into another lane to change its assignee, priority or tag. A card with several assignees or tags is moved from the first lane it belongs to and shows a read-only copy in the others. WIP limits still count the whole column. - Card history: moves, edits, assignees, tags and dependencies in one timeline with comments; @mention autocomplete; searchable pickers.
- Board insights from the card history: cycle time (median and 85th percentile, with its distribution), throughput per week, a cumulative flow chart over 30 or 90 days and aging work in progress, each chart also readable as a table. Cards that have sat in a column much longer than usual for that board get a quiet hourglass on the board.
- Cards open in a side panel over the board; keyboard shortcuts for common actions (press
?on a board). - Live board updates over Server-Sent Events: changes appear for everyone on the board without a refresh, with avatars of who is viewing the board and who has the same card open.
- Checklists with an assignee and due date per item (reorder, convert to card), tags, comments, blocking dependencies, priorities, deadlines.
- File and image attachments on cards, stored next to the database or in S3-compatible object storage. Large images get a small WebP preview (480px wide) made on the server and stored next to the original.
- Per-board membership with owner/member roles. Admin override.
- User profiles with year-long activity heatmap, latest moves, latest comments.
- Active and recent sessions per user, with web/mobile/desktop detection.
- Online dot driven by a 60s heartbeat. 5-minute online window.
- Markdown in card descriptions and comments, WIP limits, card covers, board filters.
- Notifications for assignments, @mentions, blocked cards and watched cards and boards, each set to in-app, in-app + email (optional SMTP) or off, with an optional daily digest.
- Trash with undo: deleted cards, columns and boards can be restored for 30 days.
- Card archive: archive finished cards (with undo) or let a board archive the cards that have been in its last column for N days. Archived cards leave the board and its counts but stay in search, insights, exports and the API, and can be restored from the board's archive at any time.
- Card templates (title, description, priority, tags, checklist) and repeating cards ("Every Monday", "Monthly on the 1st") per board.
- Simple automations per board, written in plain language: "When a card enters Done: mark the checklist done, remove tag Blocked", or "When a card's deadline passes: move to Overdue". Rules can assign or unassign, add or remove a tag, set the priority, set or clear the deadline (today + N days) and complete the checklist. Every change shows in the card history under the rule's name and can be undone.
- REST API with personal access tokens (read or read and write, optional expiry) for boards, columns, cards, comments, checklists, attachments, tags, automation rules and search, an OpenAPI 3.1 description, and signed outgoing webhooks per board. See docs/API.md.
- First-run setup in the browser and built-in board templates (Simple, Software, Personal).
- Deactivate users instead of deleting them: they can no longer sign in, but their work stays.
- Single sign-on with any OpenID Connect provider (Authentik, Keycloak, Google Workspace) alongside passwords, and optional two-factor authentication (TOTP with recovery codes) for password accounts. See docs/SSO.md.
- Runs on SQLite by default; PostgreSQL and Redis let several instances run behind a load balancer. See docs/SCALING.md.
- Security headers with a nonce-based Content Security Policy, rate-limited sign-in, and an operator checklist in SECURITY.md.
- Import boards from Trello or Kanbun JSON, import cards from CSV with a preview, export a board as JSON or CSV, and (admins) export everything or download a one-click backup. Optional scheduled backups write the same archive daily or weekly to a folder or the S3 bucket and keep the last N. See docs/IMPORT-EXPORT.md and Backup and restore.
- Admin audit log of sign-ins, user and role changes, board deletions, membership changes, imports, exports and backups, with filters and CSV download.
- Accessible by default: WCAG 2.2 AA checked with axe in light and dark themes on every CI run, Lighthouse accessibility 100 on every main page.
- Fast on big boards: a 500-card board loads in about half a second (docs/PERFORMANCE.md).
- Light, dark and system theme, IBM Plex Sans bundled (no external font requests). UI in English, Polish, German, Italian, French, Spanish, Brazilian Portuguese, Dutch, Czech and Ukrainian (see src/locales to add a language); the login screen follows the browser language.
- Mobile responsive with hamburger drawer and safe-area insets. Installable PWA that works offline: boards opened before stay readable, and card edits made offline sync when the connection returns (docs/OFFLINE.md).
- Loading skeletons on every data-fetching page.
Stack
- Next.js 16 (App Router, server components by default)
- TypeScript
- Prisma + SQLite (
file:./dev.db) by default, PostgreSQL and Redis optional for running several instances (docs/SCALING.md) - Auth.js v5 (credentials + JWT sessions, bcrypt)
- React 19, Tailwind CSS v3 with
darkMode: "class"
Quick start (local)
cp .env.example .env
# edit AUTH_SECRET to a long random string
npm install
npx prisma migrate deploy
npm run dev
Open http://localhost:3000. On a new database Kanbun opens the first-run setup: create the admin account, then pick a first board (Simple, Software, Personal or blank).
Want to look around first? On an empty database, npm run seed:demo creates a demo workspace instead (log in as admin / demo1234).
Checks (also run in CI):
npm run lint
npm run typecheck
npm test
# End-to-end and accessibility tests (Playwright + axe) against a production build
npx playwright install chromium # once
npm run build && npm run test:e2e
The e2e suite starts its own server on port 3456 with a throwaway demo database (prisma/e2e.db), plus a second one on port 3457 with an empty database (prisma/e2e-setup.db) for the first-run setup test. Set E2E_PORT to move both.
Quick start (Docker)
cp .env.example .env
# edit AUTH_SECRET
docker compose up -d --build
Then open the app in your browser (http://localhost:3000 by default). The first visit shows the setup screen: create the admin account and your first board. Setup is only available while the database has no users.
Data persists in the kanbun-data volume at /data/kanbun.db. Card attachments are stored next to the database in /data/attachments, so the same volume keeps them; back up the whole /data folder, not only the database file (or use the one-click or scheduled backup below).
Backup and restore
Admins can download a backup from Admin > Backup and export > Download backup. It is a .tar.gz with:
kanbun.db: a consistent snapshot of the SQLite database, made withVACUUM INTOwhile Kanbun keeps running,attachments/: every attachment file,backup.json: the Kanbun version, the time of the backup and where attachments are stored.
The download is recorded in the audit log. It only works with the built-in SQLite database; with another database engine, back up with that engine's tools (for PostgreSQL, pg_dump, see Backups with PostgreSQL) and copy the attachments folder.
With attachments in S3 (see Attachments in S3) the archive holds the database only: backup.json says the files are in S3 and not included ("attachmentStorage": { "type": "s3", "included": false, ... }), and the admin page shows the same note. Back up the bucket with your provider's tools (versioning, replication or a scheduled bucket copy).
Scheduled backups
Kanbun can also write that archive on a schedule. It is off until you set BACKUP_SCHEDULE and a destination:
BACKUP_SCHEDULE=daily # or weekly
BACKUP_DIR=/data/backups # a folder; in Docker, on the same volume as the database
BACKUP_KEEP=7 # how many archives to keep (1 to 365, default 7)
- The archive is the same
.tar.gzas the download (kanbun-backup-<date>.tar.gz, time in UTC), restored the same way. A background job checks every hour and writes one when the newest archive in the destination is older than a day (or a week); the first one is written a few seconds after start. With several instances (Redis), one instance runs it. - The file is written under a temporary name and renamed when complete, readable by its owner only (mode
600). After a successful backup the oldestkanbun-backup-*.tar.gzfiles beyondBACKUP_KEEPare deleted; nothing else in the folder is touched, and a failed backup deletes nothing. - Without
BACKUP_DIR, and with attachments in S3, the archives go to the same bucket underbackups/(BACKUP_S3_PREFIXpicks another prefix, which must not be insideATTACHMENTS_S3_PREFIX). The keys then also needs3:ListBucketands3:DeleteObjecton that prefix. As with the download, the archive holds the database only: the attachment files stay in the bucket, which needs its own protection (versioning or replication). If several Kanbun instances share a bucket, give each its ownBACKUP_S3_PREFIX, since old archives under the prefix are pruned. BACKUP_DIRcan not be the attachments folder or inside it (each archive would end up in the next one), nor the database file. A relative path is resolved against the working directory, likeATTACHMENTS_DIR.- Every run is in the audit log ("Scheduled backup written" with the file, size, destination and how many old archives were deleted, or "Scheduled backup failed" with the error). Admin > Backup and export shows the settings, the last backup and the last failure, and has Run backup now.
- Copy the archives off the server too (rsync, restic, a bucket replication rule): a folder on the same disk does not survive the loss of that disk.
Backups with PostgreSQL
The one-click and scheduled backups are SQLite only. On PostgreSQL, schedule pg_dump (or use your managed service's backups) and back up the attachments folder or bucket separately. For example, a nightly cron entry on a host that can reach the database, keeping 14 days:
# /etc/cron.d/kanbun-backup
0 3 * * * kanbun pg_dump --format=custom --file="/backups/kanbun-$(date +\%F).dump" "postgresql://kanbun:<password>@db:5432/kanbun" && find /backups -name 'kanbun-*.dump' -mtime +14 -delete
Restore with pg_restore --clean --if-exists --no-owner --dbname "$DATABASE_URL" kanbun-<date>.dump while Kanbun is stopped. With the Compose setup from docs/SCALING.md, docker compose -f docker-compose.postgres.yml exec -T postgres pg_dump -U kanbun --format=custom kanbun > kanbun-$(date +%F).dump makes the same dump from the host.
Restore
To restore a backup into the Docker setup:
docker compose stop kanbun
mkdir restore && tar -xzf kanbun-backup-<date>.tar.gz -C restore
# copy the files into the kanbun-data volume, replacing what is there
docker run --rm -v kanbun_kanbun-data:/data -v "$PWD/restore":/restore alpine \
sh -c 'rm -rf /data/kanbun.db /data/kanbun.db-journal /data/kanbun.db-wal /data/kanbun.db-shm /data/attachments && cp -a /restore/kanbun.db /restore/attachments /data/'
docker compose start kanbun
(The volume is usually named <project>_kanbun-data; docker volume ls shows it.) Without Docker, stop Kanbun, replace the database file named in DATABASE_URL and the attachments folder (ATTACHMENTS_DIR, or attachments next to the database) with the ones from the archive, and start it again. Migrations run on start, so a backup from an older version is upgraded automatically; do not restore a backup into an older version than the one that made it.
Boards can also be moved between instances with the JSON export and import, see docs/IMPORT-EXPORT.md.
Admin from the command line (optional)
You don't need this for a new install, the browser setup creates the first admin. The script is still there for headless installs and for recovering access:
npm run create-admin
# or, in Docker:
docker compose exec kanbun npm run create-admin
You will be prompted for username, display name, and password. The script creates an admin user, or upgrades an existing user to admin and resets their password (and, if they have two-factor authentication on, offers to turn it off).
Environment
DATABASE_URL- SQLite URL, e.g.file:./dev.dborfile:/data/kanbun.db, or a PostgreSQL URL (postgresql://user:pass@host:5432/kanbun, see docs/SCALING.md)REDIS_URL- optional, e.g.redis://redis:6379. Needed only to run several instances behind a load balancer: shares live updates, presence, rate limits and job locks between them.KANBUN_REDIS_PREFIXsets the key prefix (defaultkanbun:)AUTH_SECRET- long random string used to sign JWT cookiesAUTH_TRUST_HOST- set totruewhen behind a proxyNEXTAUTH_URL- public URL of the app (also the base for links in emails;AUTH_URLworks too)SMTP_URL- optional, enables email notifications, e.g.smtp://user:pass@smtp.example.com:587(usesmtps://for port 465). Without it email is off and the settings page says so.SMTP_FROM- sender for notification emails, e.g.Kanbun <kanbun@example.com>ATTACHMENTS_DIR- optional folder for card attachments. Defaults to anattachmentsfolder next to the SQLite file (/data/attachmentsin Docker,prisma/attachmentsforfile:./dev.db). Set it with PostgreSQL, and point every instance at the same shared volume, or use S3 insteadATTACHMENTS_S3_BUCKET- optional: store attachments in this S3-compatible bucket instead of on disk (AWS S3, MinIO, Cloudflare R2, Backblaze B2). UsesATTACHMENTS_S3_ACCESS_KEY_IDandATTACHMENTS_S3_SECRET_ACCESS_KEY(plusATTACHMENTS_S3_SESSION_TOKENfor temporary keys), or without them the AWS credential chain (AWS_*variables, EKS web identity, ECS or EC2 roles); further optionsATTACHMENTS_S3_REGION(defaultus-east-1;autofor R2),ATTACHMENTS_S3_ENDPOINT(for anything but AWS, e.g.http://minio:9000),ATTACHMENTS_S3_FORCE_PATH_STYLE(1or0; defaults to on when an endpoint is set) andATTACHMENTS_S3_PREFIX(a folder inside the bucket). See Attachments in S3ATTACHMENT_MAX_MB- optional upload limit per file in megabytes, default10(also for uploads through the REST API)IMPORT_MAX_MB- optional size limit for imported files (Trello, Kanbun JSON, CSV) in megabytes, default20AUDIT_RETENTION_DAYS- how long audit log entries are kept, default365;0keeps them foreverBACKUP_SCHEDULE- optional scheduled backups (SQLite only):dailyorweekly; unset oroff(the default) turns them off. See Scheduled backupsBACKUP_DIR- folder for the scheduled backup archives, e.g./data/backups. Without it, and with attachments in S3, they go to the attachments bucket underBACKUP_S3_PREFIX(defaultbackups/)BACKUP_KEEP- how many scheduled backups to keep,1to365, default7TZ- time zone for repeating card schedules, e.g.Europe/Warsaw(the server clock otherwise)API_RATE_LIMIT- optional, REST API requests per token per minute, default120TRUSTED_PROXIES- number of reverse proxies in front of Kanbun that append toX-Forwarded-For, default1. The client address for rate limits and the audit log is read that many entries from the right, so clients can not choose it. Set2behind a CDN plus nginx, for example. See SECURITY.mdWEBHOOK_ALLOW_PRIVATE- set to1to let webhooks post to private, loopback and link-local addresses (for receivers on your own network). Off by default, so a board owner can not make the server call internal services.OIDC_ISSUER,OIDC_CLIENT_ID,OIDC_CLIENT_SECRET,OIDC_NAME- optional single sign-on with an OpenID Connect provider (Authentik, Keycloak, Google Workspace, ...). Further options:OIDC_SCOPES,OIDC_ALLOW_SIGNUP,OIDC_ADMIN_GROUP,OIDC_MATCH_USERNAME,OIDC_MATCH_EMAIL,OIDC_DISABLE_PASSWORD. See docs/SSO.md.
Attachments in S3
By default attachment files live on the local disk. Set ATTACHMENTS_S3_BUCKET and the keys to keep them in an S3-compatible bucket instead, which is the easiest way to share them between several instances (docs/SCALING.md). The bucket stays private: downloads still go through Kanbun, which checks board access and streams the file with the same headers as from disk, so no public bucket policy or presigned URLs are needed.
# AWS S3
ATTACHMENTS_S3_BUCKET=kanbun-attachments
ATTACHMENTS_S3_REGION=eu-central-1
ATTACHMENTS_S3_ACCESS_KEY_ID=AKIA...
ATTACHMENTS_S3_SECRET_ACCESS_KEY=...
# MinIO: add the endpoint (path-style addressing is used automatically)
ATTACHMENTS_S3_ENDPOINT=http://minio:9000
# Cloudflare R2: ATTACHMENTS_S3_ENDPOINT=https://<account id>.r2.cloudflarestorage.com and ATTACHMENTS_S3_REGION=auto
# Backblaze B2: ATTACHMENTS_S3_ENDPOINT=https://s3.<region>.backblazeb2.com and ATTACHMENTS_S3_REGION=<region>
The keys need s3:PutObject, s3:GetObject and s3:DeleteObject on the bucket (or prefix), plus s3:ListBucket so a missing file answers 404 rather than 403. Kanbun signs requests itself (AWS Signature Version 4, no AWS SDK). A misconfigured bucket is reported in the log at startup.
Temporary credentials work too. Add ATTACHMENTS_S3_SESSION_TOKEN to static keys that come with a session token. Or leave both ATTACHMENTS_S3_ACCESS_KEY_ID and ATTACHMENTS_S3_SECRET_ACCESS_KEY unset, and Kanbun looks for credentials the way the AWS SDKs do, in this order:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYand optionalAWS_SESSION_TOKEN.- Web identity, as on EKS with IAM roles for service accounts:
AWS_WEB_IDENTITY_TOKEN_FILEandAWS_ROLE_ARN(optionalAWS_ROLE_SESSION_NAME), exchanged with STSAssumeRoleWithWebIdentityat the regional endpoint ofAWS_REGIONwhen set. - Container credentials, as on ECS or with EKS Pod Identity:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URIorAWS_CONTAINER_CREDENTIALS_FULL_URI, withAWS_CONTAINER_AUTHORIZATION_TOKENorAWS_CONTAINER_AUTHORIZATION_TOKEN_FILEwhen set. - The EC2 instance role, from instance metadata (IMDSv2, one-second timeouts).
AWS_EC2_METADATA_DISABLED=trueskips it.
Temporary credentials are cached and fetched again five minutes before they expire. Config and credential files in ~/.aws and SSO profiles are not read.
To move existing attachments from the disk to the bucket, set the ATTACHMENTS_S3_* variables and run, with Kanbun stopped or before switching:
npm run attachments:to-s3 -- --dry-run # counts what it would copy
npm run attachments:to-s3 # copies; run again to resume, existing objects are skipped
# Docker: docker compose run --rm -e ATTACHMENTS_S3_BUCKET=... kanbun npm run attachments:to-s3
--from <folder> picks another source folder (by default ATTACHMENTS_DIR, or attachments next to the SQLite database). The local files are left in place; delete them once Kanbun runs on S3 and downloads work.
Single sign-on and two-factor authentication
Kanbun can sign people in through your identity provider (OpenID Connect) alongside passwords, and password accounts can turn on two-factor authentication with an authenticator app in Settings (with single-use recovery codes; admins can reset it from the users page). Setup for Authentik, Keycloak and Google Workspace, the account linking rules, the break-glass admin login and the 2FA details are in docs/SSO.md. The TOTP secrets are encrypted with a key derived from AUTH_SECRET, so changing AUTH_SECRET requires resetting existing 2FA setups.
Notifications
People get notified when they are assigned, mentioned or their card gets blocked, and about cards and boards they watch: new comments, moves to another column and approaching deadlines (due today or tomorrow) for watched cards, new cards for watched boards. You watch a card automatically when you create it, comment on it or are assigned to it; the "Watch" button in the card and board header toggles it by hand. You are never notified about your own actions, and one event gives at most one notification per person (the most specific reason wins, e.g. a mention over a comment).
In Settings, under "Notifications", each type is set to one of: In-app (default), In-app + email (email always comes with the in-app notification) or Off. Email needs SMTP_URL and an email address in your settings. The Daily digest (off by default) emails once a day a summary of new notifications you have not read. Emails are sent in the background; a failing SMTP server is logged and never blocks the action.
Project layout
src/
app/
(app)/ authenticated routes
api/auth/... Auth.js handlers
api/v1/... REST API (docs/API.md, docs/openapi.json)
api/session/... heartbeat
login/ English-only login screen
setup/ first-run setup (admin account, first board)
components/ UI building blocks
lib/ i18n, locale, prisma client, helpers
server/ server actions
server/jobs/ background jobs (reminders, digest, recurring cards, auto-archive, scheduled backups)
auth.ts Auth.js setup
proxy.ts protects routes
prisma/
schema.prisma data model (SQLite, the source of truth)
postgres/ generated PostgreSQL schema, its migrations and search SQL
public/
manifest.webmanifest PWA manifest
sw.js service worker (offline support)
icons/ app icons (PNG + SVG)
scripts/
create-admin.ts optional CLI to create or reset an admin
db.mjs generate clients / migrate for the database in DATABASE_URL
sqlite-to-postgres.ts copy a SQLite install into PostgreSQL
seed-large.ts a 500-card board for performance testing (npm run seed:large)
perf-board.ts measures that board on a production build
Notes
- Schema changes: edit
prisma/schema.prisma, thennpx prisma migrate dev --name <change>, and create the PostgreSQL migration too (npm run db:pg:baselineornpm run db:pg:migration -- <change>, see docs/SCALING.md). - The session heartbeat creates a
panelSessionIdcookie scoped per browser. - Card moves are logged to
TaskCardMoveEventonly when the column actually changes. - Deleted cards, columns and boards are stored as JSON snapshots in
TrashItemand restored with their original ids (src/server/trash.ts). Items older than 30 days are purged on the next delete. - Archived cards are the opposite: they stay live
TaskCardrows witharchivedAtset (src/server/card-archive.ts), so every query that shows or counts a board's cards filters onLIVE_CARD(src/lib/card-archive.ts), while search, insights, exports and the API see them. - Search uses an FTS5 table (
CardSearch) kept in sync by SQLite triggers (migration20261118100000_card_search). Prisma does not model it, soprisma migrate devwill proposeDROP TABLE "CardSearch..."in new migrations: delete those lines. A migration that rebuildsTaskCardorTaskCardCommentmust recreate the triggers. - Server actions return typed results (
{ ok, error }, seesrc/lib/action-result.ts); the UI turns error codes into translated toasts. - Card-to-card blocking is restricted to the same board and prevents self-cycles.
- Sessions are JWTs, but the user is re-read from the database on every request, so deactivating or deleting a user, changing a role, or resetting a password applies immediately.
- The admin audit log (
AuditLog,/admin/audit) records security-relevant events throughaudit()insrc/server/audit.ts. Failed sign-ins record the username that was tried, never the password. Old entries are purged by theaudit-purgebackground job. - Failed logins are rate limited per IP and username, and per username across all addresses (in memory, or in Redis when
REDIS_URLis set). The client IP is the entryTRUSTED_PROXIESpositions from the right ofX-Forwarded-For, so put Kanbun behind a reverse proxy that appends to it. The security model and an operator hardening checklist are in SECURITY.md. - Pages are served with a nonce-based Content-Security-Policy (
src/lib/csp.ts, set insrc/proxy.ts); other security headers are innext.config.mjs. - Offline support needs HTTPS (or localhost) and an uncached
/sw.js; see docs/OFFLINE.md for what is stored in the browser and when it is deleted. - Performance: the 500-card board budget, how to measure it and the rules that keep the board fast (memoized columns and cards, stable handlers) are in docs/PERFORMANCE.md.
E2E_PERF=1 npx playwright test e2e/perf.spec.tsruns the performance guard. - Live updates use an in-process event bus (
src/lib/realtime.ts) and SSE endpoints at/api/boards/<id>/events(a single board) and/api/boards/events(the boards list). In process by default; withREDIS_URLevents go through Redis pub/sub so every instance delivers them (docs/SCALING.md).
Security
See SECURITY.md for how to report a vulnerability (privately, through GitHub security advisories), the security model and a hardening checklist for operators.
License
Kanbun is dual-licensed.
- AGPL-3.0-only for open-source / self-hosted use. Full text in LICENSE.
- Commercial license available for organizations that cannot accept the AGPL network-copyleft clause, or for OEM / SaaS embedding. Contact: mrsanten@tuta.com.
The project is funded through enterprise licensing and managed hosting. There are no paid Pro plugins, and none are planned for now: the community edition in this repository is the whole product and stays AGPL. For an enterprise license, managed hosting or other commercial terms, contact mrsanten@tuta.com.
See LICENSING.md for the long form.
Contributing
Where the project is heading and the design rules it follows: docs/ROADMAP.md and docs/DESIGN.md.
The website at kanbun.io is built from website/, a separate Astro package. Its docs pages are the Markdown files in this repository (docs/*.md, this README, the changelog, LICENSING.md and SECURITY.md), rendered at build time, so editing them here updates the site.
Contributions go through a Contributor License Agreement so that the project can offer both AGPL and commercial licenses. See CLA.md. The CLA assistant bot will prompt you on your first PR.