Skip to content
Alim Docs
Self-host the server
On this page

Self-host the server

Run Alim on your own server with Docker or OpenShip. Back up /pb/pb_data, which holds your workspace data.

PathBest forGo to
Local binaryDevelopment on Linux or macOSRun locally
DockerAny server with DockerRun with Docker
Docker ComposeDocker plus the private email redactorPrivate email redaction
OpenShipA managed deploy with domains and secretsDeploy with OpenShip

Environment variables#

Put these in a .env file at the repo root or in your deploy secrets. Run chmod 600 .env and never commit it. .env.required lists the required, provider and mail keys. Provider keys are under Providers and everything else under Optional settings.

VariableValue
PUBLIC_URLPublic origin without a trailing slash, like https://alim.example.com. Used for OAuth, pairing, MCP and docs links
OPENSCRIBE_ADMIN_EMAILComma-separated admin emails. Admins can sign in and change AI providers, models and agents. Empty means no admin
PB_ADMIN_PASSWORDPocketBase superuser password, 10 or more characters
PB_ENCRYPTION_KEYExactly 32 characters. Encrypts PocketBase settings
ALIM_TOKEN_ENCRYPTION_KEY32 bytes as 64 hex characters or base64. Encrypts stored provider tokens. Any other value is hashed into a key, not rejected

Generate both keys for a new installation:

bash
openssl rand -hex 16   # PB_ENCRYPTION_KEY
openssl rand -hex 32   # ALIM_TOKEN_ENCRYPTION_KEY

Run locally#

Build the web app first, because the server serves apps/web/dist. The build also renders these docs.

bash
cd apps/web && npm ci && PUBLIC_URL=http://127.0.0.1:8090 npm run build && cd ../..
cd apps/server && go build -o openscribe .
./openscribe prepare --dev=false --dir=./pb_data --encryptionEnv=PB_ENCRYPTION_KEY
./openscribe serve --dev=false --http=127.0.0.1:8090 --dir=./pb_data --encryptionEnv=PB_ENCRYPTION_KEY

prepare runs migrations, applies OAuth settings and creates the superuser.

Run with Docker#

bash
docker build -t openscribe .
docker volume create openscribe-data
docker run -d --name openscribe --restart unless-stopped \
  -p 127.0.0.1:8090:8090 --env-file .env \
  -v openscribe-data:/pb/pb_data openscribe

The container applies migrations at startup. Check the deployment when it comes up.

Deploy with OpenShip#

OpenShip reads openship.json, which builds the Dockerfile, exposes port 8090 and mounts the openscribe-data volume at /pb/pb_data. Replace its domain with yours, then:

  1. Check the config and create a project:

    bash
    openship --json config validate
    openship project create --name openscribe
    openship init --force --project your_project_id
  2. Set plain values, then secrets. Add provider keys the same way.

    bash
    openship project env set your_project_id \
      --set PUBLIC_URL=https://alim.example.com \
      --set OPENSCRIBE_ADMIN_EMAIL=you@example.com
    openship project env set your_project_id --secret \
      --set PB_ADMIN_PASSWORD="$PB_ADMIN_PASSWORD" \
      --set PB_ENCRYPTION_KEY="$PB_ENCRYPTION_KEY" \
      --set ALIM_TOKEN_ENCRYPTION_KEY="$ALIM_TOKEN_ENCRYPTION_KEY" \
      --set GOOGLE_CLIENT_ID="$GOOGLE_CLIENT_ID" \
      --set GOOGLE_CLIENT_SECRET="$GOOGLE_CLIENT_SECRET"
  3. Point DNS at your OpenShip host and attach the domain:

    bash
    openship domain add alim.example.com --project your_project_id
    openship domain verify your_domain_id
  4. Deploy and follow the build:

    bash
    openship deploy --watch

Check the deployment#

CheckCommandExpect
Server is upcurl -s https://alim.example.com/api/configJSON with the configured sign-in methods
Docs are publiccurl -sI https://alim.example.com/docs/200
Privacy is publiccurl -sI https://alim.example.com/privacy/200
Unknown docs pathcurl -sI https://alim.example.com/docs/missing404
MCP asks for authcurl -si -X POST https://alim.example.com/mcp401 with WWW-Authenticate

The config response lists which providers have keys. Signed-in accounts also see their own Drive settings.

Check live transcription#

This check sends a fixed synthetic phrase, requires recognized words with word timestamps, then closes the provider session. It creates no meeting.

  1. As a PocketBase superuser, issue a token for the dedicated record in transcription_probes.

  2. Store it as ALIM_QA_TOKEN in encrypted CI secrets or your ignored local .env, never in a browser bundle.

  3. Run the check with Node 22:

    bash
    node --env-file=.env .agents/qa/transcription.mjs

The token works only on POST /api/transcription/check. It cannot read meetings or use admin routes, and normal app sessions cannot call that endpoint.

The check covers ElevenLabs today. Any other active provider fails with an explicit unsupported-check message. It also fails on missing or expired probe authorization, rejected credentials, quota errors, absent speech, absent timestamps and unclosed sessions.

Connect the Mac app#

On the sign-in screen, click Use Another Workspace…. To switch later, go to Settings → Workspace → Change Workspace… while you’re between meetings. Enter your server address and click Connect, then sign in on the page Alim opens.

Alim sign-in screen with Use Another Workspace
Alim sign-in screen with Use Another Workspace

Use HTTPS for a remote server. Use a loopback address when running the server locally over HTTP.

Back up#

Back up the volume together with PB_ENCRYPTION_KEY and ALIM_TOKEN_ENCRYPTION_KEY.

PathContents
/pb/pb_data/data.db (with -wal, -shm)Users, calendars, meetings, transcripts, notes, people, projects, tasks, AI settings, MCP grants
/pb/pb_data/auxiliary.dbPocketBase logs
/pb/pb_data/storage/Uploaded files and screenshots

Providers#

Provider keys stay on the server. Clients never receive them.

VariableEnables
ELEVENLABS_API_KEYLive transcription with ElevenLabs Scribe v3, the default
OPENAI_API_KEYOpenAI transcription, relayed through the server, and OpenAI models
ANTHROPIC_API_KEYClaude models for Q&A and summaries
GOOGLE_API_KEYGemini transcription and Gemini models
OPENSCRIBE_LOCAL_STT_BASE_URLYour own OpenAI-compatible /v1/audio/transcriptions server, like http://127.0.0.1:8080/v1
OPENSCRIBE_LOCAL_STT_API_KEYBearer token for that server, if it needs one
OPENSCRIBE_TRANSCRIPTION_PROVIDER, OPENSCRIBE_TRANSCRIPTION_MODELDefault transcription provider and model until an admin picks one
TYPESAFE_API_KEYBetter search suggestions, and duplicate and series checks when the decisions workload uses typesafe. Spoken-reference checks send the surrounding excerpt and candidate descriptions. Local matching works without it

Admins set workspace models in AI models. For speech, use the OPENSCRIBE_TRANSCRIPTION_* variables or PUT /api/admin/transcription.

JobDefault model
TranscriptionElevenLabs scribe_v3_live
Tags, People & projectsOpenAI gpt-6-luna
Topic matching, Duplicate checksGoogle gemini-decision-1 (falls back to TypeSafe jev-1.14.0 when configured)
Questions, SummariesAnthropic claude-sonnet-5-5
TasksGoogle gemini-3.8-flash

Use your own provider key#

  1. Open AI models → Your keys and models and enter your provider key.
  2. Choose a model for the work you want billed to that key. For new recordings, choose an ElevenLabs, OpenAI or Gemini model under Speech to text.
  3. Choose Save my settings.

To remove a key, first switch its selections to Workspace default or another provider, then remove the key and save. Removing or replacing an OpenAI key closes its active personal speech connections.

Personal keys require ALIM_TOKEN_ENCRYPTION_KEY (or the configured Google client secret). A personal Google key needs paid access to Gemini 4 Argon for the billing check.

Your own speech recognition#

Both options need an endpoint that accepts multipart WAV uploads at /v1/audio/transcriptions. Word times are used when the endpoint returns them.

Where audio goesSet
Directly from the MacOn the Mac, OPENSCRIBE_TRANSCRIPTION_PROVIDER=openai_compatible, OPENSCRIBE_LOCAL_STT_URL for the loopback service and OPENSCRIBE_TRANSCRIPTION_MODEL for its model ID
Through the workspace serverOPENSCRIBE_LOCAL_STT_BASE_URL on the server

Teams browser captions always come from Microsoft.

Optional settings#

VariableDefaultEffect
PORT8090Listen port for the container and for serve without --http. Keep 8090 in Docker, because the health check probes it
PB_DATA_DIR/pb/pb_dataData directory in the container
OPENSCRIBE_WEB_DIST../web/dist, ./apps/web/dist, then ./pb_publicBuilt web app and docs to serve. Tried first when set
PB_ADMIN_EMAILFirst OPENSCRIBE_ADMIN_EMAILPocketBase superuser email at /_/
OPENSCRIBE_USER_EMAILnoneComma-separated emails that can sign in to a normal workspace without admin settings. Admins can always sign in
OPENSCRIBE_EMAIL_SIGN_INfalsetrue enables email and password sign-in for verified accounts on either allowlist
OPENSCRIBE_PII_URLnonePrivate redaction service URL
OPENSCRIBE_GMAILonoff limits new Gmail connections and sync to reviewers
OPENSCRIBE_GMAIL_REVIEWERSemptyComma-separated verified Alim emails that may use Gmail while it is off
OPENSCRIBE_DRIVE_SEARCHoffon offers Drive search (drive.readonly) to every user
OPENSCRIBE_DRIVE_REVIEWERSemptyComma-separated verified Alim emails that may search Drive while it is off
OPENSCRIBE_TELEMETRYonoff stops anonymous usage events. debug validates them without recording. See privacy
OPENSCRIBE_TRUSTED_PROXY_HEADERSnoneHeader holding the visitor IP behind a reverse proxy, like X-Forwarded-For. Leave it unset without a proxy, or clients can spoof their address
SMTP_URLnoneOutgoing mail server
MAIL_FROMnoreply@akyonlabs.comSender address

OAuth client variables are listed with their callbacks in Set up connectors.

Set up connectors#

Register each callback as PUBLIC_URL plus the path below, store the credentials in .env or deploy secrets, and restart Alim. Each guide is in Connectors.

ConnectorCredentialsCallback path
Google sign-in, Calendar, Meet links, Gmail and DriveGOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET. The Drive Picker also needs GOOGLE_PICKER_API_KEY and GOOGLE_CLOUD_PROJECT_NUMBER/api/oauth2-redirect for sign-in, /api/oauth/google/callback for the rest
Microsoft sign-in, Outlook Calendar and MailMICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET/api/oauth2-redirect for sign-in, /api/oauth/microsoft/callback for the rest
GitHub sign-inGITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET from a GitHub OAuth App/api/oauth2-redirect
Apple sign-inAPPLE_CLIENT_ID (a Services ID) with APPLE_CLIENT_SECRET, or APPLE_TEAM_ID, APPLE_KEY_ID and APPLE_PRIVATE_KEY to sign ES256 secrets/api/oauth2-redirect
ChatGPT sign-inCHATGPT_CLIENT_ID, CHATGPT_CLIENT_SECRET, or OPENAI_OAUTH_CLIENT_ID, OPENAI_OAUTH_CLIENT_SECRET/api/oauth2-redirect
Zoom links and calendarZOOM_CLIENT_ID, ZOOM_CLIENT_SECRET from a user-managed General app/api/oauth/zoom/callback
Tactiq and tldv importsChrome extension or tldv API keynone

Sign in without Google#

Email sign-in uses the instance's own PocketBase accounts and needs no Google OAuth or SMTP.

  1. Set OPENSCRIBE_EMAIL_SIGN_IN=true and put the account email in OPENSCRIBE_USER_EMAIL or OPENSCRIBE_ADMIN_EMAIL. Restart Alim.
  2. In the PocketBase dashboard at /_/, create or edit the account in the users collection. Set its password and mark the email Verified after confirming who owns it.
  3. Connect the Mac app and sign in with that email and password.

Private email redaction#

Gmail and Outlook project matching is optional and needs OPENSCRIBE_PII_URL, the full URL of a private CPU redaction service such as http://pii:8092/redact. The same service redacts linked Drive and uploaded entity file text, up to 32,000 characters, and fails closed.

Tactiq import screening and the on-demand quality tool require a configured Decisions provider (Google for the default Gemini agent) and the caption_v1 profile from the matching services/pii release. Rebuild the private image when upgrading it. A server running an older redactor declines the assessment before sending that batch to Decisions.

Run it beside the app with the optional compose.yaml. Create the root .env first.

sh
docker compose up --build -d
  • The app listens on 127.0.0.1:8091. Put your HTTPS reverse proxy in front and set PUBLIC_URL to its public origin.
  • The redactor has no published port and uses an internal Docker network. Its model downloads during the image build and serves offline.

For an existing single-container OpenShip install:

  1. Build services/pii/Dockerfile with services/pii as its build context.
  2. Run it on the app's private Docker network with the alias pii, without a published port or access to the PocketBase volume.
  3. Set OPENSCRIBE_PII_URL=http://pii:8092/redact on the app.
  4. From the app container, GET http://pii:8092/health returns {"ready": true} once the model loads.
TopicBehavior
Modelfastino/gliner2-privacy-filter-PII-multi, pinned by the service build. Its published training languages do not include Turkish
ResourcesAt least 4 GiB RAM. Start with two CPU threads (PII_THREADS=2)
MaskedFinancial details such as bank accounts, IBANs, Luhn-valid payment cards, tax IDs and salary or compensation lines, plus credentials, secrets and government IDs
KeptPerson names and normal discussion, for project matching and focused task and deadline resolution (task_resolution)
LimitsDetection can miss sensitive details and does not guarantee complete removal
When downProject classification and redacted-email task resolution wait. Original email text is never sent to a model provider instead
NetworkKeep the endpoint on a trusted private network, because requests contain unredacted text

Mailbox sync and local person matching need no AI provider or webhook. Each process sends one redaction request at a time, so /health can still answer. On restart, project matching resumes from saved checkpoints. See sync and classification retries.

Connect AI clients over MCP#

The OAuth 2.1 protected endpoint is /mcp, with discovery at /.well-known/oauth-protected-resource/mcp and /.well-known/oauth-authorization-server and OAuth routes under /oauth/*. See Connect AI clients over MCP for client setup and API reference for the contracts.

Maintenance commands#

Run these as the user that owns the data directory.

Repair confirmed duplicate captures#

Combine older captures only after you verify that they belong to one calendar occurrence. Back up the volume first.

sh
openscribe repair-capture-meetings --file /tmp/repair.json --migration-name 20261116_confirmed_capture_repair --dir /pb/pb_data

The input names one owner, the meeting to keep, the source meetings and the verified occurrence:

json
{
    "owner_id": "OWNER_ID",
    "canonical_id": "MEETING_TO_KEEP",
    "source_ids": ["SOURCE_MEETING_ID"],
    "occurrence": {
        "account_id": "CALENDAR_ACCOUNT_ID",
        "calendar_id": "primary",
        "event_id": "OCCURRENCE_EVENT_ID",
        "recurring_event_id": "SERIES_EVENT_ID"
    }
}
  • The command records an application migration named after the input digest, so repeating an input adds nothing.
  • Old links resolve to the combined meeting.
  • It rejects active captures and queued or running extraction jobs.
  • It never discovers or guesses which meetings belong together.

Resolve tasks#

The read-only task_resolution agent checks open tasks against strictly later ended meetings and OPENSCRIBE_PII_URL-redacted email threads. It runs anthropic claude-haiku-5-5 by default with the list_later_timeline, search_evidence_passages, read_transcript_window and read_email_thread tools. Trigger a sweep by hand:

sh
openscribe resolve-tasks --owner OWNER_ID --scope all --limit 500 --workers 4 --dir /pb/pb_data

Mind pipeline storage#

Startup migrations add everything Mind needs to the existing volume and backups. There is no new environment variable, service or training job.

  • Agents: the entity_resolution, knowledge_compaction, task_resolution, topic_matching, and email_classification built-ins are seeded on existing installs. The local meeting_source_matching agent runs meeting_source_match@v1 before extraction, records the version and rule on the source and any review suggestion, and resumes pending work after a restart. An unmodified extraction contract gets the default pipeline. Edited contracts stay intact.
  • Fields: pipeline JSON on ai_agents, resolution watermark and lease fields on knowledge_tasks and knowledge_details, link/exclusion lists on meetings and email_threads, and agent_trace on suggestions, details, tasks and entity revisions.
  • Tools: versioned as @v1. Matching uses entity_rule_match, shortlist_candidates, hybrid_rrf_shortlist, decide_predicates, source_link_entity, and source_unlink_entity. Compaction uses detail_supersede, task_consolidate and entity_merge. Observability uses rollouts_stats and trajectories_export. The registry enforces enabled tools and read-only access, and admin pipeline edits appear as immutable Markdown diffs.
  • Defaults: entity resolution shortlists five candidates, proposes at 0.5 and matches at 0.85. topic_matching and email_classification use hybrid_rrf_shortlist (Top-15) and google/gemini-decision-1 with automatic workspace fallback to typesafe/jev-1.14.0.
  • Collections: workspace_ontologies holds each owner's persona and overrides. ai_rollouts and training_trajectories hold scrubbed AI calls, explicit feedback, implicit edit/link trajectories, outputs, rewards and traces. Clients cannot change any of them directly.
View as Markdown