How to Install Synapse on macOS

In this tutorial, we will guide you through the process of installing Synapse, which is a popular home server for the Matrix protocol, on your macOS-based computer.

Before we begin, please ensure that your system meets the following requirements:

With these prerequisites in place, you can proceed with these steps:

  1. Open Terminal:
  1. Install Homebrew:

Homebrew is a package manager that simplifies the process of installing software on macOS. You can install Homebrew by running the following command in Terminal:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

You may be prompted to enter your computer's administrative password to proceed.

  1. Install Python:

You will need Python 3.5 or newer to run Synapse. You can install Python via Homebrew by running the following command in Terminal:

$ brew install python
  1. Install PostgreSQL:

Synapse requires a backend database system to function. We recommend using PostgreSQL, which is a popular open-source relational database.

You can install PostgreSQL by running the following command in Terminal:

$ brew install postgresql
  1. Create a database user:

Once PostgreSQL is installed, you need to create a new user account for Synapse to use. You can do this by running the following commands in Terminal:

$ createuser synapse
$ createdb -O synapse synapse
  1. Install Synapse:

Now that you have all the necessary dependencies installed, you can proceed with installing Synapse itself. You can do this by cloning the Synapse git repository into a folder of your choice, and then performing the installation steps:

$ git clone https://github.com/matrix-org/synapse.git
$ cd synapse
$ python -m venv ../venv
$ source ../venv/bin/activate
$ pip3 install --upgrade pip
$ pip3 install -r requirements.txt
$ python3 -m synapse.app.homeserver
  1. Configure Synapse:

You should now have a Synapse home server running on your computer. However, you still need to configure it to suit your needs.

The configuration file for Synapse is located at homeserver.yaml, which is in the synapse folder you just cloned from the Git repository.

  1. Start Synapse:

Now that you have everything set up, you can start Synapse by running the following command in Terminal:

$ source ../venv/bin/activate
$ python3 -m synapse.app.homeserver

Congratulations! You have now installed and configured Synapse on your macOS-based computer. You can now use it to create a Matrix-based chat system for your personal or business needs.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!