Installing a module | Tarantool
Application server Installing a module

Installing a module

Modules in Lua and C that come from Tarantool developers and community contributors are available in the following locations:

  • Tarantool modules repository (see below)
  • Tarantool deb/rpm repositories (see below)

See README in tarantool/rocks repository for detailed instructions.

Follow these steps:

  1. Install Tarantool as recommended on the download page.

  2. Install the module you need. Look up the module’s name on Tarantool rocks page and put the prefix “tarantool-” before the module name to avoid ambiguity:

    $ # for Ubuntu/Debian:
    $ sudo apt-get install tarantool-<module-name>
    $ # for RHEL/CentOS/Amazon:
    $ sudo yum install tarantool-<module-name>

    For example, to install the module shard on Ubuntu, say:

    $ sudo apt-get install tarantool-shard

Once these steps are complete, you can:

  • load any module with

    tarantool> name = require('module-name')

    for example:

    tarantool> shard = require('shard')
  • search locally for installed modules using package.path (Lua) or package.cpath (C):

    tarantool> package.path
    - ./?.lua;./?/init.lua; /usr/local/share/tarantool/?.lua;/usr/local/share/
    tarantool> package.cpath
    - ./?.so;/usr/local/lib/x86_64-linux-gnu/tarantool/?.so;/usr/lib/x86_64-li


    Question-marks stand for the module name that was specified earlier when saying require('module-name').

Found what you were looking for?