← Back to smarthome overview

iCloud Contacts Sync

Contacts are spread across several iCloud accounts, and the useful views are not always the ones Apple offers. iCloud Contacts Sync keeps every account in sync with a central MariaDB database, sends a birthday digest, and serves a read-only web view for the homelab.

iCloud Contacts dashboard with contact count, upcoming birthdays and sync status

The dashboard shows the latest sync status, upcoming birthdays and a contact overview.

How the sync works

Multiple accounts

Each Apple ID gets an entry in a local account file with a unique name, the Apple email address, an app-specific password, the matching Authelia user and an optional birthday mail recipient. Optional per-account settings add a healthcheck URL and a chat sender name for the Chat Archive mapping. The file holds credentials, stays on the host and is mounted into the container read-only.

Birthday digest

Web view and API

iCloud Contacts detail page with contact data, groups and sync metadata

A contact detail page with groups, contact fields and sync metadata.

Chat Archive integration

The web view can optionally connect to Chat Archive. It then shows the most frequent chat partners, links them to matching contacts and displays the message history for a contact. A contact chat can also be exported as Markdown, including contact data and notes.

Deployment and data

The sync and API run as Docker containers from GHCR. MariaDB runs in the central LXC container, and the account file is mounted from the host. CI builds the image and can trigger a Watchtower webhook after a new push. Because the data lives in MariaDB, backups follow the normal database backup path described in the backup strategy.

See the iCloud Contacts Sync repository for the account format, database setup and compose example, and Docker container strategy for the surrounding stack.

Contact data is personal and is not published here. The screenshots use demo data.