Skip to main content
Self-hosting requires comfortable familiarity with Linux server administration, Docker, and SQL. Plan for a half-day of setup time. Contact support@harbinge.rs before starting — we provide a migration bundle and a custom-compiled APK for self-hosted deployments.

Overview

A self-hosted Forager deployment consists of four components: The Android app has your Supabase URL and anon key compiled in. Harbingers builds this APK for you once your Supabase instance is running — you cannot reuse the standard APK from the downloads page.

Prerequisites

Before starting, ensure the following are available on your server:

Step 1 — Deploy Supabase

Self-hosted Supabase runs as a Docker Compose stack.
1

Clone the Supabase Docker setup

2

Configure the .env file

Open .env and set the following. Generate secure random values for secrets — do not reuse the example values.
ANON_KEY and SERVICE_ROLE_KEY must be valid JWTs signed with your JWT_SECRET, not raw random strings. Use the Supabase self-hosting JWT generator at supabase.com/docs/guides/self-hosting#api-keys to generate them correctly.
Also configure your SMTP credentials in .env:
Set the site URL (your dashboard domain):
3

Start Supabase

Supabase exposes several ports. The ones you need:Access Studio at http://your-server-ip:3000 to verify Supabase is running before continuing.
4

Set your public Supabase URL

Your SUPABASE_URL for all subsequent steps is https://your-server-ip:8000 or, if you put a reverse proxy in front, https://supabase.yourcompany.com. Make a note of it — you’ll need it in every step below.

Step 2 — Run Database Migrations

Forager’s schema is managed as ordered SQL migrations. Apply them using the Supabase CLI against your self-hosted instance.
1

Get the Forager migration bundle

Contact Harbingers to receive the migration bundle. It contains all SQL files in supabase/migrations/, numbered chronologically. Do not skip or reorder them.
2

Link the CLI to your instance

Or apply migrations manually in order using psql:
Apply all 29 migrations in filename order. Each migration is idempotent-safe when applied once, but do not apply any file more than once.
3

Verify the schema

In Supabase Studio → Table Editor, confirm these tables exist: companies, profiles, location_nodes, assets, anchor_snapshots, attestations, webhooks, sprints, site_memberships.

Step 3 — Deploy Edge Functions

Forager uses five Edge Functions (Deno). Deploy them using the Supabase CLI.
1

Deploy all functions

From the root of the Forager source bundle:
For self-hosted, replace --project-ref with your self-hosted API URL:
2

Set function secrets

Each function reads secrets from the Supabase Edge Function secrets store. Set them all at once:
SUPABASE_SERVICE_ROLE_KEY bypasses all Row Level Security. Keep it out of any client-side code or logs.

Step 4 — Configure Supabase Auth

1

Enable email auth

In Supabase Studio → Authentication → Providers, enable Email and disable Confirm email (Forager uses invite-based flow — users accept via link, not confirmation code).
2

Set redirect URLs

In Authentication → URL Configuration:
  • Site URL: https://forager.yourcompany.com
  • Additional redirect URLs: https://forager.yourcompany.com/**
This ensures invite links and password reset links redirect to your dashboard.
3

Configure invite email template (optional)

In Authentication → Email Templates → Invite User, you can customise the subject and body. The default Supabase template works, but removing Supabase branding is recommended for enterprise deployments.

Step 5 — Configure Storage

The floor plan images uploaded by admins are stored in a Supabase Storage bucket.
1

Verify the bucket exists

The migration 20260506000004_floor_plans_bucket.sql creates the floor-plans bucket and its RLS policies automatically. In Studio → Storage, confirm the bucket exists and is set to private (not public).
2

Verify storage policies

The migration 20260511000001_floor_plans_update_delete_policies.sql adds update and delete policies. If you see permission errors when admins upload floor plans, re-apply these two migration files.

Step 6 — Deploy the Web Dashboard

The web dashboard is a Next.js application.
1

Get the dashboard source

Request the forager-web source bundle from Harbingers.
2

Install dependencies

3

Create the .env.local file

4

Build and start

For production use, run behind a process manager:
5

Set up a reverse proxy

Point your domain (forager.yourcompany.com) at the Next.js process using nginx or Caddy. Example nginx config:

Step 7 — Get Your Custom Android APK

The Android app has your Supabase URL and anon key compiled into the binary. You cannot use the standard APK from the Harbingers downloads page. Harbingers builds a signed APK for your deployment using an automated pipeline — no manual compilation step is required on your end.
1

Contact Harbingers to trigger your build

Email support@harbinge.rs with:
  • Your SUPABASE_URL
  • Your SUPABASE_ANON_KEY
  • Your organisation name or a short identifier (used as the customer_id in your build)
  • Your desired license expiry date in YYYY-MM-DD format
The license expiry date determines how long your APK will function. After the expiry date, the app displays a full-screen lock screen and blocks all access until a new APK is installed. Choose a date aligned with your contract term — typically one year from deployment.
2

Receive and install your download link

Harbingers will trigger the build pipeline and email you a 24-hour signed download link once the APK is ready (typically within a few hours). The APK filename will be in the format forager-<customer-id>-v<version>.apk.Download the APK before the link expires. If the link expires, contact support — a new link can be generated from the same build at any time.
3

Distribute the APK

Distribute the APK to your field techs via:
  • Your MDM solution (recommended for fleet management)
  • An internal file share or intranet download page
  • Direct side-load using adb install forager-<customer-id>-v<version>.apk
Installation instructions are the same as the standard APK — see the Downloads page for sideload instructions.

License expiry

Each self-hosted APK is built with a hard-coded expiry date. When the app launches after the expiry date:
  • A full-screen lock screen appears with the expiry date and instructions to contact support
  • All navigation is blocked — the back button does not dismiss the screen
  • The lock applies on every launch, even if the device is offline
The app also notifies field techs proactively: a push notification appears 7 days before expiry and again each day after expiry until the APK is replaced. Before your license expires: Contact support@harbinge.rs to arrange a new APK build. Harbingers will provide a new signed APK with an updated expiry date. Distribute it the same way as your initial deployment — installing the update over the existing APK via MDM or sideload is sufficient.
There is no grace period on the expiry date. The lock screen activates the day after expiry. Request your renewal APK at least one week before expiry to allow time for distribution.

Step 8 — First Login and Provisioning

1

Log in as super admin

Go to https://forager.yourcompany.com/admin. Sign in with the email address you set as SUPER_ADMIN_EMAIL. This automatically provisions your internal admin company and grants you admin access in the app.
2

Create your first company

Use Add Company to create your organisation and invite the first admin user. This is identical to the provisioning flow described in Provisioning a New Company.
3

Accept the invite and sign in to the app

The invited admin checks their email, accepts the invite, and signs in to the Forager app using the custom APK. From there, setup follows the Pilot Onboarding Guide.

Ongoing Operations

Backups

Back up the Postgres database regularly. The Supabase Docker stack stores data in a named volume (supabase_db_data). A simple pg_dump approach:
Automate this with cron and ship the dump to offsite storage (S3, Backblaze B2, etc.).

Applying schema updates

When Harbingers releases a schema update, you will receive new migration SQL files. Apply them in order:
Never skip migrations — each builds on the previous one.

Updating the web dashboard

Updating the Android APK

Send Harbingers the same credentials as Step 7 — your Supabase URL and anon key do not change between updates. A new signed APK will be returned and can be redistributed via your existing channel.

Troubleshooting