Skip to main content

Overview

This guide covers the deployment and configuration of EspoCRM using Docker Compose behind Traefik reverse proxy. EspoCRM serves as Mondo’s customer relationship management solution, accessible at crm.trymondo.com.

Architecture

EspoCRM is deployed as a multi-container application with the following components:
  • MariaDB: Database server storing EspoCRM data
  • EspoCRM: Main application container
  • EspoCRM Daemon: Background process container
  • EspoCRM WebSocket: Real-time communications container
All services use the external traefik-net network for routing through Traefik.

Prerequisites

  • Docker Engine (24.0+)
  • Docker Compose v2
  • Traefik reverse proxy configured and running
  • External traefik-net network
  • DNS configured for crm.trymondo.com

Deployment

Directory Structure

Environment Variables

Create a .env file with the following variables:
Never commit the .env file to version control. Store passwords securely in your password manager.

Docker Compose Configuration

The deployment uses a shared image reference and multiple service definitions:

Deployment Commands

Deploy the stack with:
Verify all components are running:

Configuration Highlights

Traefik Integration

EspoCRM is configured with the following Traefik routing:
  • Main application at crm.trymondo.com
  • WebSocket endpoint at crm.trymondo.com/ws
  • TLS certificate managed by Traefik’s production resolver
  • Security headers applied through Traefik middleware

WebSocket Configuration

Real-time communication is enabled through ZeroMQ and WebSockets:
  • WebSocket URL: wss://crm.trymondo.com/ws
  • Internal ZeroMQ communication between containers
  • Separate Traefik router rule for WebSocket traffic

Volume Management

The deployment uses Docker named volumes:
  • mariadb-data: Persistent storage for the database
  • html-data: Shared volume for EspoCRM application data across all containers

Maintenance

Backup Strategy

EspoCRM data should be backed up regularly using Restic/Backrest:

Updates

To update EspoCRM:
  1. Update the image version tag in docker-compose.yml
  2. Pull the new image:
  3. Deploy the updated stack:
  4. Check logs for any migration issues:

Troubleshooting

Database Connection Issues

If EspoCRM can’t connect to the database:
  1. Check MariaDB container status:
  2. Verify network connectivity:
  3. Check database credentials:

WebSocket Issues

If real-time updates aren’t working:
  1. Check WebSocket container is running:
  2. Verify WebSocket URL configuration matches the Traefik route.
  3. Test WebSocket connectivity from browser developer tools.

Traefik Routing Problems

If the site is unreachable:
  1. Check Traefik logs:
  2. Verify DNS resolution for crm.trymondo.com
  3. Confirm Traefik network is correctly attached to all containers.

Resources

Next Steps

  • Set up monitoring and alerting for EspoCRM services with Prometheus/Grafana
  • Implement automated backups of volumes and database dumps
  • Configure SMTP for email notifications
  • Explore EspoCRM API integrations with other Mondo services