Railway

Deploy Monica

Personal Relationship Manager. Remember birthdays, notes and promises

Deploy Monica

Just deployed

/var/www/html/storage

Just deployed

/data

Just deployed

Just deployed

/data

Just deployed

Just deployed

/var/lib/mysql

monica-storage

Bucket

Just deployed

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

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 Monica contact profile for Priya with a saved note Monica reminders panel showing a monthly recurring reminder

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

  • Monicamonica: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
  • Mailpitaxllent/mailpit:latest, an SMTP server with a web inbox that also relays to a real provider

Environment Variables Reference

VariablePurpose
APP_KEYEncryption key. Must never change once data exists
HASH_SALTSalt for the hashed IDs in URLs. Must never change
APP_URLPublic URL used in links inside reminder emails
MONICA_ADMIN_EMAIL / MONICA_ADMIN_PASSWORDThe first account, created while the database is empty
APP_DISABLE_SIGNUPtrue keeps registration closed; false lets others join
DAV_ENABLEDCardDAV/CalDAV sync, on by default
FILESYSTEM_DISKs3 stores uploads in the bucket; public uses local disk

Deployment Dependencies

Hardware Requirements for Self-Hosting Monica

ResourceMinimumRecommended
CPU1 vCPU2 vCPU
RAM1 GB2 GB across all services
Storage1 GB5 GB plus bucket storage for photos
RuntimePHP 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.


Template Content

More templates in this category

View Template
Rocky Linux
[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
42
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
52