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?
| Part | Where it lives | Held by |
|---|---|---|
| The application | Your server, in a container or from source | You |
| Leads, conversations and settings | Your PostgreSQL database | You |
| AI requests | OpenRouter, on your organization's own key, pinned to the provider you pick | You |
| Email mailboxes | Your Google Workspace, through a service account you create | You |
| LinkedIn and WhatsApp accounts | Your Unipile account | You |
| Call recordings | Your Cloudflare R2 bucket, reached only by short-lived links | You |
| Saved integration credentials | Encrypted in your database with AES-256-GCM | You 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.
| Need | Detail | When |
|---|---|---|
| PostgreSQL 16 or newer | Setup 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 origin | Webhooks from Unipile and Gmail push, and links in email, need to reach you. | For a public server |
| A Resend account | Sends sign-up verification, password reset and invitation email. Without it those emails are written to the app log. | To invite people |
| Google Workspace | Sends and reads Gmail through a service account. | For email outreach |
| Unipile | Links LinkedIn and WhatsApp accounts. | For LinkedIn and WhatsApp |
| OpenRouter | Runs 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 -dOpen 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?
| Path | Best for |
|---|---|
| Docker Compose | Most people. One file, your secrets, one command, with the database included. |
| From source | Development, or a host where you manage Bun or Node.js and PostgreSQL yourself. |
| Dokploy on a VPS | A 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.
- 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. - 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. - 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. - 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?
| Item | Why |
|---|---|
| A domain and HTTPS | Webhooks 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_SIGNUP | invite-only (default) or open. Open lets anyone who reaches the instance create an account. |
| Resend | RESEND_API_KEY and AUTH_EMAIL_FROM, so invitations and password resets are sent. |
| Backups | pg_dump on a schedule, the credentials key stored outside the database, and the R2 bucket. |
| DB_POOL_MAX | Default 8. Keep it under the server's connection limit, counting every client of that server. |
| Time zone | Each 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.
Keep exploring
- Open-source CRMAn MIT-licensed AI CRM for outbound, on your own server
- Self-host a CRMFrom a server to a running CRM in an afternoon
- Open-source vs SaaS CRMCost, control and effort, side by side
- Open source & self-hostedMIT-licensed code on your server, with your own AI key
- Open-source sales engagementEmail, LinkedIn and WhatsApp sequences you host yourself
- Best open-source CRMsSeven open-source CRMs compared for sales teams
- Salesforce alternativeAn open-source CRM for outbound teams
- HubSpot alternativeOpen-source CRM and outreach without per-seat tiers
- Twenty alternativeOpen-source CRM with the outreach built in
- SuiteCRM alternativeA modern open-source CRM for outbound
- EspoCRM alternativeOpen-source CRM plus email, LinkedIn and WhatsApp
- Odoo CRM alternativeA focused open-source CRM for outbound sales
Your CRM, on your server
Download one file, set your secrets and run one command. The data stays in your database.