Prosody Dependencies

Prosody depends on other applications or libraries to allow certain functionality.

This page describes the different runtime dependencies we have, what they are for, and how to get hold of them if you don’t have them.

Note: If you are trying to build Prosody from source then you will need additional dependencies, please see Installing from source for a short how-to.

Optional

LuaSec

Recommended

Used for
SSL/TLS support
Required version
0.3.3+ (0.4.1+ strongly recommended) (0.5 needed for some features)

LuaSec is technically an optional dependency, but is strongly recommended in order to ensure secure communications.

Check your Linux distribution for packages for LuaSec. Alternatively we have packages for:

Debian/Ubuntu Arch

On Mac OS X you can use Homebrew to install LuaSec:

 brew install http://prosody.im/files/homebrew/luasec.rb

You can also download the source from the LuaSec link above, it is not hard to build, and requires just liblua5.2 and libssl to compile. Have a look at the known to work Makefile configurations.

⚠️ The LuaSec 0.6 release does not work with Prosody 0.9.x, and has issues with Prosody 0.10. Stay on LuaSec 0.5 or use 0.7 or later.

LuaEvent

Optional

Used for
Efficiently scaling above hundreds of concurrent connections
Required version
luaevent 0.3.2+ (0.4.4+ recommended) with libevent 2.0+

LuaEvent is an optional dependency you should install if you intend your server to be handling large numbers of concurrent connections. Information on how to configure Prosody in this instance can be found here.

Users on Debian/Ubuntu with our Prosody package repository added can install luaevent or luaevent-prosody like so:

 sudo apt-get install lua-event

This will automatically install libevent if you don’t have it. It is not recommended to use libevent versions before 2.0.

Users on Mac OS X can use homebrew to install LuaEvent:

 brew install http://prosody.im/files/homebrew/luaevent.rb

Users on Arch Linux can find luaevent-prosody in AUR, more information can be found on the ArchWiki.

lua-zlib

Optional (Prosody 0.9 only)

Used for
Compressing XMPP streams when mod_compression is enabled
Required version
brimworks version 0

This module is used only by mod_compression. It is important to note that there are currently two zlib libraries for Lua. Prosody supports only the ‘brimworks’ module from github (as it presents an interface better suited to our use).

Debian/Ubuntu and derived GNU/Linux distributions

You can use the lua-zlib package from packages.prosody.im. If you have already configured our repository on your system then you can simply run:

 sudo apt-get install lua-zlib
Other

If you use another platform that doesn’t have packages for lua-zlib yet then you will need to compile from source, which can be found at http://github.com/brimworks/lua-zlib.

LuaDBI

Optional

Used for
SQL database support (SQLite3, MySQL, PostgreSQL)
Required version
0.5+

This module is used by mod_storage_sql for connecting to SQL databases.

It is recommended that SQLite3 be compiled with the SQLITE_ENABLE_UPDATE_DELETE_LIMIT option.

Debian/Ubuntu and derived GNU/Linux distributions

Simply install the package ‘lua-dbi-DATABASE’, where DATABASE is one of: mysql or postgresql or sqlite3

If the package isn’t found in your distribution, you may need to add our package repository to your system.

Source

If you use another platform that doesn’t have packages for LuaDBI yet then you will need to compile from source, which can be found at https://github.com/mwild1/luadbi/releases/latest.

BitOp

Recommended (0.10+)

Used for
Efficient bit-level manipulation.

Used by mod_websocket

There two alternative bit-op modules.

  • Lua 5.2 comes with bit32 built in.
  • bit32 for Lua 5.1 is available in LuaRocks and as lua-bit32 in Debian / Ubuntu
  • LuaJIT 2 comes with bit built in, which is available for Lua 5.1 as lua-bitop in Debian / Ubuntu.

struct

Used for
Converting numbers to and from their binary representation.

Used by mod_websocket. If not available, bitops will be used.

Unknown if packaged anywhere, available from http://www.inf.puc-rio.br/~roberto/struct/.

⚠️ There exist other Lua modules with the exact same name, some of which have an incompatible API which will not work with Prosody.

ICU

http://site.icu-project.org/

Used for
Unicode normalisation etc, alternative to libidn

Required by mod_mimicking

To use, enable in configure step like:

./configure --idn-library=icu

Required

LuaSocket

Required

Used for
Accepting and making network connections
Required version
3.x1

Debian and Ubuntu users can easily install LuaSocket with apt-get, simply run:

 sudo apt-get install lua-socket

BSD and users of other Linux distributions have reported success using luarocks to install the ‘luasocket’ rock.

LuaExpat

Required

Used for
Parsing XML/XMPP streams
Required version
1.2.x+, 1.3.x+ recommended

Debian and Ubuntu users can easily install LuaExpat with apt-get, simply run:

 sudo apt-get install lua-expat

BSD and users of other Linux distributions have reported success using luarocks to install the ‘luaexpat’ rock.

⚠️ Although Prosody works with versions of LuaExpat prior to 1.3, they leave Prosody open to denial-of-service (DoS) attacks. Prosody will warn if this is the case and it is strongly recommended you upgrade, or disable mod_compression (note: it is disabled by default). If you do not see the warning in your log file, you are not vulnerable (e.g. Debian stable has 1.2.0 but with patches to resolve the issue).

LuaFileSystem

Required

Used for
Managing Prosody’s data store and permissions
Required version
1.6.2 or higher, or Debian’s lua-filesystem package

LuaFileSystem is automatically installed by our packages, but if you find yourself without it for some reason it is easy to obtain. Debian/Ubuntu users can run the following command to install it:

 sudo apt-get install lua-filesystem

  1. Prosody 0.10.x needs LuaSocket 3.x while Prosody 0.9.x works with LuaSocket 2.x↩︎