Install ejabberd on Windows 10 using Docker Desktop

Do you want to install ejabberd on your Windows 10 machine? Do you miss the binary installers for Windows? Don’t worry, you can install ejabberd on Windows 10 using Docker Desktop, and this tutorial guides you through the process.

ProcessOne
· 5 min read
Send by email

This tutorial requires Windows 10 or newer. For older systems like Windows 7 or 8, follow the tutorial on how to install ejabberd on Windows 7 using Docker Toolbox.

For some time now we have been phasing out the traditional installation wizards, customary to the end users on macOS and Windows, in favor of the more streamlined command line approach, well known on Linux desktops and servers.

First, we have phased out the macOS binary installer in favor of a quick brew install ejabberd command. Then, since ejabberd 20.07, we have phased out the Windows installer in favor of a container solution. However, setting ejabberd in Docker requires setting volumes, ports and some customizations, so we’ve written a batch script that performs all those tasks for you.

This tutorial explains how to get any ejabberd version installed on Microsoft Windows 10 using Docker Desktop and ejabberd-docker-install.bat script.

Docker Desktop is only available for Windows 10. If you use Windows 7 or 8, you can use Docker Toolbox, which is old and obsolete, but it still seems to work correctly, so give it a try. We published a tutorial explaining how to install ejabberd on Windows 7 using Docker Toolbox.

1. Install Docker Desktop

First of all, download and install Docker Desktop for Windows. The process is pretty straightforward, and it will ask you to restart your machine.

The installation wizard may ask you to install Microsoft’s WSL2 and restart the Docker Desktop app.

2. Download ejabberd-container-install.bat

Download ejabberd-container-install.bat to your machine.

3. Edit the install options

Edit this batch file with your favorite text editor and set, at the very least, the PASSWORD option you want for your new ejabberd administrator account.

Additionally, you can set some other options: INSTALL_DIR_WINDOWS10HOSTUSERVERSION, and PORTS.

4. Run the script

When you run the script, it will open a console window to inform you about the process: download the ejabberd image, create the container, register the admin account and prepare the configuration file…

If installation completes correctly, you can close that window and proceed to next step.

Run the script

If there was any error, solve it and run the script again. You can delete the script and download it again, or delete the ejabberd container, or delete the ejabberd installed directory… and run the script again.

5. Start ejabberd

Now you can finally go to Docker Desktop, where you can see the new ejabberd container, and click the “Start” icon:

Start ejabberd

Wait a few seconds till ejabberd is started in that container and accepting connections:

Running ejabberd

Next steps

At this point, you have ejabberd installed and running on your machine, and you may be asking yourself how to administrate it. Here are some remarks:

ejabberd.yml, database and logs

The configuration files, Mnesia internal database spool and logs directories are available for you to edit and inspect in Windows, in the path that you specified in the INSTALL_DIR_WINDOWS10 option.

There is also an ejabberd-modules directory, where you can later put additional modules from ejabberd-contrib, or any other place.

Whenever you update to a newer ejabberd, it is a good practice to backup the conf and database directories.

ejabberd.yml, database and logs

ejabberd WebAdmin

The “Open in browser” icon will open a browser with the ejabberd webadmin page.

Alternatively, you can open it yourself by going to http://localhost:5180 (swap localhost for the value of the HOST variable, if you changed it in the installation script).

You will be welcomed by a browser authentication prompt, where you should type in the login details defined in the installation script: USER@HOST and PASSWORD. You will then see the usual ejabberd webadmin console, where you can easily manage your server instance.

ejabberd WebAdmin

CLI with ejabberdctl

The next icon opens a console in the ejabberd container where you can use ejabberdctl, and that means you can use any ejabberd Administration API.

CLI with ejabberdctl

ejabberd-contrib

In addition to the modules already included in ejabberd releases, there are several more published in ejabberd-contrib, and many other on the internet, and you can even write your own modules.

To start with all this, open the CLI as explained previously, and execute:

bin/ejabberdctl modules_update_specs

For the next steps, check this ejabberd-contrib documentation.

Update from old binary installer

If you already have ejabberd installed using a binary installer downloaded from ProcessOne website:

  1. Stop ejabberd using the “Stop ejabberd” desktop shortcut as usual
  2. It is always a good practice to backup the conf and database directories
  3. Uninstall ejabberd
  4. Follow the steps described in this tutorial
  5. Check that ejabberd runs perfectly with the basic configuration and empty database

Now it’s time to get back your configuration and database:

  1. Stop ejabberd in the Docker Desktop
  2. Copy your old conf and database directories to the new location
  3. Start ejabberd and check if it runs correctly

Update to a new ejabberd version

When a new ejabberd version is released, go to ejabberd Docker Hub, and check if the new version is available in Tags.

How to install it?

  1. Delete your old ejabberd container
  2. Edit the VERSION option in ejabberd-docker-install.bat
  3. Run the script

It will download the new image and create a new container.

If something goes terribly wrong

As mentioned previously, if something goes terribly wrong, don’t worry! You can delete the script, or the installed directory, or the ejabberd container, and start from scratch.

Docker Desktop in macOS and Linux

Docker Desktop is also available for the macOS and Linux systems. While the above installation script is designed for Windows, it could be modified for these other platforms as well. This means you now have several methods of installing and running ejabberd on any given operating system: using a package manager (like apt on Debian or brew on macOS), using a Docker container, with a binary installer (on Linux) or building from source.

Questions, problems, suggestions

The batch script to use Docker and this tutorial may have problems or errors. So, please add a comment here, or join the ejabberd chatroom, or send an email to the ejabberd mailing list or fill a bug/suggestion in the ejabberd tracker or docker-ejabberd trackers.

Photo by Frank Mckenna on Unsplash