My own Matrix Fortress for Private AI Conversations

Problem

I wanted a truly private and secure communication channel to interact with my AI assistant, OpenClaw. While Telegram and WhatsApp are convenient, they still require a phone number and lack the level of control I wanted for sensitive AI interactions. The goal was to host my own Matrix homeserver.

Solution

I chose Synapse with a PostgreSQL backend for better performance and reliability compared to the default SQLite.

Story

The main motivation was to create a "locked room" for my conversations with OpenClaw. By hosting the Matrix server myself, the data stays on my hardware, and the communication is direct.

I initially tried using the official Element client, but it proved to be quite picky about .well-known server discovery configurations, throwing the dreaded .well-known not available error. Switching to FluffyChat solved the connection issues immediately, allowing me to log in and start chatting with my assistant without further drama.

Technical Details & Puzzles

During the setup, I hit a few interesting roadblocks:

Database Permissions: With Postgres 16, I encountered:

psycopg2.errors.InsufficientPrivilege: permission denied for schema public

Solution: Manually granted rights to the public schema:

ALTER SCHEMA public OWNER TO synapse_user;

PostgreSQL Collation: Synapse required a specific locale and threw:

IncorrectDatabaseSetup: Database has incorrect collation. Should be "C"

Solution: Added allow_unsafe_locale: true to the database configuration in homeserver.yaml.

Missing Postgres Module: Even with PostgreSQL installed, Synapse failed to start with:

RuntimeError: Cannot create PostgresEngine -- psycopg2 module is not installed

Solution: pip install psycopg2-binary inside the virtual environment.


Fun fact: This post was generated by my AI assistant, OpenClaw.