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

lua-readline

Recommended

Used for
History and editing capabilities in the console
Prosody version
trunk

LuaRocks

Recommended

Used for
Plugin installer
Prosody version
trunk

Enables installation of plugins using prosodyctl.

luaunbound

Recommended

Used for
Secure asynchronous DNS lookups
Required version
0.5+
Prosody version
trunk

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 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.

LuaDBI

Optional

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

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 on Lua 5.1

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

LuaLDAP

https://github.com/lualdap/lualdap

Used for
LDAP authentication

Required

LuaSocket

Required

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

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

 sudo apt install lua-socket

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

LuaSec

Required

Used for
SSL/TLS support
Required version
0.7+

Debian and Ubuntu users can easily install LuaSec with apt, simply run:

sudo apt install lua-sec

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.

LuaExpat

Required

https://matthewwild.co.uk/projects/luaexpat/

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, simply run:

 sudo apt install lua-expat

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

‘luaexpat’ on luarocks now points to fork without certain features Prosody needs, see issue #1375.

⚠️ 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 install lua-filesystem