This post describes the configuration of an ejabberd XMPP server running on an Amazon AWS EC2 instance as a first step to building a cluster later on.
- Launch an EC2 instance in the desired configuration. In order to stay within my Free Tier, I chose the smallest available configuration using EBS and running Amazon’s custom Linux image.
- Configure the security groups for the newly created instance. We need to allow SSH-access as well as open the ports used by XMPP/ejabberd. In default configuration, ejabberd is using TCP ports 5266, 5280 and 5269.
- Connect to your instance using SSH.
- To download and run the ejabberd installer enter the following commands. You can find the URL to the latest ejabberd release on their commercial website http://www.process-one.net. Make sure to check whether your instance is running a 64- or 32-bit OS and choose the corresponding installer.
1234mkdir Downloadswget -O Downloads/ejabberd-13.12-linux-x86_64-installer.run http://www.process-one.net/downloads/downloads-action.php?file=/ejabberd/13.12/ejabberd-13.12-linux-x86_64-installer.runchmod +x Downloads/ejabberd-13.12-linux-x86_64-installer.runsudo Downloads/ejabberd-13.12-linux-x86_64-installer.run - Choose the language you prefer and read and accept the license agreement.
- Confirm the default directory /opt/ejabberd-13.12 .
- As ejabberd server domain, enter the public DNS of your instance e.g. ec2-###-###-###-###.eu-west-1.compute.amazonaws.com.
- Select whether this instance will become a node of a cluster. As building a cluster will be covered in another blog post I will not go into detail here and select no for this step.
- Finish the setup.
Now we can start the server and check if it’s running using sudo /opt/ejabberd-13.12/bin/ejabberdctl start and sudo /opt/ejabberd-13.12/bin/ejabberdctl status . This should give the following output:
1 2 |
The node 'ejabberd@ec2-###-###-###-###.eu-west-1.compute.amazonaws.com' is started with status: started ejabberd community is running in that node |
Use sudo /opt/ejabberd-13.12/bin/ejabberdctl register username host password to create new users.
Users can connect to the server using any XMPP compliant client now. Please note that I only tried a few popular clients like Pidgin on Linux and Windows and iChat on OSX. As your server doesn’t have a valid certificate, the client will most probably show a warning and requests the user to confirm a security exception. I noticed that Thunderbird Chat will deny any connection to a ejabberd server running in a default configuration like this due to improper security configurations.
To shut down the server again, use sudo /opt/ejabberd-13.12/bin/ejabberdctl stop .