Self-hosting
We recommend using Prosody or Ejabberd for hosting your own XMPP server. But there are pre-configured options make it a bit easier to get started.
If you plan to allow others to use your XMPP server, please consider our Server Covenant and maybe have a look at our tutorial for running a (semi-)public service.
Homebrew Server club is also a nice place to learn more.