Applications Azure

Monica on Ubuntu 24.04 on Azure User Guide

| Product: Monica on Ubuntu 24.04 LTS on Azure

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. Keep track of the people who matter to you: record how and when you interacted with them, set reminders for birthdays and important dates, and log gifts, notes, debts, tasks, activities and journal entries. It syncs contacts and important dates with your phone over CardDAV and CalDAV and exposes a documented REST API. The cloudimg image delivers Monica fully installed and configured on Ubuntu 24.04 as a PHP 8.3 Laravel application backed by MariaDB, so a complete personal CRM is running within minutes of launch, with all of your data staying private on infrastructure you control. Backed by 24/7 cloudimg support.

Monica is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). All product and company names are trademarks or registered trademarks of their respective holders. This image repackages the upstream open source release with cloudimg's provisioning and support.

What is included:

  • Monica 4.1.2 (AGPL-3.0), served from /var/www/monica
  • PHP 8.3 (php8.3-fpm) with OPcache + 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 via a systemd timer for 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 cloudimg support

Monica sign-in page served on first boot

Prerequisites

An active Azure subscription, an SSH key pair, and a VNet plus subnet in the target region. Standard_B2s (2 vCPU / 4 GiB RAM) is a good starting point; scale up for larger contact lists or heavier use. NSG inbound: allow 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 cloudimg, and select Create. On Basics 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). Then Review + create and Create.

Step 2 — Deploy from the Azure CLI

az vm create \
  --resource-group <your-rg> \
  --name monica \
  --image <marketplace-image-urn> \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard

Open HTTP 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

ssh azureuser@<vm-public-ip>

Step 4 — Confirm the services are running

The three services that back Monica should report active, and 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: 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.

Service status and HTTP liveness on port 80

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 pins the application to your VM's own address. No shared or default credentials ship in the image.

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).

Per-VM credentials, root-only and masked

You can prove the login round-trip from the VM's own shell. Monica signs in through a form that carries a Laravel CSRF token, so this reads the per-VM credentials, fetches the token and posts a real sign-in (a correct password answers HTTP 302, redirecting 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: sign-in HTTP status -> 302, confirming the credentials in the file sign in.

Step 6 — Sign in

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

Monica dashboard after sign in

Step 7 — Add contacts, reminders and notes

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

Add a new person form

As you add people they appear in your contacts list, each with a searchable profile that keeps everything you have recorded about your relationship with them in one place.

Contacts list with a saved contact

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

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: 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.

Version, stack and the dedicated data disks

First-boot service and security model

A one-shot monica-firstboot.service runs after the network is up. It rotates the MariaDB password, 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, then creates the per-instance administrator account with a fresh password, writes the credentials file at mode 0600 (root only) and drops a sentinel so it runs exactly once. The image ships with an empty database and no usable login; the per-instance administrator is created on first boot, and signups are disabled so it is the only account.

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

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

First-boot rotation and credential file permissions

Enabling 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, open port 443 in the NSG, and 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 and run sudo -u www-data php /var/www/monica/artisan config:cache so 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) and sign in with your administrator email and an application-specific token you generate under Settings.

Backup and maintenance

Monica keeps your relationship data in MariaDB under /var/lib/mysql and its application files and uploads under /var/www/monica, each on its own dedicated data disk. Snapshot the data disks and OS disk from the Azure portal for a full point-in-time copy, or 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 cloudimg support for deployment and initial configuration, retrieving first-boot administrator credentials, email relay and SMTP configuration, CardDAV and CalDAV sync setup, two factor authentication enablement, application upgrades and patch management, HTTPS and custom domain setup, performance tuning, and MariaDB administration. Email support@cloudimg.co.uk or use the live chat in the support portal; critical issues receive a one-hour average response.