# Self-host Monica

> A personal CRM that remembers the people in your life, with notes, reminders, activities and relationships.

- Page: https://levelrail.com/templates/monica/
- JSON: https://levelrail.com/templates/monica.json
- Category: Productivity
- Licence: AGPL-3.0-or-later (Network copyleft (AGPL) license)
- Source: https://github.com/monicahq/monica
- Upstream docs: https://github.com/monicahq/monica/blob/main/docs/installation/docker.md

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 11.8

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| mariadb | mariadb | 11.8 | none | mariadb -> /var/lib/mysql |
| monica | monica | 4.1.2-apache | 80 | storage -> /var/www/html/storage |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| mariadb | MYSQL_DATABASE | preset |
| mariadb | MYSQL_PASSWORD | generated |
| mariadb | MYSQL_ROOT_PASSWORD | generated |
| mariadb | MYSQL_USER | preset |
| monica | APP_ENV | preset |
| monica | APP_KEY | generated |
| monica | APP_URL | preset |
| monica | DB_CONNECTION | preset |
| monica | DB_DATABASE | preset |
| monica | DB_HOST | preset |
| monica | DB_PASSWORD | generated |
| monica | DB_PORT | preset |
| monica | DB_USERNAME | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install monica --name my-monica
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain mariadb=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/monica/install \
  -d '{
    "name": "my-monica"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## Questions

### Can I deploy Monica on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Monica, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image mariadb:11.8, monica:4.1.2-apache is what you deploy there.

Self-host Monica, Monica docker compose file, deploy Monica on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
