Quick Start
Get MediaMagic CRM running locally in under 5 minutes.
1. Clone the Repository
bash
git clone https://github.com/AmericanMedia/crm.git
cd crm2. Configure Environment
bash
cp .env.example .envEdit .env with your credentials:
bash
# Required for basic functionality
MYSQL_ROOT_PASSWORD=your_secure_password
MYSQL_PASSWORD=your_mysql_password
ESPOCRM_ADMIN_PASSWORD=your_admin_password
POSTGRES_PASSWORD=your_postgres_password
GRAFANA_ADMIN_PASSWORD=your_grafana_passwordbash
# MySQL (EspoCRM database)
MYSQL_ROOT_PASSWORD=your_root_password
MYSQL_PASSWORD=your_mysql_password
# EspoCRM
ESPOCRM_ADMIN_USER=admin
ESPOCRM_ADMIN_PASSWORD=your_admin_password
ESPOCRM_SITE_URL=http://localhost:8080
ESPOCRM_API_KEY=your_api_key_after_setup
# PostgreSQL (Analytics)
POSTGRES_PASSWORD=your_postgres_password
# Grafana
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=your_grafana_password
# Ayrshare
AYRSHARE_API_KEY=your_ayrshare_api_key
# X Server
X_SERVER_URL=http://your-x-server:3001
# n8n
N8N_WEBHOOK_BASE=https://your-n8n-instance.com3. Start Services
bash
docker compose up -dThis starts all services:
4. Wait for Initialization
First run takes 2-3 minutes for EspoCRM to initialize:
bash
docker compose logs -f espocrmLook for: EspoCRM is ready
5. Set Up Custom Entities
bash
cd espocrm/custom
npm install
ESPOCRM_URL=http://localhost:8080 \
ESPOCRM_ADMIN_USER=admin \
ESPOCRM_ADMIN_PASSWORD=your_password \
node setup-entities.js6. Configure Navigation
- Open http://localhost:8080
- Log in with your admin credentials
- Go to Admin → User Interface → Tab List
- Add custom entities to the navigation
- Save
7. Create API User
- Go to Admin → API Users
- Create a new API user with admin role
- Copy the API key
- Add to your
.envasESPOCRM_API_KEY - Restart the bridge:
bash
docker compose restart bridge8. Verify Everything Works
bash
curl http://localhost:3100/healthjson
{
"ok": true,
"service": "mediamagic-bridge",
"timestamp": "2026-02-05T12:00:00.000Z"
}🎉 You're Ready!
Access your services:
| Service | URL | Credentials |
|---|---|---|
| EspoCRM | localhost:8080 | Admin user from .env |
| Grafana | localhost:3200 | admin / password from .env |
| Bridge API | localhost:3100 | — |
Next Steps
Troubleshooting
EspoCRM not starting?
Check MySQL is healthy:
bash
docker compose logs espocrm-mysqlEnsure MySQL is ready before EspoCRM starts.
Need to start fresh?
bash
# Stop everything
docker compose down
# Remove volumes (⚠️ deletes all data)
docker volume rm crm_mysql-data crm_espocrm-data crm_grafana-data crm_postgres-data
# Start fresh
docker compose up -dWebhooks not working?
- Verify webhook URLs in Admin → Webhooks
- Check Bridge logs:
docker compose logs bridge - Ensure Bridge container can reach EspoCRM