Skip to content
AgentSDR
Live demo

Self-hosted CRM

A self-hosted CRM you run yourself

A self-hosted CRM runs on a server you control, with your data in your own database. AgentSDR is an open-source AI CRM for outbound that needs one app and one PostgreSQL database, started with Docker Compose.

The basics

What does a self-hosted CRM mean in practice?

A hosted CRM is software a vendor runs for you. A self-hosted CRM is software you run. The difference shows up in four places: where the application runs, where the data sits, who decides when it upgrades, and who answers when it is down.

For AgentSDR there is no shared cloud behind the product. Every service it uses is connected with your own accounts, and the AI runs on your own OpenRouter key. If you are still choosing between vendor-run and self-run, open-source vs SaaS CRM sets the two side by side. For the product itself, start at open-source CRM.

Ownership

What do you own when you self-host AgentSDR?

Where each part of AgentSDR runs and who holds it
PartWhere it livesHeld by
The applicationYour server, in a container or from sourceYou
Leads, conversations and settingsYour PostgreSQL databaseYou
AI requestsOpenRouter, on your organization's own key, pinned to the provider you pickYou
Email mailboxesYour Google Workspace, through a service account you createYou
LinkedIn and WhatsApp accountsYour Unipile accountYou
Call recordingsYour Cloudflare R2 bucket, reached only by short-lived linksYou
Saved integration credentialsEncrypted in your database with AES-256-GCMYou hold the key

Self-hosting moves the application and the stored data to you. The services you connect still process what passes through them: Google delivers your email, Unipile reaches LinkedIn and WhatsApp, and OpenRouter’s providers read the text sent for AI steps. Each runs under an account you own and can close.

Requirements

What do you need to run it?

From the repository's self-hosting guide.

Requirements for self-hosting AgentSDR
NeedDetailWhen
PostgreSQL 16 or newerSetup refuses older servers. The schema is tested on 16, 17 and 18.Always
Docker with Compose, or Bun 1.2+Compose is the recommended path. Node.js 20.9+ also runs it from source.Always
A public HTTPS originWebhooks from Unipile and Gmail push, and links in email, need to reach you.For a public server
A Resend accountSends sign-up verification, password reset and invitation email. Without it those emails are written to the app log.To invite people
Google WorkspaceSends and reads Gmail through a service account.For email outreach
UnipileLinks LinkedIn and WhatsApp accounts.For LinkedIn and WhatsApp
OpenRouterRuns every AI feature on your key.For AI drafts and classification

Get running

How do you start it?

The Docker Compose path is a file, a few secrets and one command. The app creates the schema on an empty database and runs its scheduled jobs itself.

# download the compose file$ mkdir agentsdr && cd agentsdr$ curl -O https://raw.githubusercontent.com/Kandid-ai/AgentSDR/main/docker-compose.yml# write your secrets (the Docker guide has the one-line version)$ openssl rand -hex 32# start the database and the app$ docker compose up -d

Open the address you set as APP_URL and the first page creates your admin account and organization. Connect your services from Settings after that. The complete steps are in Docker Compose, and the same walkthrough with the reasons behind each step is how to self-host a CRM.

Options

Which install path should you pick?

Three ways to install AgentSDR
PathBest for
Docker ComposeMost people. One file, your secrets, one command, with the database included.
From sourceDevelopment, or a host where you manage Bun or Node.js and PostgreSQL yourself.
Dokploy on a VPSA self-hosted platform that adds domains, HTTPS and deploy-on-push.

The trade

What do you take on by self-hosting a CRM?

The tradeoffs are real and they are the same for any self-hosted software.

  1. 01

    Backups

    Back up the PostgreSQL database and, separately, INTEGRATION_CREDENTIALS_KEY. A database restored without that key cannot decrypt saved integrations, and each one has to be reconnected. Back up the R2 bucket too.
  2. 02

    Upgrades

    The app creates a schema only in an empty database. On an existing install you run the new migration scripts that the release notes name, then restart.
  3. 03

    Uptime and security

    You run the server, the HTTPS proxy and the updates. Choose who may sign up with AUTH_SIGNUP: invite-only is the default.
  4. 04

    One instance

    The email sender has no distributed lock, so you do not scale the app out. Grow by adding mailboxes and accounts.

There is also an emergency brake: PAUSE switches such as PAUSE_EMAIL_OUTBOUND stop sending without touching data. If you would rather not run servers at all, a vendor-run CRM is the better fit, and that comparison says when.

Before real use

What should you set before going to production?

Production checklist for a self-hosted AgentSDR
ItemWhy
A domain and HTTPSWebhooks and email links need a public address. Set APP_URL to it. With any address other than localhost the app refuses to start until each CHANGEME secret is replaced.
AUTH_SIGNUPinvite-only (default) or open. Open lets anyone who reaches the instance create an account.
ResendRESEND_API_KEY and AUTH_EMAIL_FROM, so invitations and password resets are sent.
Backupspg_dump on a schedule, the credentials key stored outside the database, and the R2 bucket.
DB_POOL_MAXDefault 8. Keep it under the server's connection limit, counting every client of that server.
Time zoneEach organization's time zone sets when its day rolls over for send limits.

FAQ

Questions, answered

What is a self-hosted CRM?

A CRM you run on a server you control, with its data in a database you control, instead of a vendor's cloud. You install it, update it and back it up yourself. AgentSDR is one app and one PostgreSQL database.

What is the difference between a hosted CRM and a self-hosted CRM?

With a hosted CRM the vendor runs the software and stores your data. With a self-hosted CRM you run it. Hosting yourself gives you control over where the data lives and when you upgrade, and it makes you responsible for uptime, backups and security.

What do I need to self-host AgentSDR?

PostgreSQL 16 or newer, and either Docker with Compose or Bun 1.2+ to run from source. For a public server you also need a domain, an HTTPS reverse proxy and, to invite people or send password resets, a Resend account. The Compose file starts PostgreSQL 18 and the app for you.

What does self-hosting cost?

There is no licence fee, no seat price and no per-contact price. You pay for the server, the accounts you connect (Google Workspace for mailboxes, Unipile for LinkedIn and WhatsApp, Cloudflare R2 for recordings) and the AI usage on your own OpenRouter key.

Can I use my own PostgreSQL server?

Yes. The Docker Compose guide describes pointing the app at your own database instead of the bundled one, and the app can also run from source against any PostgreSQL 16+ server. Keep DB_POOL_MAX under the server's connection limit, because the pool is shared by every client.

Can I run more than one instance for availability?

No. AgentSDR is designed to run as a single instance, because the outreach sender loop has no distributed lock and two instances would each send. Plan for a restart policy and backups instead of replicas.

Your CRM, on your server

Download one file, set your secrets and run one command. The data stays in your database.