← All posts

Self-Hosted Invoicing with Docker (Coolify & Dokploy Guide)

  • selfhosted
  • docker
  • opensource
  • invoicing

Self-hosting your invoicing means your client data, invoices, and numbers live on infrastructure you control: no subscription, no lock-in, no third party holding your books. With a single-container app like Inkvoice it takes minutes. Here’s how to do it on plain Docker, Coolify, or Dokploy.

Why self-host your invoicing

  • You own the data. Everything lives in one SQLite file on your server.
  • No per-seat pricing. Run it for your whole team for the cost of a tiny VPS.
  • Tiny footprint. Inkvoice idles under 100 MB of RAM, so the cheapest VPS tier is plenty.

(Prefer not to run a server at all? There’s a managed Cloud. Skip to the end.)

What you need

A host that runs Docker. A $4 to $6/mo VPS is fine. You’ll expose port 3000 and keep a persistent volume so the database survives redeploys.

Option A: Plain Docker

Inkvoice ships as a prebuilt multi-arch image, so there’s nothing to clone and nothing to build. Save this as docker-compose.yml:

services:
  app:
    image: ghcr.io/pigontech/inkvoice:latest
    ports:
      - "3000:3000"
    volumes:
      - invoice-data:/app/data
    mem_limit: 512m
    environment:
      ADMIN_PASS: pick-a-strong-password
      JWT_SECRET: ${JWT_SECRET:?generate one into .env first}
      # Plain HTTP (localhost or a bare server IP) needs this. Switch it to
      # "true" once Inkvoice is behind HTTPS, or browsers drop the login cookie.
      COOKIE_SECURE: "false"
    restart: unless-stopped

volumes:
  invoice-data:

Generate the signing secret into a .env file next to it (Inkvoice refuses to start without one of at least 32 characters, and it has to stay the same across restarts), then start it:

echo "JWT_SECRET=$(openssl rand -base64 48)" > .env
docker compose up -d

Open http://localhost:3000 (or your server’s IP) and log in as admin with the password you set. The volume on /app/data is what keeps the SQLite database safe across restarts and upgrades.

Option B: Coolify

  1. New Resource → Public Repository → paste the repo URL.
  2. Build pack: Dockerfile (repo root).
  3. Port: 3000.
  4. Persistent storage: add a volume on /app/data. Without it, every deploy wipes the database.
  5. Environment: set JWT_SECRET (≥ 32 chars), ADMIN_PASS, and COOKIE_SECURE=true.
  6. Domain: attach one (Coolify issues a Let’s Encrypt cert), then set ENABLE_HSTS=true.
  7. Health check: point it at /health.

Option C: Dokploy

Inkvoice is in the official Dokploy templates catalog:

  1. In your Dokploy panel, open a project and click Create Service → Template.
  2. Search for Inkvoice and click Create.
  3. Dokploy generates ADMIN_PASS and JWT_SECRET, mounts /app/data, and routes a domain to port 3000.
  4. Deploy, then sign in as admin with the generated password.

The catalog template ships COOKIE_SECURE=false so login works on Dokploy’s auto-generated HTTP domain. After you attach an HTTPS custom domain, set COOKIE_SECURE=true and ENABLE_HSTS=true.

The env vars that actually matter

  • JWT_SECRET: a random string of at least 32 characters. Don’t skip this.
  • ADMIN_PASS: your initial admin password.
  • COOKIE_SECURE=true and ENABLE_HSTS=true: once you’re on HTTPS.
  • A volume on /app/data: the single most important step, because it’s where your data lives.

Backups are trivial

Because it’s one SQLite file under /app/data, backing up is just copying that file (or snapshotting the volume) on a schedule. Restoring is dropping it back. No database dumps, no orchestration.

Upgrades are one command

docker compose pull && docker compose up -d

Database migrations run automatically on boot. For a stable deployment, pin a release tag such as ghcr.io/pigontech/inkvoice:0.3.0 instead of latest.

…or skip the ops entirely

Self-hosting is great, but it’s not for everyone. If you’d rather not manage a server, Inkvoice Cloud gives you the same open-source app with zero setup, a free tier to start on, and your data exportable anytime. Either way you own your billing. Star or fork it on GitHub.