mirror of
https://github.com/element-hq/synapse.git
synced 2026-03-30 21:35:53 +00:00
730 lines
53 KiB
HTML
730 lines
53 KiB
HTML
<!DOCTYPE HTML>
|
||
<html lang="en" class="light sidebar-visible" dir="ltr">
|
||
<head>
|
||
<!-- Book generated using mdBook -->
|
||
<meta charset="UTF-8">
|
||
<title>Installation - Synapse</title>
|
||
|
||
|
||
<!-- Custom HTML head -->
|
||
|
||
<meta name="description" content="">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<meta name="theme-color" content="#ffffff">
|
||
|
||
<link rel="icon" href="../favicon-de23e50b.svg">
|
||
<link rel="shortcut icon" href="../favicon-8114d1fc.png">
|
||
<link rel="stylesheet" href="../css/variables-8adf115d.css">
|
||
<link rel="stylesheet" href="../css/general-2459343d.css">
|
||
<link rel="stylesheet" href="../css/chrome-ae938929.css">
|
||
<link rel="stylesheet" href="../css/print-9e4910d8.css" media="print">
|
||
|
||
<!-- Fonts -->
|
||
<link rel="stylesheet" href="../fonts/fonts-9644e21d.css">
|
||
|
||
<!-- Highlight.js Stylesheets -->
|
||
<link rel="stylesheet" id="mdbook-highlight-css" href="../highlight-493f70e1.css">
|
||
<link rel="stylesheet" id="mdbook-tomorrow-night-css" href="../tomorrow-night-4c0ae647.css">
|
||
<link rel="stylesheet" id="mdbook-ayu-highlight-css" href="../ayu-highlight-3fdfc3ac.css">
|
||
|
||
<!-- Custom theme stylesheets -->
|
||
<link rel="stylesheet" href="../docs/website_files/indent-section-headers-3390f960.css">
|
||
<link rel="stylesheet" href="../docs/website_files/version-picker-ddc5216e.css">
|
||
|
||
|
||
<!-- Provide site root and default themes to javascript -->
|
||
<script>
|
||
const path_to_root = "../";
|
||
const default_light_theme = "light";
|
||
const default_dark_theme = "navy";
|
||
window.path_to_searchindex_js = "../searchindex-b358e032.js";
|
||
</script>
|
||
<!-- Start loading toc.js asap -->
|
||
<script src="../toc-4dc10a98.js"></script>
|
||
</head>
|
||
<body>
|
||
<div id="mdbook-help-container">
|
||
<div id="mdbook-help-popup">
|
||
<h2 class="mdbook-help-title">Keyboard shortcuts</h2>
|
||
<div>
|
||
<p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>
|
||
<p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
|
||
<p>Press <kbd>?</kbd> to show this help</p>
|
||
<p>Press <kbd>Esc</kbd> to hide this help</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div id="mdbook-body-container">
|
||
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
||
<script>
|
||
try {
|
||
let theme = localStorage.getItem('mdbook-theme');
|
||
let sidebar = localStorage.getItem('mdbook-sidebar');
|
||
|
||
if (theme.startsWith('"') && theme.endsWith('"')) {
|
||
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
||
}
|
||
|
||
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
||
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
||
}
|
||
} catch (e) { }
|
||
</script>
|
||
|
||
<!-- Set the theme before any content is loaded, prevents flash -->
|
||
<script>
|
||
const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
|
||
let theme;
|
||
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
||
if (theme === null || theme === undefined) { theme = default_theme; }
|
||
const html = document.documentElement;
|
||
html.classList.remove('light')
|
||
html.classList.add(theme);
|
||
html.classList.add("js");
|
||
</script>
|
||
|
||
<input type="checkbox" id="mdbook-sidebar-toggle-anchor" class="hidden">
|
||
|
||
<!-- Hide / unhide sidebar before it is displayed -->
|
||
<script>
|
||
let sidebar = null;
|
||
const sidebar_toggle = document.getElementById("mdbook-sidebar-toggle-anchor");
|
||
if (document.body.clientWidth >= 1080) {
|
||
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
||
sidebar = sidebar || 'visible';
|
||
} else {
|
||
sidebar = 'hidden';
|
||
sidebar_toggle.checked = false;
|
||
}
|
||
if (sidebar === 'visible') {
|
||
sidebar_toggle.checked = true;
|
||
} else {
|
||
html.classList.remove('sidebar-visible');
|
||
}
|
||
</script>
|
||
|
||
<nav id="mdbook-sidebar" class="sidebar" aria-label="Table of contents">
|
||
<!-- populated by js -->
|
||
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
|
||
<noscript>
|
||
<iframe class="sidebar-iframe-outer" src="../toc.html"></iframe>
|
||
</noscript>
|
||
<div id="mdbook-sidebar-resize-handle" class="sidebar-resize-handle">
|
||
<div class="sidebar-resize-indicator"></div>
|
||
</div>
|
||
</nav>
|
||
|
||
<div id="mdbook-page-wrapper" class="page-wrapper">
|
||
|
||
<div class="page">
|
||
<div id="mdbook-menu-bar-hover-placeholder"></div>
|
||
<div id="mdbook-menu-bar" class="menu-bar sticky">
|
||
<div class="left-buttons">
|
||
<label id="mdbook-sidebar-toggle" class="icon-button" for="mdbook-sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="mdbook-sidebar">
|
||
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg></span>
|
||
</label>
|
||
<button id="mdbook-theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="mdbook-theme-list">
|
||
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M371.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L600.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S549.7-4.4 531.1 9.6L294.4 187.2c-24 18-38.2 46.1-38.4 76.1L371.3 367.1zm-19.6 25.4l-116-104.4C175.9 290.3 128 339.6 128 400c0 3.9 .2 7.8 .6 11.6c1.8 17.5-10.2 36.4-27.8 36.4H96c-17.7 0-32 14.3-32 32s14.3 32 32 32H240c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"/></svg></span>
|
||
</button>
|
||
<ul id="mdbook-theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
||
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-default_theme">Auto</button></li>
|
||
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-light">Light</button></li>
|
||
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-rust">Rust</button></li>
|
||
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-coal">Coal</button></li>
|
||
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-navy">Navy</button></li>
|
||
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-ayu">Ayu</button></li>
|
||
</ul>
|
||
<button id="mdbook-search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="mdbook-searchbar">
|
||
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352c79.5 0 144-64.5 144-144s-64.5-144-144-144S64 128.5 64 208s64.5 144 144 144z"/></svg></span>
|
||
</button>
|
||
</div>
|
||
|
||
<!-- BEGIN CUSTOM SYNAPSE MODIFICATIONS -->
|
||
<div class="version-picker">
|
||
<div class="dropdown">
|
||
<div class="select">
|
||
<span></span>
|
||
<i class="fa fa-chevron-down"></i>
|
||
</div>
|
||
<input type="hidden" name="version">
|
||
<ul class="dropdown-menu">
|
||
<!-- Versions will be added dynamically in version-picker.js -->
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<!-- END CUSTOM SYNAPSE MODIFICATIONS -->
|
||
|
||
<h1 class="menu-title">Synapse</h1>
|
||
|
||
<div class="right-buttons">
|
||
<a href="../print.html" title="Print this book" aria-label="Print this book">
|
||
<span class=fa-svg id="print-button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M128 0C92.7 0 64 28.7 64 64v96h64V64H354.7L384 93.3V160h64V93.3c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0H128zM384 352v32 64H128V384 368 352H384zm64 32h32c17.7 0 32-14.3 32-32V256c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64v96c0 17.7 14.3 32 32 32H64v64c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V384zm-16-88c-13.3 0-24-10.7-24-24s10.7-24 24-24s24 10.7 24 24s-10.7 24-24 24z"/></svg></span>
|
||
</a>
|
||
<a href="https://github.com/element-hq/synapse" title="Git repository" aria-label="Git repository">
|
||
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg></span>
|
||
</a>
|
||
<a href="https://github.com/element-hq/synapse/edit/develop/docs/setup/installation.md" title="Suggest an edit" aria-label="Suggest an edit" rel="edit">
|
||
<span class=fa-svg id="git-edit-button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M421.7 220.3l-11.3 11.3-22.6 22.6-205 205c-6.6 6.6-14.8 11.5-23.8 14.1L30.8 511c-8.4 2.5-17.5 .2-23.7-6.1S-1.5 489.7 1 481.2L38.7 353.1c2.6-9 7.5-17.2 14.1-23.8l205-205 22.6-22.6 11.3-11.3 33.9 33.9 62.1 62.1 33.9 33.9zM96 353.9l-9.3 9.3c-.9 .9-1.6 2.1-2 3.4l-25.3 86 86-25.3c1.3-.4 2.5-1.1 3.4-2l9.3-9.3H112c-8.8 0-16-7.2-16-16V353.9zM453.3 19.3l39.4 39.4c25 25 25 65.5 0 90.5l-14.5 14.5-22.6 22.6-11.3 11.3-33.9-33.9-62.1-62.1L314.3 67.7l11.3-11.3 22.6-22.6 14.5-14.5c25-25 65.5-25 90.5 0z"/></svg></span>
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div id="mdbook-search-wrapper" class="hidden">
|
||
<form id="mdbook-searchbar-outer" class="searchbar-outer">
|
||
<div class="search-wrapper">
|
||
<input type="search" id="mdbook-searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="mdbook-searchresults-outer" aria-describedby="searchresults-header">
|
||
<div class="spinner-wrapper">
|
||
<span class=fa-svg id="fa-spin"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M304 48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zm0 416c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM48 304c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm464-48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM142.9 437c18.7-18.7 18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zm0-294.2c18.7-18.7 18.7-49.1 0-67.9S93.7 56.2 75 75s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zM369.1 437c18.7 18.7 49.1 18.7 67.9 0s18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9z"/></svg></span>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<div id="mdbook-searchresults-outer" class="searchresults-outer hidden">
|
||
<div id="mdbook-searchresults-header" class="searchresults-header"></div>
|
||
<ul id="mdbook-searchresults">
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
||
<script>
|
||
document.getElementById('mdbook-sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
||
document.getElementById('mdbook-sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
||
Array.from(document.querySelectorAll('#mdbook-sidebar a')).forEach(function(link) {
|
||
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
||
});
|
||
</script>
|
||
|
||
<div id="mdbook-content" class="content">
|
||
<main>
|
||
<h1 id="installation-instructions"><a class="header" href="#installation-instructions">Installation Instructions</a></h1>
|
||
<h2 id="choosing-your-server-name"><a class="header" href="#choosing-your-server-name">Choosing your server name</a></h2>
|
||
<p>It is important to choose the name for your server before you install Synapse,
|
||
because it cannot be changed later.</p>
|
||
<p>The server name determines the “domain” part of user-ids for users on your
|
||
server: these will all be of the format <code>@user:my.domain.name</code>. It also
|
||
determines how other matrix servers will reach yours for federation.</p>
|
||
<p>For a test configuration, set this to the hostname of your server. For a more
|
||
production-ready setup, you will probably want to specify your domain
|
||
(<code>example.com</code>) rather than a matrix-specific hostname here (in the same way
|
||
that your email address is probably <code>user@example.com</code> rather than
|
||
<code>user@email.example.com</code>) - but doing so may require more advanced setup: see
|
||
<a href="../federate.html">Setting up Federation</a>.</p>
|
||
<p>⚠️ Before setting up Synapse please consult the <a href="security.html">security page</a> for
|
||
best practices. ⚠️</p>
|
||
<h2 id="installing-synapse"><a class="header" href="#installing-synapse">Installing Synapse</a></h2>
|
||
<p>Note: Synapse uses a number of platform dependencies such as Python and PostgreSQL,
|
||
and aims to follow supported upstream versions. See the <a href="../deprecation_policy.html">deprecation
|
||
policy</a> for more details.</p>
|
||
<h3 id="prebuilt-packages"><a class="header" href="#prebuilt-packages">Prebuilt packages</a></h3>
|
||
<p>Prebuilt packages are available for a number of platforms. These are recommended
|
||
for most users.</p>
|
||
<h4 id="docker-images-and-ansible-playbooks"><a class="header" href="#docker-images-and-ansible-playbooks">Docker images and Ansible playbooks</a></h4>
|
||
<p>There is an official synapse image available at
|
||
<a href="https://hub.docker.com/r/matrixdotorg/synapse">https://hub.docker.com/r/matrixdotorg/synapse</a> or at <a href="https://ghcr.io/element-hq/synapse"><code>ghcr.io/element-hq/synapse</code></a>
|
||
which can be used with the docker-compose file available at
|
||
<a href="https://github.com/element-hq/synapse/tree/develop/contrib/docker">contrib/docker</a>.
|
||
Further information on this including configuration options is available in the README
|
||
on hub.docker.com.</p>
|
||
<p>Alternatively, Andreas Peters (previously Silvio Fricke) has contributed a
|
||
Dockerfile to automate a synapse server in a single Docker image, at
|
||
<a href="https://hub.docker.com/r/avhost/docker-matrix/tags/">https://hub.docker.com/r/avhost/docker-matrix/tags/</a></p>
|
||
<p>Slavi Pantaleev has created an Ansible playbook,
|
||
which installs the official Docker image of Matrix Synapse
|
||
along with many other Matrix-related services (Postgres database, Element, coturn,
|
||
ma1sd, SSL support, etc.).
|
||
For more details, see
|
||
<a href="https://github.com/spantaleev/matrix-docker-ansible-deploy">https://github.com/spantaleev/matrix-docker-ansible-deploy</a></p>
|
||
<h4 id="debianubuntu"><a class="header" href="#debianubuntu">Debian/Ubuntu</a></h4>
|
||
<h5 id="matrixorg-packages"><a class="header" href="#matrixorg-packages">Matrix.org packages</a></h5>
|
||
<p>Matrix.org provides Debian/Ubuntu packages of Synapse, for the amd64
|
||
architecture via <a href="https://packages.matrix.org/debian/">https://packages.matrix.org/debian/</a>.</p>
|
||
<p>To install the latest release:</p>
|
||
<pre><code class="language-sh">sudo apt install -y lsb-release wget apt-transport-https
|
||
sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
|
||
echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" |
|
||
sudo tee /etc/apt/sources.list.d/matrix-org.list
|
||
sudo apt update
|
||
sudo apt install matrix-synapse-py3
|
||
</code></pre>
|
||
<p>Packages are also published for release candidates. To enable the prerelease
|
||
channel, add <code>prerelease</code> to the <code>sources.list</code> line. For example:</p>
|
||
<pre><code class="language-sh">sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
|
||
echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main prerelease" |
|
||
sudo tee /etc/apt/sources.list.d/matrix-org.list
|
||
sudo apt update
|
||
sudo apt install matrix-synapse-py3
|
||
</code></pre>
|
||
<p>The fingerprint of the repository signing key (as shown by <code>gpg /usr/share/keyrings/matrix-org-archive-keyring.gpg</code>) is
|
||
<code>AAF9AE843A7584B5A3E4CD2BCF45A512DE2DA058</code>.</p>
|
||
<p>When installing with Debian packages, you might prefer to place files in
|
||
<code>/etc/matrix-synapse/conf.d/</code> to override your configuration without editing
|
||
the main configuration file at <code>/etc/matrix-synapse/homeserver.yaml</code>.
|
||
By doing that, you won’t be asked if you want to replace your configuration
|
||
file when you upgrade the Debian package to a later version.</p>
|
||
<h5 id="downstream-debian-packages"><a class="header" href="#downstream-debian-packages">Downstream Debian packages</a></h5>
|
||
<p>Andrej Shadura maintains a
|
||
<a href="https://packages.debian.org/sid/matrix-synapse"><code>matrix-synapse</code></a> package in
|
||
the Debian repositories.
|
||
For <code>forky</code> (14) and <code>sid</code> (rolling release), it can be installed simply with:</p>
|
||
<pre><code class="language-sh">sudo apt install matrix-synapse
|
||
</code></pre>
|
||
<p>The downstream Debian <code>matrix-synapse</code> package is not available for <code>trixie</code> (13) and older. Consider using the Matrix.org packages (above).</p>
|
||
<h5 id="downstream-ubuntu-packages"><a class="header" href="#downstream-ubuntu-packages">Downstream Ubuntu packages</a></h5>
|
||
<p>We do not recommend using the packages in the default Ubuntu repository
|
||
at this time, as they are <a href="https://bugs.launchpad.net/ubuntu/+source/matrix-synapse/+bug/1848709">old and suffer from known security vulnerabilities</a>.
|
||
The latest version of Synapse can be installed from <a href="#matrixorg-packages">our repository</a>.</p>
|
||
<h4 id="fedora"><a class="header" href="#fedora">Fedora</a></h4>
|
||
<p>Synapse is in the Fedora repositories as
|
||
<a href="https://src.fedoraproject.org/rpms/matrix-synapse"><code>matrix-synapse</code></a>:</p>
|
||
<pre><code class="language-sh">sudo dnf install matrix-synapse
|
||
</code></pre>
|
||
<p>Additionally, Oleg Girko provides Fedora RPMs at
|
||
<a href="https://obs.infoserver.lv/project/monitor/matrix-synapse">https://obs.infoserver.lv/project/monitor/matrix-synapse</a></p>
|
||
<h4 id="opensuse"><a class="header" href="#opensuse">OpenSUSE</a></h4>
|
||
<p>Synapse is in the OpenSUSE repositories as
|
||
<a href="https://software.opensuse.org/package/matrix-synapse"><code>matrix-synapse</code></a>:</p>
|
||
<pre><code class="language-sh">sudo zypper install matrix-synapse
|
||
</code></pre>
|
||
<h4 id="suse-linux-enterprise-server"><a class="header" href="#suse-linux-enterprise-server">SUSE Linux Enterprise Server</a></h4>
|
||
<p>Unofficial package are built for SLES 15 in the openSUSE:Backports:SLE-15 repository at
|
||
<a href="https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15/standard/">https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15/standard/</a></p>
|
||
<h4 id="archlinux"><a class="header" href="#archlinux">ArchLinux</a></h4>
|
||
<p>The quickest way to get up and running with ArchLinux is probably with the package provided by ArchLinux
|
||
<a href="https://archlinux.org/packages/extra/x86_64/matrix-synapse/">https://archlinux.org/packages/extra/x86_64/matrix-synapse/</a>, which should pull in most of
|
||
the necessary dependencies.</p>
|
||
<p>pip may be outdated (6.0.7-1 and needs to be upgraded to 6.0.8-1 ):</p>
|
||
<pre><code class="language-sh">sudo pip install --upgrade pip
|
||
</code></pre>
|
||
<p>If you encounter an error with lib bcrypt causing an Wrong ELF Class:
|
||
ELFCLASS32 (x64 Systems), you may need to reinstall py-bcrypt to correctly
|
||
compile it under the right architecture. (This should not be needed if
|
||
installing under virtualenv):</p>
|
||
<pre><code class="language-sh">sudo pip uninstall py-bcrypt
|
||
sudo pip install py-bcrypt
|
||
</code></pre>
|
||
<h4 id="alpine-linux"><a class="header" href="#alpine-linux">Alpine Linux</a></h4>
|
||
<p>Jahway603 maintains <a href="https://pkgs.alpinelinux.org/packages?name=synapse&branch=edge">Synapse packages for Alpine Linux</a> in the community repository. Install with:</p>
|
||
<pre><code class="language-sh">sudo apk add synapse
|
||
</code></pre>
|
||
<h4 id="void-linux"><a class="header" href="#void-linux">Void Linux</a></h4>
|
||
<p>Synapse can be found in the void repositories as
|
||
<a href="https://github.com/void-linux/void-packages/tree/master/srcpkgs/synapse">‘synapse’</a>:</p>
|
||
<pre><code class="language-sh">xbps-install -Su
|
||
xbps-install -S synapse
|
||
</code></pre>
|
||
<h4 id="freebsd"><a class="header" href="#freebsd">FreeBSD</a></h4>
|
||
<p>Synapse can be installed via FreeBSD Ports or Packages contributed by Brendan Molloy from:</p>
|
||
<ul>
|
||
<li>Ports: <code>cd /usr/ports/net-im/py-matrix-synapse && make install clean</code></li>
|
||
<li>Packages: <code>pkg install py38-matrix-synapse</code></li>
|
||
</ul>
|
||
<h4 id="openbsd"><a class="header" href="#openbsd">OpenBSD</a></h4>
|
||
<p>As of OpenBSD 6.7 Synapse is available as a pre-compiled binary. The filesystem
|
||
underlying the homeserver directory (defaults to <code>/var/synapse</code>) has to be
|
||
mounted with <code>wxallowed</code> (cf. <code>mount(8)</code>), so creating a separate filesystem
|
||
and mounting it to <code>/var/synapse</code> should be taken into consideration.</p>
|
||
<p>Installing Synapse:</p>
|
||
<pre><code class="language-sh">doas pkg_add synapse
|
||
</code></pre>
|
||
<h4 id="nixos"><a class="header" href="#nixos">NixOS</a></h4>
|
||
<p>Robin Lambertz has packaged Synapse for NixOS at:
|
||
<a href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/matrix/synapse.nix">https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/matrix/synapse.nix</a></p>
|
||
<h3 id="installing-as-a-python-module-from-pypi"><a class="header" href="#installing-as-a-python-module-from-pypi">Installing as a Python module from PyPI</a></h3>
|
||
<p>It’s also possible to install Synapse as a Python module from PyPI.</p>
|
||
<p>When following this route please make sure that the <a href="#platform-specific-prerequisites">Platform-specific prerequisites</a> are already installed.</p>
|
||
<p>System requirements:</p>
|
||
<ul>
|
||
<li>POSIX-compliant system (tested on Linux & OS X)</li>
|
||
<li>Python 3.10 or later, up to Python 3.13.</li>
|
||
<li>At least 1GB of free RAM if you want to join large public rooms like #matrix:matrix.org</li>
|
||
</ul>
|
||
<p>If building on an uncommon architecture for which pre-built wheels are
|
||
unavailable, you will need to have a recent Rust compiler installed. The easiest
|
||
way of installing the latest version is to use <a href="https://rustup.rs/">rustup</a>.</p>
|
||
<p>To install the Synapse homeserver run:</p>
|
||
<pre><code class="language-sh">mkdir -p ~/synapse
|
||
virtualenv -p python3 ~/synapse/env
|
||
source ~/synapse/env/bin/activate
|
||
pip install --upgrade pip
|
||
pip install --upgrade setuptools
|
||
pip install matrix-synapse
|
||
</code></pre>
|
||
<p>If you want to use a logging configuration that references
|
||
<code>systemd.journal.JournalHandler</code> (for example <code>contrib/systemd/log_config.yaml</code>),
|
||
you must install <code>systemd-python</code> separately in the same environment.
|
||
Synapse no longer provides a <code>matrix-synapse[systemd]</code> extra.</p>
|
||
<p>This will download Synapse from <a href="https://pypi.org/project/matrix-synapse">PyPI</a>
|
||
and install it, along with the python libraries it uses, into a virtual environment
|
||
under <code>~/synapse/env</code>. Feel free to pick a different directory if you
|
||
prefer.</p>
|
||
<p>This Synapse installation can then be later upgraded by using pip again with the
|
||
update flag:</p>
|
||
<pre><code class="language-sh">source ~/synapse/env/bin/activate
|
||
pip install -U matrix-synapse
|
||
</code></pre>
|
||
<p>Before you can start Synapse, you will need to generate a configuration
|
||
file. To do this, run (in your virtualenv, as before):</p>
|
||
<pre><code class="language-sh">cd ~/synapse
|
||
python -m synapse.app.homeserver \
|
||
--server-name my.domain.name \
|
||
--config-path homeserver.yaml \
|
||
--generate-config \
|
||
--report-stats=[yes|no]
|
||
</code></pre>
|
||
<p>… substituting an appropriate value for <code>--server-name</code> and choosing whether
|
||
or not to report usage statistics (hostname, Synapse version, uptime, total
|
||
users, etc.) to the developers via the <code>--report-stats</code> argument.</p>
|
||
<p>This command will generate you a config file that you can then customise, but it will
|
||
also generate a set of keys for you. These keys will allow your homeserver to
|
||
identify itself to other homeservers, so don’t lose or delete them. It would be
|
||
wise to back them up somewhere safe. (If, for whatever reason, you do need to
|
||
change your homeserver’s keys, you may find that other homeservers have the
|
||
old key cached. If you update the signing key, you should change the name of the
|
||
key in the <code><server name>.signing.key</code> file (the second word) to something
|
||
different. See the <a href="https://matrix.org/docs/spec/server_server/latest.html#retrieving-server-keys">spec</a> for more information on key management).</p>
|
||
<p>To actually run your new homeserver, pick a working directory for Synapse to
|
||
run (e.g. <code>~/synapse</code>), and:</p>
|
||
<pre><code class="language-sh">cd ~/synapse
|
||
source env/bin/activate
|
||
synctl start
|
||
</code></pre>
|
||
<h4 id="platform-specific-prerequisites"><a class="header" href="#platform-specific-prerequisites">Platform-specific prerequisites</a></h4>
|
||
<p>Synapse is written in Python but some of the libraries it uses are written in
|
||
C. So before we can install Synapse itself we need a working C compiler and the
|
||
header files for Python C extensions.</p>
|
||
<h5 id="debianubunturaspbian"><a class="header" href="#debianubunturaspbian">Debian/Ubuntu/Raspbian</a></h5>
|
||
<p>Installing prerequisites on Ubuntu or Debian:</p>
|
||
<pre><code class="language-sh">sudo apt install build-essential python3-dev libffi-dev \
|
||
python3-pip python3-setuptools sqlite3 \
|
||
libssl-dev virtualenv libjpeg-dev libxslt1-dev
|
||
</code></pre>
|
||
<h5 id="archlinux-1"><a class="header" href="#archlinux-1">ArchLinux</a></h5>
|
||
<p>Installing prerequisites on ArchLinux:</p>
|
||
<pre><code class="language-sh">sudo pacman -S base-devel python python-pip \
|
||
python-setuptools python-virtualenv sqlite3
|
||
</code></pre>
|
||
<h5 id="centosfedora"><a class="header" href="#centosfedora">CentOS/Fedora</a></h5>
|
||
<p>Installing prerequisites on CentOS or Fedora Linux:</p>
|
||
<pre><code class="language-sh">sudo dnf install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
|
||
libwebp-devel libxml2-devel libxslt-devel libpq-devel \
|
||
python3-virtualenv libffi-devel openssl-devel python3-devel
|
||
sudo dnf group install "Development Tools"
|
||
</code></pre>
|
||
<h5 id="red-hat-enterprise-linux--rocky-linux--oracle-linux"><a class="header" href="#red-hat-enterprise-linux--rocky-linux--oracle-linux">Red Hat Enterprise Linux / Rocky Linux / Oracle Linux</a></h5>
|
||
<p><em>Note: The term “RHEL” below refers to Red Hat Enterprise Linux, Oracle Linux and Rocky Linux.
|
||
The distributions are 1:1 binary compatible.</em></p>
|
||
<p>It’s recommended to use the latest Python versions.</p>
|
||
<p>RHEL 8 & 9 in particular ship with Python 3.6 & 3.9 respectively by default
|
||
which are EOL and therefore no longer supported by Synapse.
|
||
However, newer Python versions provide significant performance improvements
|
||
and they’re available in official distributions’ repositories.
|
||
Therefore it’s recommended to use them.</p>
|
||
<p>Python 3.11 and 3.12 are available for both RHEL 8 and 9.</p>
|
||
<p>These commands should be run as root user.</p>
|
||
<p>Install new version of Python. You only need one of these:</p>
|
||
<pre><code class="language-bash"># Python 3.11
|
||
dnf install python3.11 python3.11-devel
|
||
</code></pre>
|
||
<pre><code class="language-bash"># Python 3.12
|
||
dnf install python3.12 python3.12-devel
|
||
</code></pre>
|
||
<p>Finally, install common prerequisites</p>
|
||
<pre><code class="language-bash">dnf install libpq5 libpq5-devel lz4 pkgconf
|
||
dnf group install "Development Tools"
|
||
</code></pre>
|
||
<h6 id="using-venv-module-instead-of-virtualenv-command"><a class="header" href="#using-venv-module-instead-of-virtualenv-command">Using venv module instead of virtualenv command</a></h6>
|
||
<p>It’s recommended to use Python venv module directly rather than the virtualenv command.</p>
|
||
<ul>
|
||
<li>On RHEL 9, virtualenv is only available on <a href="https://docs.fedoraproject.org/en-US/epel/">EPEL</a>.</li>
|
||
<li>On RHEL 8, virtualenv is based on Python 3.6. It does not support creating 3.11/3.12 virtual environments.</li>
|
||
</ul>
|
||
<p>Here’s an example of creating Python 3.12 virtual environment and installing Synapse from PyPI.</p>
|
||
<pre><code class="language-bash">mkdir -p ~/synapse
|
||
# To use Python 3.11, simply use the command "python3.11" instead.
|
||
python3.12 -m venv ~/synapse/env
|
||
source ~/synapse/env/bin/activate
|
||
pip install --upgrade pip
|
||
pip install --upgrade setuptools
|
||
pip install matrix-synapse
|
||
</code></pre>
|
||
<h5 id="macos"><a class="header" href="#macos">macOS</a></h5>
|
||
<p>Installing prerequisites on macOS:</p>
|
||
<p>You may need to install the latest Xcode developer tools:</p>
|
||
<pre><code class="language-sh">xcode-select --install
|
||
</code></pre>
|
||
<p>Some extra dependencies may be needed. You can use Homebrew (https://brew.sh) for them.</p>
|
||
<p>On ARM-based Macs you may also need to install libjpeg and libpq:</p>
|
||
<pre><code class="language-sh"> brew install jpeg libpq
|
||
</code></pre>
|
||
<p>On macOS Catalina (10.15) you may need to explicitly install OpenSSL
|
||
via brew and inform <code>pip</code> about it so that <code>psycopg2</code> builds:</p>
|
||
<pre><code class="language-sh">brew install openssl@1.1
|
||
export LDFLAGS="-L/usr/local/opt/openssl/lib"
|
||
export CPPFLAGS="-I/usr/local/opt/openssl/include"
|
||
</code></pre>
|
||
<h5 id="opensuse-1"><a class="header" href="#opensuse-1">OpenSUSE</a></h5>
|
||
<p>Installing prerequisites on openSUSE:</p>
|
||
<pre><code class="language-sh">sudo zypper in -t pattern devel_basis
|
||
sudo zypper in python-pip python-setuptools sqlite3 python-virtualenv \
|
||
python-devel libffi-devel libopenssl-devel libjpeg62-devel
|
||
</code></pre>
|
||
<h5 id="openbsd-1"><a class="header" href="#openbsd-1">OpenBSD</a></h5>
|
||
<p>A port of Synapse is available under <code>net/synapse</code>. The filesystem
|
||
underlying the homeserver directory (defaults to <code>/var/synapse</code>) has to be
|
||
mounted with <code>wxallowed</code> (cf. <code>mount(8)</code>), so creating a separate filesystem
|
||
and mounting it to <code>/var/synapse</code> should be taken into consideration.</p>
|
||
<p>To be able to build Synapse’s dependency on python the <code>WRKOBJDIR</code>
|
||
(cf. <code>bsd.port.mk(5)</code>) for building python, too, needs to be on a filesystem
|
||
mounted with <code>wxallowed</code> (cf. <code>mount(8)</code>).</p>
|
||
<p>Creating a <code>WRKOBJDIR</code> for building python under <code>/usr/local</code> (which on a
|
||
default OpenBSD installation is mounted with <code>wxallowed</code>):</p>
|
||
<pre><code class="language-sh">doas mkdir /usr/local/pobj_wxallowed
|
||
</code></pre>
|
||
<p>Assuming <code>PORTS_PRIVSEP=Yes</code> (cf. <code>bsd.port.mk(5)</code>) and <code>SUDO=doas</code> are
|
||
configured in <code>/etc/mk.conf</code>:</p>
|
||
<pre><code class="language-sh">doas chown _pbuild:_pbuild /usr/local/pobj_wxallowed
|
||
</code></pre>
|
||
<p>Setting the <code>WRKOBJDIR</code> for building python:</p>
|
||
<pre><code class="language-sh">echo WRKOBJDIR_lang/python/3.7=/usr/local/pobj_wxallowed \\nWRKOBJDIR_lang/python/2.7=/usr/local/pobj_wxallowed >> /etc/mk.conf
|
||
</code></pre>
|
||
<p>Building Synapse:</p>
|
||
<pre><code class="language-sh">cd /usr/ports/net/synapse
|
||
make install
|
||
</code></pre>
|
||
<h5 id="windows"><a class="header" href="#windows">Windows</a></h5>
|
||
<p>Running Synapse natively on Windows is not officially supported.</p>
|
||
<p>If you wish to run or develop Synapse on Windows, the Windows Subsystem for
|
||
Linux provides a Linux environment which is capable of using the Debian, Fedora,
|
||
or source installation methods. More information about WSL can be found at
|
||
<a href="https://docs.microsoft.com/en-us/windows/wsl/install">https://docs.microsoft.com/en-us/windows/wsl/install</a> for Windows 10/11 and
|
||
<a href="https://docs.microsoft.com/en-us/windows/wsl/install-on-server">https://docs.microsoft.com/en-us/windows/wsl/install-on-server</a> for
|
||
Windows Server.</p>
|
||
<h2 id="setting-up-synapse"><a class="header" href="#setting-up-synapse">Setting up Synapse</a></h2>
|
||
<p>Once you have installed synapse as above, you will need to configure it.</p>
|
||
<h3 id="using-postgresql"><a class="header" href="#using-postgresql">Using PostgreSQL</a></h3>
|
||
<p>By default Synapse uses an <a href="https://sqlite.org/">SQLite</a> database and in doing so trades
|
||
performance for convenience. Almost all installations should opt to use <a href="https://www.postgresql.org">PostgreSQL</a>
|
||
instead. Advantages include:</p>
|
||
<ul>
|
||
<li>significant performance improvements due to the superior threading and
|
||
caching model, smarter query optimiser</li>
|
||
<li>allowing the DB to be run on separate hardware</li>
|
||
</ul>
|
||
<p>For information on how to install and use PostgreSQL in Synapse, please see
|
||
<a href="../postgres.html">Using Postgres</a></p>
|
||
<p>SQLite is only acceptable for testing purposes. SQLite should not be used in
|
||
a production server. Synapse will perform poorly when using
|
||
SQLite, especially when participating in large rooms.</p>
|
||
<h3 id="tls-certificates"><a class="header" href="#tls-certificates">TLS certificates</a></h3>
|
||
<p>The default configuration exposes a single HTTP port on the local
|
||
interface: <code>http://localhost:8008</code>. It is suitable for local testing,
|
||
but for any practical use, you will need Synapse’s APIs to be served
|
||
over HTTPS.</p>
|
||
<p>The recommended way to do so is to set up a reverse proxy on port
|
||
<code>8448</code>. You can find documentation on doing so in
|
||
<a href="../reverse_proxy.html">the reverse proxy documentation</a>.</p>
|
||
<p>Alternatively, you can configure Synapse to expose an HTTPS port. To do
|
||
so, you will need to edit <code>homeserver.yaml</code>, as follows:</p>
|
||
<ul>
|
||
<li>First, under the <code>listeners</code> option, add the configuration for the
|
||
TLS-enabled listener like so:</li>
|
||
</ul>
|
||
<pre><code class="language-yaml">listeners:
|
||
- port: 8448
|
||
type: http
|
||
tls: true
|
||
resources:
|
||
- names: [client, federation]
|
||
</code></pre>
|
||
<ul>
|
||
<li>
|
||
<p>You will also need to add the options <code>tls_certificate_path</code> and
|
||
<code>tls_private_key_path</code>. to your configuration file. You will need to manage provisioning of
|
||
these certificates yourself.</p>
|
||
</li>
|
||
<li>
|
||
<p>You can find more information about these options as well as how to configure synapse in the
|
||
<a href="../usage/configuration/config_documentation.html">configuration manual</a>.</p>
|
||
<p>If you are using your own certificate, be sure to use a <code>.pem</code> file that
|
||
includes the full certificate chain including any intermediate certificates
|
||
(for instance, if using certbot, use <code>fullchain.pem</code> as your certificate, not
|
||
<code>cert.pem</code>).</p>
|
||
</li>
|
||
</ul>
|
||
<p>For a more detailed guide to configuring your server for federation, see
|
||
<a href="../federate.html">Federation</a>.</p>
|
||
<h3 id="client-well-known-uri"><a class="header" href="#client-well-known-uri">Client Well-Known URI</a></h3>
|
||
<p>Setting up the client Well-Known URI is optional but if you set it up, it will
|
||
allow users to enter their full username (e.g. <code>@user:<server_name></code>) into clients
|
||
which support well-known lookup to automatically configure the homeserver and
|
||
identity server URLs. This is useful so that users don’t have to memorize or think
|
||
about the actual homeserver URL you are using.</p>
|
||
<p>The URL <code>https://<server_name>/.well-known/matrix/client</code> should return JSON in
|
||
the following format.</p>
|
||
<pre><code class="language-json">{
|
||
"m.homeserver": {
|
||
"base_url": "https://<matrix.example.com>"
|
||
}
|
||
}
|
||
</code></pre>
|
||
<p>It can optionally contain identity server information as well.</p>
|
||
<pre><code class="language-json">{
|
||
"m.homeserver": {
|
||
"base_url": "https://<matrix.example.com>"
|
||
},
|
||
"m.identity_server": {
|
||
"base_url": "https://<identity.example.com>"
|
||
}
|
||
}
|
||
</code></pre>
|
||
<p>To work in browser based clients, the file must be served with the appropriate
|
||
Cross-Origin Resource Sharing (CORS) headers. A recommended value would be
|
||
<code>Access-Control-Allow-Origin: *</code> which would allow all browser based clients to
|
||
view it.</p>
|
||
<p>In nginx this would be something like:</p>
|
||
<pre><code class="language-nginx">location /.well-known/matrix/client {
|
||
return 200 '{"m.homeserver": {"base_url": "https://<matrix.example.com>"}}';
|
||
default_type application/json;
|
||
add_header Access-Control-Allow-Origin *;
|
||
}
|
||
</code></pre>
|
||
<p>You should also ensure the <code>public_baseurl</code> option in <code>homeserver.yaml</code> is set
|
||
correctly. <code>public_baseurl</code> should be set to the URL that clients will use to
|
||
connect to your server. This is the same URL you put for the <code>m.homeserver</code>
|
||
<code>base_url</code> above.</p>
|
||
<pre><code class="language-yaml">public_baseurl: "https://<matrix.example.com>"
|
||
</code></pre>
|
||
<h3 id="email"><a class="header" href="#email">Email</a></h3>
|
||
<p>It is desirable for Synapse to have the capability to send email. This allows
|
||
Synapse to send password reset emails, send verifications when an email address
|
||
is added to a user’s account, and send email notifications to users when they
|
||
receive new messages.</p>
|
||
<p>To configure an SMTP server for Synapse, modify the configuration section
|
||
headed <code>email</code>, and be sure to have at least the <code>smtp_host</code>, <code>smtp_port</code>
|
||
and <code>notif_from</code> fields filled out. You may also need to set <code>smtp_user</code>,
|
||
<code>smtp_pass</code>, and <code>require_transport_security</code>.</p>
|
||
<p>If email is not configured, password reset, registration and notifications via
|
||
email will be disabled.</p>
|
||
<h3 id="registering-a-user"><a class="header" href="#registering-a-user">Registering a user</a></h3>
|
||
<p>One way to create a new user is to do so from a client like
|
||
<a href="https://element.io/">Element</a>. This requires registration to be enabled via
|
||
the
|
||
<a href="../usage/configuration/config_documentation.html#enable_registration"><code>enable_registration</code></a>
|
||
setting.</p>
|
||
<p>Alternatively, you can create new users from the command line. This can be done as follows:</p>
|
||
<ol>
|
||
<li>If synapse was installed via pip, activate the virtualenv as follows (if Synapse was
|
||
installed via a prebuilt package, <code>register_new_matrix_user</code> should already be
|
||
on the search path):
|
||
<pre><code class="language-sh">cd ~/synapse
|
||
source env/bin/activate
|
||
synctl start # if not already running
|
||
</code></pre>
|
||
</li>
|
||
<li>Run the following command:
|
||
<pre><code class="language-sh">register_new_matrix_user -c homeserver.yaml
|
||
</code></pre>
|
||
</li>
|
||
</ol>
|
||
<p>This will prompt you to add details for the new user, and will then connect to
|
||
the running Synapse to create the new user. For example:</p>
|
||
<pre><code>New user localpart: erikj
|
||
Password:
|
||
Confirm password:
|
||
Make admin [no]:
|
||
Success!
|
||
</code></pre>
|
||
<p>This process uses a setting
|
||
<a href="../usage/configuration/config_documentation.html#registration_shared_secret"><code>registration_shared_secret</code></a>,
|
||
which is shared between Synapse itself and the <code>register_new_matrix_user</code>
|
||
script. It doesn’t matter what it is (a random value is generated by
|
||
<code>--generate-config</code>), but it should be kept secret, as anyone with knowledge of
|
||
it can register users, including admin accounts, on your server even if
|
||
<code>enable_registration</code> is <code>false</code>.</p>
|
||
<h3 id="setting-up-a-turn-server"><a class="header" href="#setting-up-a-turn-server">Setting up a TURN server</a></h3>
|
||
<p>For reliable VoIP calls to be routed via this homeserver, you MUST configure
|
||
a TURN server. See <a href="../turn-howto.html">TURN setup</a> for details.</p>
|
||
<h3 id="url-previews"><a class="header" href="#url-previews">URL previews</a></h3>
|
||
<p>Synapse includes support for previewing URLs, which is disabled by default. To
|
||
turn it on you must enable the <code>url_preview_enabled: True</code> config parameter
|
||
and explicitly specify the IP ranges that Synapse is not allowed to spider for
|
||
previewing in the <code>url_preview_ip_range_blacklist</code> configuration parameter.
|
||
This is critical from a security perspective to stop arbitrary Matrix users
|
||
spidering ‘internal’ URLs on your network. At the very least we recommend that
|
||
your loopback and RFC1918 IP addresses are blacklisted.</p>
|
||
<p>This also requires the optional <code>lxml</code> python dependency to be installed. This
|
||
in turn requires the <code>libxml2</code> library to be available - on Debian/Ubuntu this
|
||
means <code>apt-get install libxml2-dev</code>, or equivalent for your OS.</p>
|
||
<h3 id="backups"><a class="header" href="#backups">Backups</a></h3>
|
||
<p>Don’t forget to take <a href="../usage/administration/backups.html">backups</a> of your new server!</p>
|
||
<h3 id="troubleshooting-installation"><a class="header" href="#troubleshooting-installation">Troubleshooting Installation</a></h3>
|
||
<p><code>pip</code> seems to leak <em>lots</em> of memory during installation. For instance, a Linux
|
||
host with 512MB of RAM may run out of memory whilst installing Twisted. If this
|
||
happens, you will have to individually install the dependencies which are
|
||
failing, e.g.:</p>
|
||
<pre><code class="language-sh">pip install twisted
|
||
</code></pre>
|
||
<p>If you have any other problems, feel free to ask in
|
||
<a href="https://matrix.to/#/#synapse:matrix.org">#synapse:matrix.org</a>.</p>
|
||
|
||
</main>
|
||
|
||
<nav class="nav-wrapper" aria-label="Page navigation">
|
||
<!-- Mobile navigation buttons -->
|
||
<a rel="prev" href="../welcome_and_overview.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg></span>
|
||
</a>
|
||
|
||
<a rel="next prefetch" href="../setup/security.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg></span>
|
||
</a>
|
||
|
||
<div style="clear: both"></div>
|
||
</nav>
|
||
</div>
|
||
</div>
|
||
|
||
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
||
<a rel="prev" href="../welcome_and_overview.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg></span>
|
||
</a>
|
||
|
||
<a rel="next prefetch" href="../setup/security.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg></span>
|
||
</a>
|
||
</nav>
|
||
|
||
</div>
|
||
|
||
<template id=fa-eye><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM432 256c0 79.5-64.5 144-144 144s-144-64.5-144-144s64.5-144 144-144s144 64.5 144 144zM288 192c0 35.3-28.7 64-64 64c-11.5 0-22.3-3-31.6-8.4c-.2 2.8-.4 5.5-.4 8.4c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6z"/></svg></span></template>
|
||
<template id=fa-eye-slash><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c5.2-11.8 8-24.8 8-38.5c0-53-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zm223.1 298L373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5z"/></svg></span></template>
|
||
<template id=fa-copy><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"/></svg></span></template>
|
||
<template id=fa-play><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"/></svg></span></template>
|
||
<template id=fa-clock-rotate-left><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M75 75L41 41C25.9 25.9 0 36.6 0 57.9V168c0 13.3 10.7 24 24 24H134.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24V256c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65V152c0-13.3-10.7-24-24-24z"/></svg></span></template>
|
||
|
||
|
||
|
||
<script>
|
||
window.playground_copyable = true;
|
||
</script>
|
||
|
||
|
||
<script src="../elasticlunr-ef4e11c1.min.js"></script>
|
||
<script src="../mark-09e88c2c.min.js"></script>
|
||
<script src="../searcher-c2a407aa.js"></script>
|
||
|
||
<script src="../clipboard-1626706a.min.js"></script>
|
||
<script src="../highlight-abc7f01d.js"></script>
|
||
<script src="../book-a0b12cfe.js"></script>
|
||
|
||
<!-- Custom JS scripts -->
|
||
<script src="../docs/website_files/version-picker-a1e40922.js"></script>
|
||
<script src="../docs/website_files/version-d2c738f4.js"></script>
|
||
|
||
|
||
|
||
</div>
|
||
</body>
|
||
</html>
|