# Bit

Bit is a self-hosted link shortener with minimal, cookie-free click analytics. It is open source and self-hosted, installable on Docker Hub.

Canonical page: https://ourlocalhost.com/app/8330/bit

## Description

Bit is a self-hosted link shortener with minimal, cookie-free click analytics. It tracks country, browser, OS, and referer per link, supports multiple users via API key authentication, and stays extremely lightweight. It's aimed at homelabbers and site owners who want simple link shortening and click stats without heavy dependencies or invasive tracking.

## Platform availability

Available on 1 of 10 platforms: Any server.

## Health score

67/100 (Good), based on 5 of 5 factors.
- Maintained: 82 (last commit 52 days ago)
- Popular: 41 (114 GitHub stars)
- Easy to install: 25 (1 install platform, install notes)
- Light to run: 100 (32 MB minimum RAM)
- Security check: 85 (no serious findings, CI)

## Links

- GitHub: https://github.com/sjdonado/bit
- Docker Hub: https://hub.docker.com/r/sjdonado/bit

## Common questions

### How do I create additional users in Bit?

Use the CLI inside the running container, for example: docker exec -it bit cli --create-user=Admin (or docker-compose exec it app cli --create-user=Admin). Keys can be created, listed and deleted via the CLI as documented in docs/SETUP.md.

### Which environment variables do I need to set when running Bit?

The required ones are ENV (production), DATABASE_URL, APP_URL, ADMIN_NAME, and ADMIN_API_KEY, which is typically generated with openssl rand -base64 32. Bit listens on port 4000, which you map with -p 4000:4000.

### How do I persist the SQLite database on Dokku?

Create and mount a persistent storage directory, e.g. dokku storage:ensure-directory bit-sqlite then dokku storage:mount bit /var/lib/dokku/data/storage/bit-sqlite:/usr/src/app/sqlite/, and set DATABASE_URL to sqlite3://./sqlite/data.db.

### Does Bit work behind a reverse proxy with HTTPS?

Yes. On Dokku you can set your domain with dokku domains:set, enable Let's Encrypt, and add port mappings http:80:4000 and https:443:4000. Bit also forwards X-Forwarded-For and User-Agent headers on redirects, so client IPs are preserved.

### How is Bit's GeoIP and user-agent data kept up to date?

Bit automatically updates both the UA regexes and the GeoLite2 database, so no manual refresh of those datasets is needed.

## Alternatives

- Foam: Foam is a personal knowledge management and sharing system inspired by Roam Research, built on Visual Studio Code and GitHub.
- Gardenjs
- Google Docs
- Lerna
- Microsoft Word: Widely-used word processor offering extensive document editing tools, SmartArt, PDF support, and integrated search features on multiple pla…
- Nx
- Replit: In-browser IDE supporting 50+ languages with an AI assistant, real-time collaboration, Git support, hosting, deployment, and live code shar…
- storybook: Storybook is a free, open source frontend workshop for developing, testing, and documenting user interface (UI) components and pages in iso…

---
Source: Our Local Host (https://ourlocalhost.com/app/8330/bit), the self-hosted and open-source app directory.
