1. Installing ejab­berd:
aptitude install ejabberd
  1. Configuration:
nano /etc/ejabberd/ejabberd.cfg
  1. Find and change the line:
{acl, admin, {user, "YOURNAME", "YOURDOMAIN"}}.
  1. Append a little below your domain:
{hosts, ["YOURDOMAIN"]}.
  1. Restart ejabberd:
ejabberdctl restart
  1. Register an account for yourself:
ejabberdctl register YOURNAME YOURDOMAIN YOURPASSWORD
  1. If the ejabberd is on a different server set SRV records:
jid.YOURDOMAIN.TLD. A IPSERVEREJABBERD
_xmpp-client._tcp.YOURDOMAIN.TLD. SRV 10 0 5222 jid.YOURDOMAIN.TLD.
_xmpp-server._tcp.YOURDOMAIN.TLD. SRV 10 0 5269 jid.YOURDOMAIN.TLD.