EspoCRM
Open source CRM application
Alternative to: salesforce, hubspot, zoho crm, pipedrive
EspoCRM is a free, open-source CRM platform for managing leads, contacts, sales opportunities, marketing campaigns, and support cases in a single-page application with a PHP REST API backend. It gives sales and support teams a self-hosted, customizable alternative to commercial CRM suites, with role-based access control, workflow automation, and an extension marketplace.
EspoCRM Docker Compose example
Self-host EspoCRM on your own server, homelab, or VPS starting from this Docker Compose example.
It runs EspoCRM in Docker containers using the official mariadb:latest, espocrm/espocrm:latest, espocrm/espocrm:latest images, with persistent volumes and automatic restarts preconfigured.
Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.
services:
espocrm-db:
image: mariadb:latest
environment:
# Root password for the bundled MariaDB instance (internal to the compose network).
MARIADB_ROOT_PASSWORD: "espocrm_root_password"
# Name of the database EspoCRM uses.
MARIADB_DATABASE: "espocrm"
# Application database user.
MARIADB_USER: "espocrm"
# Password for the application database user (internal to the compose network).
MARIADB_PASSWORD: "espocrm_database_password"
volumes:
- db:/var/lib/mysql
restart: unless-stopped
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 20s
start_period: 10s
timeout: 10s
retries: 3
espocrm:
image: espocrm/espocrm:latest
depends_on:
espocrm-db:
condition: service_healthy
environment:
# Hostname of the database service.
ESPOCRM_DATABASE_HOST: "espocrm-db"
# Database user EspoCRM connects as.
ESPOCRM_DATABASE_USER: "espocrm"
# Password for the database user (matches the MariaDB service above).
ESPOCRM_DATABASE_PASSWORD: "espocrm_database_password"
# Username of the initial administrator account.
ESPOCRM_ADMIN_USERNAME: "admin"
# Password of the initial administrator account.
ESPOCRM_ADMIN_PASSWORD: "changeme"
# Public URL the instance is served from.
ESPOCRM_SITE_URL: "http://localhost"
volumes:
- data:/var/www/html/data
- custom:/var/www/html/custom
- custom_client:/var/www/html/client/custom
restart: unless-stopped
healthcheck:
test: ["CMD", "bin/command", "app-check"]
start_period: 20s
interval: 60s
timeout: 20s
retries: 3
espocrm-daemon:
image: espocrm/espocrm:latest
volumes_from:
- espocrm
entrypoint: docker-daemon.sh
depends_on:
espocrm:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "bin/command", "app-check"]
start_period: 20s
interval: 180s
timeout: 20s
retries: 3
volumes:
db:
data:
custom:
custom_client:
Values set to changeme are required — replace them with your own
values before starting EspoCRM.
Prefer a managed setup? WinterFlow installs, configures, and updates EspoCRM for you using this same Docker Compose configuration.