Deploy Monica | Open-Source Personal Relationship Manager
Self-host Monica to track contacts, birthdays, relationships & more
Deploy and Host Monica on Railway
Monica is an open-source personal relationship management (PRM) system that helps you organize and remember everything about your family, friends, and business relationships. Deploy Monica on Railway to self-host a private, ad-free platform for tracking conversations, birthdays, gift ideas, debts, and life events for every contact in your life.
This Railway template deploys Monica with a MySQL database for persistent storage and a volume for uploaded files. The pre-configured setup includes production-ready security settings, HTTPS support behind Railway's proxy, and automatic database migrations on startup.
Getting Started with Monica on Railway
After deployment completes, open the public URL to access the Monica registration page. Create your first account by entering your name, email, and password. This account becomes the instance administrator. Once registered, navigate to the dashboard where you can add your first contact by clicking "Add a contact" and entering their details. Set birthday reminders, log a recent conversation, or add relationship notes to start building your personal CRM. After creating your account, set APP_DISABLE_SIGNUP=true in Railway's variables panel to prevent unauthorized registrations.

About Hosting Monica
Monica is a Personal Relationship Management (PRM) system — not a traditional business CRM. It focuses on the human side of relationships rather than sales pipelines and revenue tracking.
- Contact profiles with addresses, phone numbers, work history, food preferences, and custom fields
- Conversation logging for phone calls, activities, and meetings with timestamps
- Birthday and reminder tracking with automatic notifications
- Debt and gift management for tracking who owes what and gift ideas
- Journal for documenting daily thoughts and life events
- Relationship mapping to link family members, partners, and friend groups
- API access for building integrations and automations
- Built with Laravel (PHP) and Vue.js, backed by MySQL
Why Deploy Monica on Railway
One-click deployment with automatic database provisioning and HTTPS:
- Persistent MySQL database and file storage volume included
- Automatic database migrations on every deploy
- No vendor lock-in — AGPL-3.0 licensed, export your data anytime
- Full data privacy — your relationships data stays on your infrastructure
- Same features as the $9/month hosted version, at infrastructure cost only
Common Use Cases for Self-Hosted Monica
- Personal networking — track conversations and follow-ups with professional contacts, remember birthdays and kids' names for colleagues
- Family organization — document family relationships, important dates, medical info, and shared memories across extended family
- Journalism and research — maintain a private, encrypted contact database for sensitive sources without third-party data exposure
- Freelancer client management — log interactions, preferences, and project history for each client relationship
Dependencies for Monica on Railway
- Monica —
monica:4(official Docker image, Apache variant, PHP 8.2) - MySQL — Railway-managed MySQL database for contacts, conversations, and application data
Environment Variables Reference for Self-Hosted Monica
| Variable | Description | Example |
|---|---|---|
APP_KEY | Laravel encryption key (base64 format) | base64:<32-byte-key> |
APP_ENV | Application environment | production |
APP_URL | Public URL with HTTPS | https://${{RAILWAY_PUBLIC_DOMAIN}} |
DB_HOST | MySQL host | ${{MySQL.MYSQLHOST}} |
DB_PASSWORD | MySQL password | ${{MySQL.MYSQLPASSWORD}} |
TRUSTED_PROXIES | Proxy trust for HTTPS | * |
APP_DISABLE_SIGNUP | Disable public registration | true |
Deployment Dependencies
- Runtime: PHP 8.2 with Apache 2.4
- Docker Hub: monica
- GitHub: monicahq/monica
- Docs: docs.monicahq.com
Hardware Requirements for Self-Hosting Monica
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 256 MB | 512 MB |
| Storage | 1 GB | 5 GB (scales with uploads) |
| Runtime | PHP 8.2, Apache 2.4 | Same |
Monica is lightweight — a single-user instance runs comfortably on Railway's base tier.
Self-Hosting Monica with Docker
Run Monica locally with Docker Compose:
services:
app:
image: monica:4
ports:
- 8080:80
environment:
- APP_KEY=base64:$(openssl rand -base64 32)
- APP_ENV=production
- DB_HOST=db
- DB_DATABASE=monica
- DB_USERNAME=monica
- DB_PASSWORD=secret
volumes:
- storage:/var/www/html/storage
depends_on:
- db
db:
image: mariadb:11
environment:
- MYSQL_DATABASE=monica
- MYSQL_USER=monica
- MYSQL_PASSWORD=secret
- MYSQL_RANDOM_ROOT_PASSWORD=true
volumes:
- mysql:/var/lib/mysql
volumes:
storage:
mysql:
Start the stack:
docker compose up -d
Access Monica at http://localhost:8080 and create your first account.
Is Monica Free to Self-Host?
Monica is free and open-source under the AGPL-3.0 license. The hosted version at monicahq.com costs $9/month, but self-hosting is completely free with no feature restrictions. You get the exact same functionality — contact management, reminders, journaling, API access — at only infrastructure cost. On Railway, a single-user Monica instance typically costs $2–5/month depending on usage.
Monica vs Dex: Personal CRM Comparison
| Feature | Monica | Dex |
|---|---|---|
| Open Source | Yes (AGPL-3.0) | No |
| Self-Hostable | Yes | No |
| Price | Free (self-hosted) | $12/month |
| Contact Import | Manual / API | LinkedIn, email |
| Journal | Yes | No |
| Debt Tracking | Yes | No |
| Mobile App | Web-only (responsive) | iOS, Android |
| API | Full REST API | Limited |
Monica offers more features and full data ownership at zero cost, while Dex provides better LinkedIn integration and native mobile apps.
FAQ
What is Monica and why should I self-host it? Monica is an open-source personal relationship management system for tracking interactions with family, friends, and contacts. Self-hosting gives you complete data privacy — your personal relationship data never leaves your infrastructure, unlike cloud-based alternatives.
What does this Railway template deploy for Monica? This template deploys the official Monica Docker image (Apache variant) with a Railway-managed MySQL database. It includes persistent storage for file uploads, automatic HTTPS via Railway's edge proxy, and database migrations that run automatically on each deploy.
Why does Monica need a MySQL database on Railway? Monica stores all contacts, conversations, reminders, journal entries, and relationship data in MySQL. The Railway-managed MySQL service provides automatic backups, persistent storage, and internal networking so Monica connects securely without exposing the database publicly.
How do I disable public registration on self-hosted Monica?
After creating your admin account, set APP_DISABLE_SIGNUP=true in Railway's environment variables panel. This prevents anyone else from registering on your instance while keeping your existing account active.
Can I import contacts into self-hosted Monica on Railway?
Yes. Monica supports importing contacts via CSV files and through its REST API. Navigate to Settings → Import to upload a CSV, or use the /api/contacts endpoint for programmatic imports from other CRM systems.
How do I configure email notifications in Monica on Railway?
Set MAIL_MAILER=smtp along with MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, and MAIL_FROM_ADDRESS in Railway's environment variables. Monica uses email for birthday reminders and relationship follow-up notifications.
Template Content