Railway

Deploy Monica — Self-Hosted Personal Relationship CRM

Self-host Monica — track relationships, birthdays & contacts

Deploy Monica — Self-Hosted Personal Relationship CRM

Monica

monica:4

Just deployed

/var/www/html/storage

Just deployed

/var/lib/mysql

Deploy and Host Monica on Railway

Monica is the open-source Personal Relationship Manager — a private CRM for your life, not your business. Track the people you care about: log conversations, remember birthdays and how you met, note gift ideas, record debts, set reminders to stay in touch, and keep a journal of life events. It's an ad-free, private alternative to keeping it all in your head or scattered across apps. This template deploys Monica with a MySQL database and persistent file storage, with the encryption key and production settings configured, so your personal CRM is ready in minutes.


What This Template Deploys

ServicePurpose
MonicaThe personal CRM app, dashboard, and reminders (PHP on Apache)
MySQLContacts, conversations, reminders, journal entries, and relationships

Both connect over Railway's private network. A persistent volume at /var/www/html/storage holds uploaded files — contact photos, documents — while all your relationship data lives in MySQL, so nothing is lost on redeploy.


About Hosting

Monica is a mature Laravel application, and a few specifics make it deploy cleanly and stay private — all handled here.

APP_KEY must be a base64 32-byte key — or Monica won't run. Monica uses a Laravel encryption key in the form base64:... (generated with openssl rand -base64 32) to encrypt sensitive data. A missing or malformed key stops the app from starting, and changing it after data exists makes encrypted values unreadable. This template generates a valid key and keeps it stable, so Monica boots correctly and your data stays decryptable.

Uploaded files need the persistent volume. Contact photos and document attachments are written to /var/www/html/storage, which is ephemeral on Railway — they'd vanish on redeploy without a volume. This template mounts persistent storage there, while all structured data (contacts, conversations, reminders, journal) lives in MySQL.

Register first, then lock signups — the key privacy step. Monica has no env-var admin: the first account you register through the web page becomes the instance administrator. Right after creating it, set APP_DISABLE_SIGNUP=true in your Railway variables so no one else can register on your instance — otherwise your personal CRM is open to public signup. This one step is what makes it truly yours.

Migrations run automatically on startup. Monica applies its database migrations when it starts, so wait for the deployment to finish and migrations to complete before opening the URL. On first load you'll get the registration page; once you're in, the schema is ready.

Add email for reminders. Monica's core value is reminders — birthdays, "reach out to X," anniversaries. Configure the MAIL_* variables with your SMTP provider so those reminder emails actually send; without it, reminders exist in-app but won't reach your inbox.

Typical cost: ~$5–10/month on Railway for Monica and MySQL. It's free and open source when self-hosted, versus the hosted Monica plan's subscription — and your relationship data stays private on your own infrastructure.


How It Compares

Monica (self-hosted)Phone contactsNotion / spreadsheetHosted personal CRM
Purpose-built for relationshipsYesNoNoYes
Reminders to stay in touchYesNoManualYes
Conversation & gift logsYesNoManualYes
PrivacyFull — your infraDevice/cloudVendorVendor
Cost modelFlat infraFreeFree/tieredSubscription
Self-hostableYesN/ANoNo

Phone contacts store numbers but nothing about the relationship. Notion or a spreadsheet can be bent into a CRM but has no reminders, structure, or relationship model. Hosted personal-CRM services do the job but keep your most personal data — who you know and what you discussed — on their servers. Monica's edge is being purpose-built for personal relationships, self-hosted, so intimate data about the people in your life stays entirely on infrastructure you own.


Deploy in Under 5 Minutes

  1. Click Deploy on Railway — Monica and MySQL build, and migrations run (~4 minutes)
  2. Confirm APP_KEY (base64) and the MySQL connection are set
  3. Wait for migrations to finish, then open your Railway URL to reach the registration page
  4. Register your account — the first one becomes the administrator
  5. Set APP_DISABLE_SIGNUP=true, then add your first contact and log a conversation

Configure the MAIL_* variables so birthday and stay-in-touch reminders reach your inbox.


Common Use Cases

  • Stay in touch — reminders to reach out to friends and family so relationships don't drift
  • Remember the details — log conversations, how you met, kids' names, and preferences per contact
  • Gift planning — keep running gift ideas for each person so you're never stuck
  • Private relationship journal — record life events and notes, entirely on your own infrastructure

Configuration

VariableRequiredDescription
APP_KEYGeneratedLaravel base64: encryption key — required to run; keep stable
APP_ENVPre-setproduction
DB_HOST / DB_DATABASE / DB_USERNAME / DB_PASSWORDAuto-injectedMySQL connection via Railway references
APP_DISABLE_SIGNUPRecommendedtrue after registering, so no one else can sign up
Storage volumePre-setPersistent volume at /var/www/html/storage for uploads
MAIL_*OptionalSMTP so reminder and notification emails send

APP_KEY is critical, and lock signups after registering. Monica won't start without a valid base64: key, and changing it makes encrypted data unreadable. After creating your admin account, set APP_DISABLE_SIGNUP=true so your instance stays private.

Uploads need the volume. Contact photos and attachments are ephemeral without persistent storage — this template mounts a volume so they survive redeploys. Structured data lives in MySQL.


Dependencies for Monica Hosting

  • Railway account — ~$5–10/month for Monica and MySQL
  • MySQL (included and wired via Railway references)
  • A persistent volume at /var/www/html/storage for uploads (included)
  • Optional: SMTP credentials so reminder emails send

Deployment Dependencies

Implementation Details

The template runs the official monica image (PHP on Apache) wired to a Railway-managed MySQL service over the private network, with database credentials injected via Railway reference variables and APP_ENV=production. Monica is a Laravel application requiring APP_KEY in the base64: form; the template generates a valid 32-byte key and keeps it stable, since a malformed key prevents startup and a changed key renders previously encrypted data unreadable. Database migrations run automatically on startup, so the schema is ready by first load.

Uploaded files — contact photos and document attachments — are written to /var/www/html/storage, so the template mounts a persistent volume there; without it these are lost on redeploy. All structured data (contacts, conversations, reminders, journal entries, gift ideas, debts, and relationship links) persists in MySQL, which is the component to back up.

Monica has no environment-variable admin: the first account registered through the web interface becomes the administrator, after which APP_DISABLE_SIGNUP=true should be set to prevent public registration on the instance. The MAIL_* variables enable reminder and notification emails, which power Monica's birthday and stay-in-touch reminders. Contacts can be imported via CSV or the REST API.


Frequently Asked Questions

Why won't Monica start? Usually a missing or malformed APP_KEY — it must be a valid Laravel base64: key. This template generates one correctly, so the app boots and your encrypted data stays readable.

How do I create my admin account? By registering the first account on the web page after deploy — it becomes the administrator. There's no env-var admin. Wait for migrations to finish, then open your Railway URL.

How do I keep my instance private? After creating your account, set APP_DISABLE_SIGNUP=true in Railway's variables. This stops anyone else from registering while keeping your account active — an important step for a personal CRM.

Does my data persist? Yes — contacts, conversations, reminders, and journal entries live in MySQL, and uploaded files on the /var/www/html/storage volume. Both survive redeploys; back up MySQL to preserve everything.

Can I import my contacts? Yes — Monica supports importing via CSV files and through its REST API, so you can bring in existing contacts rather than adding them all by hand.

How do reminder emails work? Configure the MAIL_* variables with your SMTP provider, and Monica sends birthday and stay-in-touch reminders to your inbox. Without email configured, reminders show in-app only.


Why Deploy Monica on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Monica on Railway you get a private personal CRM with the hard parts solved — MySQL wired, a valid encryption key generated, persistent storage for uploads, and automatic migrations. Track the people who matter and never forget a birthday, self-hosted with your relationships on infrastructure you own.


Template Content

More templates in this category

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

codestorm
40
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
51