Updated: 28 September 2026 · Applies to: Monica 4 with Docker

Ubuntu 18.04 is end of life. Monica is an open-source personal relationship manager (contacts, notes, reminders). The stable version is Monica 4 (PHP 8.1+); version 5 is still in beta. The easiest installation is the official Docker image.

Install Docker Engine (official repository)

Ubuntu 24.04 / Debian 12:

apt install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

On Debian, use https://download.docker.com/linux/debian in both the key URL and URIs.

AlmaLinux 9 / Rocky Linux 9:

dnf install dnf-plugins-core
dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker

Test with docker run hello-world. Compose is available as docker compose.

Run Monica with MariaDB

services:
  db:
    image: mariadb:11.4
    environment:
      MARIADB_RANDOM_ROOT_PASSWORD: "yes"
      MARIADB_DATABASE: monica
      MARIADB_USER: monica
      MARIADB_PASSWORD: Strong-Password
    volumes: [db-data:/var/lib/mysql]
    restart: unless-stopped
  app:
    image: monica:4
    depends_on: [db]
    environment:
      APP_KEY: "base64:REPLACE-WITH-32-RANDOM-BYTES"
      DB_HOST: db
      DB_DATABASE: monica
      DB_USERNAME: monica
      DB_PASSWORD: Strong-Password
      APP_URL: https://monica.example.com
    volumes: [data:/var/www/html/storage]
    ports: ["127.0.0.1:8080:80"]
    restart: unless-stopped
volumes:
  db-data:
  data:

Create the key with echo "base64:$(openssl rand -base64 32)", save the file as /opt/monica/compose.yaml, and run docker compose up -d in that folder. Put Nginx with HTTPS in front of port 8080 and open the site to register the first user.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket