Installing Pony Mail on CentOS 7.1:

This installation is a bit trickier, as CentOS does not have Python 3 or any of the lua modules in its default package system.

Start by installing the following CentOS packages:

  • httpd
  • git
  • lua
  • lua-devel
  • gcc
  • gcc-c++
  • kernel-dev
  • unzip
  • openssl
  • openssl-devel
  • readline-devel
yum install -y httpd git lua lua-devel gcc gcc-c++ kernel-devel unzip openssl openssl-devel readline-devel

Then, proceed to build LuaRocks (for lua deps):

tar zxvf luarocks-2.0.6.tar.gz                                             
cd luarocks-2.0.6                                                               
make install

Now build/install the required Lua modules:

luarocks install lua-socket
luarocks install luasec OPENSSL_LIBDIR=/usr/lib64/
luarocks install lua-cjson

Configure, compile and install Python 3:

yum groupinstall -y development
yum install -y zlib-dev sqlite-devel bzip2-devel xz-libs
xz -d Python-3.4.3.tar.xz
tar zvf Python-3.4.3.tar
cd Python-3.4.3/
make altinstall

Install the required Python 3 modules:

sudo pip3.4 install elasticsearch formatflowed chardet

Install ElasticSearch:

yum install -y java-1.7.0-openjdk-headless
rpm --import

    (The following is taken from the ElasticSearch online guide:)

    Add the following in your /etc/yum.repos.d/ directory in a file with a .repo suffix,
    for example elasticsearch.repo:
    name=Elasticsearch repository for 1.7.x packages

yum update
yum install elasticsearch

Configure and start up ElasticSearch:

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
/etc/init.d/elasticsearch start

Check out a copy of Pony Mail:

cd /var/www
git clone

Set up Pony Mail:

cd /var/www/ponymail/tools
[... answer questions asked by the setup script ...]

Set up Apache httpd by adding, for example, the following virtual host configuration: This differs from the normal installation (because of CentOS specifics), so beware

<VirtualHost *:80>
    LuaPackageCPath /usr/local/lib/lua/5.1/?.so
    LuaPackagePath  /usr/local/share/lua/5.1/?.lua
    DocumentRoot /var/www/ponymail/site
    AddHandler      lua-script .lua
    LuaScope        thread
    LuaCodeCache    stat
    AcceptPathInfo  On

(re)start apache:

apachectl restart

Once this is done, you should now have a working copy of Pony Mail!

You may wish to tweak the settings in site/js/config.js and your elasticsearch settings once Pony mail is up and running.

Refer to the General installation documentation for detailed information about archiving messages, OAuth, mail settings and much more.