---
title: "Deploy Monica"
description: "Personal Relationship Manager. Remember birthdays, notes and promises"
category: "Other"
url: https://railway.com/deploy/monica-railway
---

# Deploy Monica

Personal Relationship Manager. Remember birthdays, notes and promises

**[Deploy Monica on Railway](https://railway.com/template/monica-railway)**

- **Creator:** A3A
- **Category:** Other

## Template content

### monica https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/monica.svg

- **Source:** https://github.com/gridalpha/monica-railway
- **Health check:** /
- **Public domain:** Yes

### mailpit https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mailpit.svg

- **Image:** axllent/mailpit:latest
- **Health check:** /livez
- **Public domain:** Yes

### monica-queue https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/monica.svg

- **Source:** https://github.com/gridalpha/monica-railway

### Redis https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/redis.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### monica-cron https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/monica.svg

- **Source:** https://github.com/gridalpha/monica-railway

### MySQL https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mysql.svg

- **Image:** mysql:9.4
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G`

## Buckets

- **monica-storage**

## Documentation

# Deploy and Host Monica on Railway

Monica is an open-source personal relationship manager — a CRM for your private life rather than your sales pipeline. Instead of deals it tracks people: how you met someone, what their kids are called, what you last talked about, and when you promised to check in again. Because it is AGPL-licensed and keeps everything in your own MySQL database, self-hosting Monica means your notes about your family never leave infrastructure you control.

This template runs Monica in the shape its maintainers document for production rather than the single-container demo. The **Monica** web service (Apache with mod_php) serves the interface, a **scheduler** runs Monica's minute-by-minute task schedule, a **queue worker** drains background jobs such as reminder mail and account exports, **MySQL** holds every contact and note, **Redis** carries cache, sessions and the job queue, a **storage bucket** keeps avatars, photos and documents, and **Mailpit** captures the reminder emails Monica sends so the feature works the moment the deploy finishes. The web service is the only one with a public address; everything else talks over the private network.

![Monica Railway architecture](https://res.cloudinary.com/rroe4rtk/image/upload/v1787076432/bc16ba53-427e-472e-bfac-a8632c224599.png)

## Getting Started with Monica on Railway

When the deploy goes green, open the public URL and you will land on a sign-in page rather than a registration form — public signup is off from the first request, because an open personal CRM on the internet is not something to discover later. The first account is created for you while the database is still empty, from `MONICA_ADMIN_EMAIL` and `MONICA_ADMIN_PASSWORD` in the Monica service's Variables tab; open that tab to read the generated password if you did not set your own. Sign in, then visit Settings to change the password and set your timezone, since reminders are sent in your account's timezone. Add your first person with **Add someone** and give them something worth remembering: a birthday, a note about where you met, and a reminder such as "ask how the house move went" set to repeat monthly. The dashboard is where the deployment proves itself — your reminder appears under the month it falls in, and the contact shows the note you wrote. Upload a photo to confirm object storage is wired up, and open Mailpit's own URL (credentials are in its Variables tab) to watch the mail Monica sends. When you want real delivery, point `MP_SMTP_RELAY_*` at a mail provider.

![Monica dashboard listing an upcoming September reminder](https://res.cloudinary.com/rroe4rtk/image/upload/v1787059887/monica-dashboard.png)
![Monica contact profile for Priya with a saved note](https://res.cloudinary.com/rroe4rtk/image/upload/v1787059888/monica-contact-profile.png)
![Monica reminders panel showing a monthly recurring reminder](https://res.cloudinary.com/rroe4rtk/image/upload/v1787059889/monica-recurring-reminder.png)

## About Hosting Monica

Monica is a Laravel application developed in the open since 2017, and deliberately unglamorous: you type what you know about someone, and it remembers. Self-hosting suits it, because health notes and family structure are exactly what people are uncomfortable storing on someone else's servers.

- Contacts with relationships, pets, work history and custom fields
- Notes, calls, conversations and activities, all timestamped
- One-off and recurring reminders delivered by email, plus automatic birthday reminders
- A journal, and gift, debt and task tracking per contact
- CardDAV and CalDAV, so contacts and reminders sync to your phone
- Two-factor authentication, a REST API, and vCard import/export

The split into services matters. The web service handles requests and runs migrations on boot. The scheduler is Monica's `schedule:run` loop; without it reminder emails are never queued and birthdays never fire. The worker consumes those jobs, keeping a slow mail server from blocking a page load. MySQL is the system of record; Redis holds sessions, so signing in survives a redeploy. Uploads go to the bucket rather than a disk, which is what lets the web service and the worker see the same files — and Monica streams each one through its own authenticated route, so a document is readable only by someone signed in.

## Why Deploy Monica on Railway

Railway removes the parts of self-hosting a Laravel app that have nothing to do with Monica.

- MySQL, Redis and object storage are provisioned and wired up for you
- The scheduler and queue worker run as real services, not cron on a laptop
- TLS, HTTPS and a public domain come free
- Private networking keeps the database and worker off the internet

## Common Use Cases

- Remembering the details of friendships and family life that a phone's contact list has no room for
- Keeping in touch deliberately, with recurring reminders to call people
- A privacy-first alternative to cloud personal CRMs that read your inbox

## Dependencies for Monica

- **Monica** — `monica:apache` (Docker Hub official image), currently 4.1.2, deployed from a source repository that adds first-run setup
- **Scheduler and queue worker** — the same image, in its `cron` and `queue` roles
- **MySQL** — Railway's managed MySQL; Monica supports MySQL-compatible databases only
- **Redis** — managed Redis for cache, sessions and the queue
- **Object storage** — a Railway bucket for uploads
- **Mailpit** — `axllent/mailpit:latest`, an SMTP server with a web inbox that also relays to a real provider

### Environment Variables Reference

| Variable | Purpose |
|---|---|
| `APP_KEY` | Encryption key. Must never change once data exists |
| `HASH_SALT` | Salt for the hashed IDs in URLs. Must never change |
| `APP_URL` | Public URL used in links inside reminder emails |
| `MONICA_ADMIN_EMAIL` / `MONICA_ADMIN_PASSWORD` | The first account, created while the database is empty |
| `APP_DISABLE_SIGNUP` | `true` keeps registration closed; `false` lets others join |
| `DAV_ENABLED` | CardDAV/CalDAV sync, on by default |
| `FILESYSTEM_DISK` | `s3` stores uploads in the bucket; `public` uses local disk |

### Deployment Dependencies

- Source image: [monica on Docker Hub](https://hub.docker.com/_/monica)
- Upstream project: [github.com/monicahq/monica](https://github.com/monicahq/monica)
- Image sources: [github.com/monicahq/docker](https://github.com/monicahq/docker)
- Runtime: PHP 8.2, Apache, MySQL 8+ or MariaDB, Redis

## Hardware Requirements for Self-Hosting Monica

| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 1 GB | 2 GB across all services |
| Storage | 1 GB | 5 GB plus bucket storage for photos |
| Runtime | PHP 8.1+, MySQL 5.7+ | PHP 8.2, MySQL 8+, Redis 7+ |

## Self-Hosting Monica with Docker

The quickest way to try Monica locally is the official image beside a MySQL container. The following is a minimal Docker Compose file:

```
services:
  app:
    image: monica:apache
    depends_on: [db]
    ports: ["8080:80"]
    environment:
      - APP_KEY=generate-a-32-character-key
      - DB_HOST=db
      - DB_USERNAME=monica
      - DB_PASSWORD=changeme
      - DB_DATABASE=monica
    volumes: ["data:/var/www/html/storage"]
  db:
    image: mysql:8
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=monica
      - MYSQL_PASSWORD=changeme
    volumes: ["mysql:/var/lib/mysql"]
volumes: {data: {}, mysql: {}}
```

Monica needs a 32-character `APP_KEY`. Generate one with OpenSSL:

```
echo -n 'base64:'; openssl rand -base64 32
```

A production install also needs the scheduler and queue worker, which ship inside the same image — this template runs both as separate services.

## How Much Does Monica Cost to Self-Host?

Monica is free and open source under the AGPL-3.0 licence, with no paid tier, seat limit or feature gate in the self-hosted edition. The project's own hosted service runs around $10–15 per month; self-hosting costs only the infrastructure underneath it. On Railway that is usage-based pricing across the web service, scheduler, worker, MySQL, Redis and bucket storage, and a personal instance is small and mostly idle.

## FAQ

**What is Monica?**

Monica is an open-source personal relationship manager: a private CRM for friends and family where you record how you know someone, what matters to them, and when to get back in touch.

**What does this Railway template deploy?**

A production Monica install: the web app, a scheduler, a queue worker, MySQL, Redis, an object storage bucket for uploads, and Mailpit for reminder emails.

**How do I log in for the first time on a self-hosted Monica instance?**

An owner account is created during the first boot from `MONICA_ADMIN_EMAIL` and `MONICA_ADMIN_PASSWORD`, both in the Monica service's Variables tab. Public registration stays closed unless you set `APP_DISABLE_SIGNUP` to `false`.

**Why does the template include Redis and a separate worker service?**

Monica queues its slow work — reminder mail, exports — rather than doing it during a page load. Redis carries that queue and stores sessions, so you stay signed in across deploys. The scheduler decides when jobs are due; the worker runs them.

**Can I sync Monica contacts to my phone?**

Yes. `DAV_ENABLED` is on by default, so the instance speaks CardDAV and CalDAV. Add the public URL as a CardDAV account on iOS or Android and contacts and reminders sync natively.

**How do I send reminder emails to a real inbox?**

Set `MP_SMTP_RELAY_HOST`, `MP_SMTP_RELAY_PORT`, `MP_SMTP_RELAY_USERNAME`, `MP_SMTP_RELAY_PASSWORD` and `MP_SMTP_RELAY_ALL=true` on the Mailpit service to forward everything to a real provider.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/monica-railway
