MATRIX SYNAPSE ยท ELEMENT WEB ยท HOME ASSISTANT ADD-ON

Matrix Server in Purple Glass.

Operations wiki for the Matrix Server Home Assistant Add-on: Synapse + Element Web + Element Call + LiveKit + Synapse Admin โ€” installation, NPM setup, federation, UnifiedPush and troubleshooting.

Add-on Slugmatrix_server
Element Web:7080
Synapse API:8008
Federation:8448

โšก Minimum Config

Set server_name BEFORE first start โ€” cannot be changed after.

server_name: "your-domain.duckdns.org"
postgres_password: "strong_password"
enable_registration: false

๐Ÿงญ Runtime Stack

All services run as separate s6-overlay processes inside a single container.

PostgreSQL โ†’ Synapse โ†’ Element Web
LiveKit SFU โ†’ LiveKit JWT โ†’ Element Call
Synapse Admin (on-demand download)
๐Ÿ 

Home

Overview

#home

Matrix Server (ESS CE) is a full Matrix homeserver stack: Synapse + Element Web + Element Call (Voice/Video) + LiveKit SFU + Synapse Admin + PostgreSQL โ€” as a single Home Assistant Add-on.

โš ๏ธ server_name cannot be changed after first start. Choose carefully.

#Component Overview

ComponentVersionPurpose
Synapse1.148.0Matrix homeserver
PostgreSQL 15Debian pkgDatabase
Element Webv1.12.11Web client
Element CalllatestVoice / Video calls
LiveKit SFUlatestWebRTC media server
Synapse Adminv0.10.3-etke32Admin UI
Synapse Admin uses the etkecc fork โ€” required for Synapse 1.14x compatibility.

#Minimum Operating Model

Browser           โ†’ Element Web    :7080 (via NPM)
Browser           โ†’ Synapse Admin  :8090 (via NPM)
Matrix Clients    โ†’ Synapse API    :8008 (via NPM)
Federation        โ†’ Synapse        :8448 (direct, router forward)
Element Call/VC   โ†’ LiveKit SFU    :7880 (via NPM, WebSocket)
๐Ÿš€

Installation

Install the Add-on

#installation

#Step 1 โ€” Add Repository

  1. Open Home Assistant.
  2. Go to Settings โ†’ Add-ons โ†’ Add-on Store.
  3. Open โ‹ฎ โ†’ Repositories.
  4. Add:
https://github.com/pol4rfuchs/ha-apps

#Step 2 โ€” Configure Before First Start

Set at minimum before starting:

server_name: "your-domain.duckdns.org"
element_web_url: "https://your-domain.duckdns.org"
postgres_password: "strong_password_here"
enable_registration: false
server_name cannot be changed after first start. It becomes your permanent Matrix ID (@user:server_name).

#Step 3 โ€” Start

First start takes 2โ€“3 minutes. Element Web and Synapse Admin are downloaded at runtime.

#Step 4 โ€” Create Admin User

docker exec -it addon_local_matrix_server \
  /opt/synapse/bin/register_new_matrix_user \
  -c /data/matrix/synapse/homeserver.yaml \
  --admin -u admin -p YourSecurePassword \
  http://localhost:8008
โš™๏ธ

Configuration

All Options

#configuration

#Required

OptionDescription
server_nameYour Matrix domain. No trailing slash. Cannot change after first start.
postgres_passwordPostgreSQL password. Set before first start.

#General

OptionDefaultDescription
element_web_urlโ€”External HTTPS URL for Element Web.
element_call_urlโ€”External HTTPS URL for Element Call.
livekit_urlโ€”WebSocket URL for LiveKit SFU.
livekit_jwt_urlโ€”HTTPS URL for LiveKit JWT bridge.
ntfy_urlโ€”Optional external ntfy URL for UnifiedPush.
enable_registrationfalseAllow public registration.
enable_federationtrueConnect to the Matrix federation.
max_upload_size_mb50Max media upload size in MB.
log_levelWARNINGDEBUG / INFO / WARNING / ERROR
๐ŸŒ

Ports & Networking

Port Reference

#ports
PortServiceAccess
7080Element WebVia NPM โ†’ element.your-domain
8008Synapse APIVia NPM โ†’ matrix.your-domain
8090Synapse Admin UIVia NPM โ†’ admin.your-domain
8448Matrix FederationDirect โ€” port-forward required on router
7880LiveKit SFUVia NPM (WebSocket required)
8089LiveKit JWT BridgeVia NPM

See NPM_SETUP.md in the add-on repo for the complete Nginx Proxy Manager configuration.

๐Ÿ”ง

Synapse Admin

Admin UI

#synapse-admin

#Access

External: https://admin.your-domain.duckdns.org
Local:    http://HA-IP:8090

Homeserver URL: https://matrix.your-domain.duckdns.org
Username:       admin
NPM Access List for admin.* must be set to Publicly Accessible โ€” the auth comes from the Synapse Admin login itself, not NPM.

#Get Admin Token Manually

curl -s -X POST http://HA-IP:8008/_matrix/client/v3/login \
  -H "Content-Type: application/json" \
  -d '{"type":"m.login.password","user":"admin","password":"YourPassword"}' \
  | jq .access_token
๐Ÿ“ฑ

UnifiedPush

Android Push via ntfy

#unifiedpush

Matrix + ntfy add-on = privacy-friendly Android push without Google Firebase.

Element Android
  โ†’ selects ntfy as UnifiedPush distributor
  โ†’ registers push gateway with Synapse:
      https://ntfy.your-domain/_matrix/push/v1/notify
  โ†’ Synapse sends pushes to ntfy
  โ†’ ntfy delivers to your device

#Setup

  1. Set ntfy_url in the add-on config to your external ntfy URL.
  2. Install ntfy from F-Droid (Play Store version has no UnifiedPush).
  3. In Element Android: Settings โ†’ Notifications โ†’ UnifiedPush โ†’ select ntfy.
Synapse does not need the ntfy URL in its config โ€” the client registers the gateway automatically.
๐Ÿ’พ

Persistence

Data & Backup

#persistence
/data/matrix/
โ”œโ”€โ”€ postgresql/           # PostgreSQL database
โ”œโ”€โ”€ synapse/
โ”‚   โ”œโ”€โ”€ homeserver.yaml   # Synapse config
โ”‚   โ”œโ”€โ”€ signing.key       # โš ๏ธ BACKUP โ€” loss = loss of federation identity
โ”‚   โ””โ”€โ”€ media_store/      # Uploaded media
โ”œโ”€โ”€ element-web/          # Element Web (persistent)
โ”œโ”€โ”€ synapse-admin/        # Synapse Admin (persistent)
โ””โ”€โ”€ .webapps_downloaded   # Skip re-download marker
signing.key is critical. Keep it in a secure offline backup. Loss means your server loses its Matrix federation identity permanently.

#Force Web App Re-download

docker exec addon_local_matrix_server rm /data/matrix/.webapps_downloaded
# Then restart the add-on
๐Ÿก

HA Integration

Notify via Matrix

#ha-integration
# configuration.yaml
notify:
  - platform: matrix
    name: matrix_notify
    homeserver: https://matrix.your-domain.duckdns.org
    username: "@homeassistant:your-domain.duckdns.org"
    password: "ha_user_password"
    default_room: "#homeassistant:your-domain.duckdns.org"

See ha_matrix_integration.yaml in the add-on repo for automation examples.

๐Ÿ› ๏ธ

Troubleshooting

Known Symptoms & Fixes

#troubleshooting
ProblemCauseFix
Server name has invalid formatTrailing slash in server_name.Remove the trailing slash.
Admin Panel "Something went wrong"Stale browser cache.F12 โ†’ Application โ†’ Clear Site Data.
Admin Panel 401NPM Access List active.Set Access List to "Publicly Accessible".
Element Web wrong serverWrong config.json loaded.Clear browser cache.
Web apps 0 filesExtraction failed on startup.Delete .webapps_downloaded marker and restart.
Synapse token invalidAdd-on reinstalled, DB empty.Re-create admin user.
Federation brokenPort 8448 not forwarded.Router: 8448 โ†’ HA-IP:8448.

#Resources

# Test federation
https://federationtester.matrix.org/#your-domain.duckdns.org

# Resource usage (Pi 4, 8 GB RAM)
PostgreSQL:   ~100 MB   <1% CPU
Synapse:      ~300-500 MB   1-3% CPU
Element Web:  ~10 MB   <1% CPU
Total:        ~450-650 MB   ~3-5% CPU