Matrix is a decentralized communications service and open specification to federate chat rooms. This document will guide you through installing a Synapse homeserver on Ubuntu Bionic (18.04).
The following post is a wiki: please get acquainted with the recommendations before jumping in.