Install

Three ways to run FireBin

Pick the one that matches what you already have. Every step is copy-and-paste, and you can move your data between them later with the built-in JSON backup.

1 Docker Compose Easiest

A first look on your desktop or a home server

2 Home Assistant Add-on

You already run Home Assistant

3 Kubernetes Advanced

You already run a cluster

FireBin is in alpha. Whichever way you run it, the first account you register becomes the admin, and registration then closes. Keep a backup (Settings → Data).
1

Docker Compose on your computer

The quickest way to try FireBin. It runs three small containers (the database, the API, and the web app) on your own machine, and opens in your browser.

You will need

  1. 1. Make a folder and a file

    Create a folder called firebin, and inside it a file named docker-compose.yml with this in it:

    name: firebin
    
    services:
      postgres:
        image: postgres:16
        restart: unless-stopped
        environment:
          POSTGRES_USER: firebin
          POSTGRES_PASSWORD: firebin
          POSTGRES_DB: firebin
        volumes:
          - pgdata:/var/lib/postgresql/data
    
      firebin-api:
        image: ghcr.io/fireball1725/firebin-api:latest
        restart: unless-stopped
        environment:
          DATABASE_URL: postgres://firebin:firebin@postgres:5432/firebin?sslmode=disable
          JWT_SECRET: paste-a-long-random-string-here
        depends_on: [postgres]
        volumes:
          - attachments:/app/data/attachments
    
      # This service must stay named "firebin-api": the web container proxies /api to it.
      firebin-web:
        image: ghcr.io/fireball1725/firebin-web:latest
        restart: unless-stopped
        ports:
          - "8080:3000"        # open http://localhost:8080
        depends_on: [firebin-api]
    
    volumes:
      pgdata:
      attachments:
  2. 2. Set a session secret

    Replace paste-a-long-random-string-here with a long random value. On Mac or Linux, generate one with:

    openssl rand -base64 48

    Keep it the same over time; changing it signs everyone out.

  3. 3. Start it

    In a terminal, from inside the firebin folder:

    docker compose up -d

    Docker downloads the three images and starts them. The API sets up its own database tables on first boot.

  4. 4. Open it

    Go to http://localhost:8080 and register the first account. That account is the admin.

Stopping and updating

docker compose down stops it; your data stays in the volumes. docker compose pull && docker compose up -d updates to the latest images.

Camera and label printing

The camera scanner and Brother tape printing work on localhost. On another machine over the network, you need HTTPS (see the deploy guide).

For a real server with a domain and HTTPS, use the production compose in the firebin repo.

2

Home Assistant add-on

If you already run Home Assistant, you can install FireBin as an add-on. Home Assistant runs it as a container for you, so there is no compose file and nothing to manage in a terminal.

You will need

  1. 1. Add the FireBin add-on repository

    In Home Assistant, go to Settings → Add-ons → Add-on Store. Open the menu (top right, three dots) → Repositories, and paste:

    https://github.com/FireBall1725/firebin
  2. 2. Install FireBin

    FireBin now appears near the bottom of the store. Open it and press Install. It bundles its own database, so there is nothing else to set up.

  3. 3. Start it

    Press Start. Turn on Start on boot and Watchdog so it stays running and restarts itself.

  4. 4. Open it

    Open the add-on's Web UI (the Open Web UI button), or browse to your Home Assistant address on port 3000. Register the first account to become the admin.

The add-on keeps its database inside Home Assistant's own storage, so it is included in your Home Assistant backups. It runs on Intel, AMD, and ARM boards. This add-on is new, so treat it as a first cut.
3

Kubernetes with CloudNativePG

For a homelab or server already running Kubernetes. The database is run by the CloudNativePG operator; the API and web app are ordinary Deployments. This one assumes you know your way around kubectl.

You will need

  1. 1. Install the CloudNativePG operator

    Once per cluster. This installs the operator that runs Postgres for you:

    kubectl apply --server-side -f \
      https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.24/releases/cnpg-1.24.1.yaml
  2. 2. Apply FireBin

    Save this as firebin.yaml, replace the two paste-... values and the ingress host, then kubectl apply -f firebin.yaml:

    apiVersion: v1
    kind: Namespace
    metadata:
      name: firebin
    ---
    # The database, run by the CloudNativePG operator.
    apiVersion: postgresql.cnpg.io/v1
    kind: Cluster
    metadata:
      name: firebin-db
      namespace: firebin
    spec:
      instances: 1
      storage:
        size: 5Gi
      bootstrap:
        initdb:
          database: firebin
          owner: firebin
    ---
    apiVersion: v1
    kind: Secret
    metadata:
      name: firebin-secrets
      namespace: firebin
    type: Opaque
    stringData:
      jwt-secret: paste-a-long-random-string-here
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: firebin-api
      namespace: firebin
    spec:
      replicas: 1
      selector: { matchLabels: { app: firebin-api } }
      template:
        metadata: { labels: { app: firebin-api } }
        spec:
          containers:
            - name: api
              image: ghcr.io/fireball1725/firebin-api:latest
              ports: [{ containerPort: 8080 }]
              env:
                # CloudNativePG writes the db user/password into <cluster>-app.
                - name: DB_USER
                  valueFrom: { secretKeyRef: { name: firebin-db-app, key: username } }
                - name: DB_PASS
                  valueFrom: { secretKeyRef: { name: firebin-db-app, key: password } }
                - name: DATABASE_URL
                  value: postgres://$(DB_USER):$(DB_PASS)@firebin-db-rw:5432/firebin?sslmode=require
                - name: JWT_SECRET
                  valueFrom: { secretKeyRef: { name: firebin-secrets, key: jwt-secret } }
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: firebin-api
      namespace: firebin
    spec:
      selector: { app: firebin-api }
      ports: [{ port: 8080, targetPort: 8080 }]
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: firebin-web
      namespace: firebin
    spec:
      replicas: 1
      selector: { matchLabels: { app: firebin-web } }
      template:
        metadata: { labels: { app: firebin-web } }
        spec:
          containers:
            - name: web
              image: ghcr.io/fireball1725/firebin-web:latest
              ports: [{ containerPort: 3000 }]
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: firebin-web
      namespace: firebin
    spec:
      selector: { app: firebin-web }
      ports: [{ port: 80, targetPort: 3000 }]
    ---
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: firebin
      namespace: firebin
    spec:
      rules:
        - host: firebin.example.com
          http:
            paths:
              - path: /
                pathType: Prefix
                backend:
                  service:
                    name: firebin-web
                    port: { number: 80 }
  3. 3. Open it

    Point firebin.example.com at your ingress and open it, or try it first with a port-forward:

    kubectl -n firebin port-forward svc/firebin-web 8080:80
    # then open http://localhost:8080

The CloudNativePG cluster handles its own backups and failover once you configure them; see the CloudNativePG docs for scheduled backups to object storage.

Once it is running

Register the first account, then add a Digi-Key API app under Settings → Enrichment so scanning a bag fills in datasheets and pricing. Scan a distributor barcode, and you are off.