This add-on provides a Synapse Matrix Server for Home Assistant. Synapse is the reference homeserver implementation of the Matrix protocol, written in Python/Twisted with performance-critical modules implemented in Rust.
Matrix is an open standard for interoperable, decentralized, real-time communication over IP. It can be used to power Instant Messaging, VoIP/WebRTC signaling, Internet of Things communication, and anything else that needs a standard HTTP API for publishing and subscribing to data whilst tracking the conversation history.
- π Matrix Homeserver: Full-featured Matrix homeserver implementation
- π Secure: AppArmor security profile and secure defaults
- ποΈ PostgreSQL Support: External PostgreSQL database support
- π Persistent Storage: Automatic data persistence using Home Assistant volumes
- π Federation: Optional federation with other Matrix servers
- π§ Email: SMTP email notifications support
- π VoIP: TURN server support for voice and video calls
- π Monitoring: Optional Prometheus metrics
- π€ Admin User: Automatic admin user creation
- ποΈ Configurable: Extensive configuration through Home Assistant UI
- Add this repository to your Home Assistant Add-on Store
- Install the "Synapse Matrix Server" add-on
- Configure the add-on (see configuration section below)
- Start the add-on
This add-on requires a PostgreSQL database. We recommend using the official PostgreSQL add-on:
- Install the "PostgreSQL" add-on from the Official Add-ons repository
- Configure the PostgreSQL add-on with:
databases: - synapse logins: - username: synapse password: YOUR_SECURE_PASSWORD rights: - username: synapse database: synapse
- Start the PostgreSQL add-on
- Use these database settings in the Synapse configuration:
- Database Host:
core-postgres - Database Port:
5432 - Database Name:
synapse - Database User:
synapse - Database Password:
YOUR_SECURE_PASSWORD
- Database Host:
The following settings must be configured before starting the add-on:
- Server Name: The domain name of your Matrix homeserver (e.g.,
matrix.example.com) - Database Password: Password for the PostgreSQL database connection
- Admin Username: Username for the initial admin user
- Admin Password: Password for the initial admin user
server_name: "matrix.example.com"
database_host: "core-postgres"
database_port: 5432
database_name: "synapse"
database_user: "synapse"
database_password: "your_secure_database_password"
registration_enabled: false
registration_requires_token: true
admin_username: "admin"
admin_password: "your_secure_admin_password"
admin_email: "admin@example.com"
public_baseurl: "https://matrix.example.com"
federation_enabled: trueThe add-on exposes two ports:
- 8008: Matrix Client-Server API (required)
- 8448: Matrix Server-Server API for federation (optional, only if federation is enabled)
For production use, it's recommended to use a reverse proxy (like Nginx Proxy Manager) in front of Synapse. Configure your reverse proxy to:
- Forward requests to port 8008 for the Client-Server API
- Forward requests to port 8448 for federation (if enabled)
- Set proper headers for client IP forwarding
Example Nginx configuration:
location /_matrix {
proxy_pass http://homeassistant:8008;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
}
# For federation (if enabled)
location /.well-known/matrix/server {
proxy_pass http://homeassistant:8008;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
}Once the add-on is running and configured:
- Web Client: Access via a Matrix client like Element Web
- Server URL: Use
https://your-domain.com(orhttp://homeassistant:8008for local access) - Login: Use the admin credentials you configured
Set registration_enabled: true in the configuration (not recommended for public servers).
Use the admin interface or registration tokens to create users securely.
Access the add-on container and use Synapse's admin tools:
# Create a new user
python3 -m synapse.app.homeserver \
--config-path /config/synapse/homeserver.yaml \
--generate-missing-configs \
register_new_matrix_userTo enable federation with other Matrix servers:
- Set
federation_enabled: true - Ensure port 8448 is accessible from the internet
- Configure proper DNS records for your domain
- Set up SSL/TLS certificates
- Optionally set
serve_server_wellknown: truefor auto-discovery
| Option | Type | Default | Description |
|---|---|---|---|
server_name |
string | homeassistant.local |
Domain name of the homeserver |
database_host |
string | core-postgres |
PostgreSQL hostname |
database_port |
int | 5432 |
PostgreSQL port |
database_name |
string | synapse |
PostgreSQL database name |
database_user |
string | synapse |
PostgreSQL username |
database_password |
string | PostgreSQL password (required) | |
registration_enabled |
bool | false |
Allow new user registration |
registration_requires_token |
bool | true |
Require tokens for registration |
admin_username |
string | admin |
Initial admin username |
admin_password |
string | Initial admin password (required) | |
admin_email |
string | Admin email address | |
federation_enabled |
bool | true |
Enable federation |
public_baseurl |
string | Public URL for the homeserver | |
max_upload_size |
string | 50M |
Maximum file upload size |
See the full configuration documentation for all available options.
Database Connection Failed
- Ensure PostgreSQL add-on is running
- Verify database credentials in configuration
- Check that the database and user exist
Federation Not Working
- Verify port 8448 is accessible from the internet
- Check DNS configuration for your domain
- Ensure SSL certificates are properly configured
High Memory Usage
- Synapse can be memory-intensive with large rooms
- Consider adjusting cache settings in the configuration
- Monitor resource usage in Home Assistant
Check the add-on logs in Home Assistant for detailed error messages and debugging information.
- Use strong passwords for admin accounts and database
- Enable registration tokens instead of open registration
- Use HTTPS with valid SSL certificates for production
- Regularly update the add-on to get security fixes
- Monitor logs for suspicious activity
- Consider rate limiting at the reverse proxy level
This add-on is provided as-is. For issues related to:
- Synapse functionality: Check Synapse documentation
- Add-on specific issues: Open an issue in this repository
- Home Assistant integration: Visit the Home Assistant Community
This add-on is licensed under the AGPL-3.0 license, same as Synapse.
The Synapse Matrix Server is developed by Element (formerly New Vector) and the Matrix.org Foundation.