Deployment guide

Monica

Overview

Monica is a free, open source, self-hosted personal relationship manager: a private CRM for your personal life rather than a business sales tool. Record how and when you interacted with the people who matter to you, set reminders for birthdays and important dates, and log gifts, notes, debts, tasks, activities and journal entries. Monica syncs contacts and important dates with your phone over CardDAV and CalDAV, and it exposes a documented REST API.

This SecureAnyCloud image delivers Monica fully installed and configured on Ubuntu 24.04, as a PHP 8.3 Laravel application backed by MariaDB. A complete personal CRM is running within minutes of launch, and your data stays private on infrastructure you control. Monica is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0), and this image repackages the upstream open source release with SecureAnyCloud's provisioning and support.

What you get:

  • Monica 4.1.2 (AGPL-3.0), served from /var/www/monica
  • PHP 8.3 (php8.3-fpm) with OPcache and nginx, with the web UI on port 80
  • MariaDB as the database backend, listening on localhost only
  • The MariaDB datadir on a dedicated, independently resizable data disk mounted at /var/lib/mysql, and the Monica application tree on a second dedicated data disk mounted at /var/www
  • The Laravel task scheduler, running every minute through a systemd timer to send reminders
  • A per-VM administrator password, a fresh Laravel application key and a fresh MariaDB password, all generated on first boot and written to a root-only file, so no default or shared login ships in the image
  • Signups disabled, so the per-instance administrator is the only account
  • 24/7 SecureAnyCloud support

All product and company names are trademarks or registered trademarks of their respective holders.

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2s (2 vCPU / 4 GiB RAM) is a good starting size. Scale up for larger contact lists or heavier use.

On the network security group (NSG), allow inbound 22/tcp from your management network and 80/tcp (HTTP) from your users. Add 443/tcp if you enable HTTPS.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Monica by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Select Review + create, then Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:monica-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name monica \
  --image sac1647283583153:monica-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard

Open port 80 to reach the web UI:

az vm open-port --resource-group <your-rg> --name monica --port 80 --priority 900

Step 3 - Connect to your VM

Connect to the VM over SSH as the azureuser account:

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

Check that the three services behind Monica report active, and that the sign-in page (GET /login) answers HTTP 200 on port 80:

systemctl is-active nginx php8.3-fpm mariadb curl -s -o /dev/null -w 'GET /login -> %{http_code}\n' http://127.0.0.1/login

Expected output: three lines of active, then GET /login -> 200. Only nginx on port 80 is exposed. PHP runs behind it under php-fpm, and MariaDB listens on localhost only, so there is no database port to open.

Step 5 - Retrieve your administrator password

On the first boot of every VM, a one-shot service (monica-firstboot.service) generates credentials that are unique to that VM: a fresh administrator password, a fresh MariaDB password and a fresh Laravel application key. It also pins the application to your VM's own address. No shared or default credentials ship in the image.

Read the credentials file:

sudo cat /root/monica-credentials.txt

The file (mode 0600, root only) contains the administrator email (monica.admin.user), the administrator password (monica.admin.pass) and the sign-in URL (monica.url).

You can test the sign-in from the VM's own shell. Monica signs in through a form that carries a Laravel CSRF token. The following commands read the per-VM credentials, fetch the token and post a real sign-in. A correct password answers HTTP 302, which redirects to the dashboard:

EMAIL=$(sudo grep '^monica.admin.user=' /root/monica-credentials.txt | cut -d= -f2-)
PASS=$(sudo grep '^monica.admin.pass=' /root/monica-credentials.txt | cut -d= -f2-)
J=$(mktemp)
TOKEN=$(curl -s -c "$J" http://127.0.0.1/login | grep -m1 -oE 'name="_token"[^>]*value="[^"]+"' | sed 's/.*value="//;s/".*//')
echo -n 'sign-in HTTP status -> ' curl -s -o /dev/null -w '%{http_code}\n' -b "$J" -c "$J" \
  --data-urlencode "_token=$TOKEN" --data-urlencode "email=$EMAIL" --data-urlencode "password=$PASS" \
  http://127.0.0.1/login rm -f "$J"

Expected output: sign-in HTTP status -> 302. This confirms that the credentials in the file sign in successfully.

Step 6 - Sign in

Browse to http://<vm-public-ip>/. Sign in with the administrator email and password from the credentials file. Monica opens on your dashboard, the home of your personal relationship manager.

Step 7 - Add contacts, reminders and notes

Open Contacts and choose to add a person. Record their name and details. On their profile, log how you know them, set reminders for birthdays and important dates, and note gifts, activities, tasks and debts.

Each person you add appears in your contacts list with a searchable profile. The profile keeps everything you have recorded about your relationship with them in one place.

Step 8 - Confirm the version, the stack and the data disks

Run these commands to check the Monica version, the PHP version and the data disk mounts:

cat /var/www/monica/config/.version php -v | head -1 findmnt -no TARGET,SOURCE,FSTYPE /var/lib/mysql findmnt -no TARGET,SOURCE,FSTYPE /var/www

Expected output: Monica v4.1.2, PHP 8.3, and both /var/lib/mysql and /var/www mounted from their own dedicated data disks. The MariaDB datadir and the Monica application tree each live on their own disk, independently resizable and separate from the operating system disk. Resize them from the Azure portal if you need more room.

First-boot service and security model

A one-shot monica-firstboot.service runs after the network is up. It performs these tasks:

  • Rotates the MariaDB password and regenerates a fresh Laravel APP_KEY
  • Pins the application URL to the VM's own address, resolved from the Azure instance metadata service
  • Migrates and seeds the schema
  • Creates the per-instance administrator account with a fresh password
  • Writes the credentials file at mode 0600 (root only)
  • Drops a sentinel so that it runs exactly once

The image ships with an empty database and no usable login. Signups are disabled, so the per-instance administrator created on first boot is the only account.

Verify the service and the credentials file permissions:

systemctl is-active monica-firstboot.service
sudo stat -c '%a %U:%G %n' /root/monica-credentials.txt

Expected output: active, then 600 root:root /root/monica-credentials.txt.

Enable HTTPS with your own domain

The image serves the web UI over plain HTTP on port 80. For a browser-trusted certificate, point a DNS record at the VM and open port 443 in the NSG. Then install a certificate from your CA, for example Let's Encrypt:

sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.example.com

Certbot updates the nginx site to serve your domain certificate. Then set APP_URL=https://your-domain.example.com and APP_FORCE_HTTPS=true in /var/www/monica/.env. Run sudo -u www-data php /var/www/monica/artisan config:cache so that Monica generates its links over HTTPS.

Sync contacts over CardDAV and CalDAV

Monica ships with CardDAV and CalDAV support, so you can sync contacts and important dates with your phone or desktop. Point your device's CardDAV/CalDAV client at http://<vm-public-ip>/dav/. Use HTTPS once you have enabled it. Sign in with your administrator email and an application-specific token that you generate under Settings.

Back up and maintain Monica

Monica keeps your relationship data in MariaDB under /var/lib/mysql. Its application files and uploads live under /var/www/monica, each on its own dedicated data disk. For a full point-in-time copy, snapshot the data disks and the OS disk from the Azure portal. Alternatively, dump the database and archive the uploads:

sudo mysqldump monica | gzip > /var/backups/monica-db-$(date +%F).sql.gz
sudo tar -C /var/www -czf /var/backups/monica-app-$(date +%F).tar.gz monica

Keep the OS current with sudo apt-get update && sudo apt-get upgrade. The image ships with unattended security updates enabled. Review the Monica documentation before moving between major versions, and always back up before an upgrade.

Support

This image is backed by 24/7 SecureAnyCloud support. Support covers deployment and initial configuration, retrieving first-boot administrator credentials, email relay and SMTP configuration, CardDAV and CalDAV sync setup, two-factor authentication, application upgrades and patch management, HTTPS and custom domain setup, performance tuning, and MariaDB administration.

Email sales@secureanycloud.com or use the live chat in the support portal. Critical issues receive a one-hour average response.

Deploy on Azure

Launch Monica on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure