Raspberry Pi becomes a XMPP/Jabber with Ejabberd Server

Warning : This article has been automatically translated by Google Translate

If you want to communicate with your friends, your family or create a server for an association or a company, Once again the Raspberry Pi will be able to help you. You can install Ejabberd, a XMPP/Jabber server.

ejabberd_logoIn this article, I will recompile Ejabberd to have the latest version.

  • Update the system
    apt-get update && apt-get -y upgrade
  • Install GIT
    apt-get install -y git
  • Download the sources of Ejabberd
    git clone https://github.com/processone/ejabberd.git ejabberd cd
  • Install packages needed for the compilation of Ejabberd
    apt - get install –y make make gcc libexpat1 libyaml-0-2 erlang libssl-dev zlib1g-dev imagemagick libexpat1-dev
  • Start the compilation
    ./configure make
  • Installer Ejabberd
    make install
  • Edit the configuration file /etc/ejabberd/ejabberd.cfg. At least change the language of the server by replacing en by FR in the following line :
    {language, "FR"}

    Also change the domain name of your server. This is what you will put behind the @ in your entries. If you put a domain make sure it is easily accessible. Here I put my server IP :

    %%{hosts, ["localhost"]}.
    {hosts, ["192.168.1.25"]}.

    You must also set up the machines that will have the right to ask creations of accounts on your server. In my example, I authorize all machines in my local network and crashes all the others :

    {ip_access, [{allow, "192.168.1.0/8"},
     {deny, "0.0.0.0/0"}]},

    The options are really numerous and the file is fairly well commented. So do tests !

  • By default, Ejabberd uses its own internal database. If you want a tpe MySQL database, PostgreSQL or even via ODBC, It is always in the file /etc/ejabberd/ejabberd.cfg.
  • If you are now looking for a client, you have a complete list here. Under Mac OS, I chose Adium. I chose to create an XMPP account :
    Capture_d_écran_04_10_13_21_34In the next window, you select the server. Home I put the IP directly, fast and efficient :
    Capture_d_écran_04_10_13_21_23And here you are with your account !
    notificationYou are now connected :
    Contacts_et_Modifier_l’article_‹_Raspberry_Pi_Home_Server_—_WordPress
  • The goal is to talk. So I went by an iPad to create me a friend. Yes I know, It is heartbreaking as social life ! 🙂 Problème, Monal does not create an account if it does not exist (or I have not found). So I went on the server to manually create my account :
    ejabberdctl register ipad 192.168.1.25 ipad

    I therefore find myself with an account iPad@192.168.1.25 with password ipad.
    IMG_0239Once configured and active you can add the first user to your contacts :
    IMG_0242At your first user (Chris here), you have an application for authorization to accept our iPad friend :
    Autorisation__et_1._sshVmade OU then demand in the other direction to add ipad to the list of contacts of chris :
    IMG_0243.PNGAnd here's the result in chris :
    Contacts

  • You can now exchange messages :
    xmpp-jabber-raspberrypi

So now you can create a private server where only access to the server can create users, You can play on the configuration for the SSL in your exchanges, etc.

Like this article ? Bear with me on patreon!

You may also like...