2 minute read

Presentation

Etherpad is a highly customizable Open Source online editor providing collaborative editing in really real-time (source: etherpad.org).

Prerequisites

Etherpad is based on NodeJS. In addition, to store documents it requires a database system. Although MySQL can be used, MongoDB is preferred.

There are two main prerequisites:

Installation Procedure

Install the git package:

# yum install -y git

Create the etherpad user & group:

# useradd -r etherpad

Note: The -r option normally adds system user & group with uid/gid<1000 and doesn’t create any home directory.

Create the /opt/etherpad-lite directory:

# mkdir /opt/etherpad-lite
# chown etherpad:etherpad /opt/etherpad-lite

Become the etherpad user:

# su - etherpad

Get the Etherpad-lite code:

$ cd /opt
$ git clone https://github.com/ether/etherpad-lite.git

As we are using a MongoDB database, we need to install the NodeJS driver for MongoDB:

$ cd etherpad-lite
$ npm install mongodb

Configuration Procedure

Prepare the configuration:

$ cp -p settings.json.template settings.json

Edit the settings.json file, search for the following lines:

  "dbType" : "dirty",
  //the database specific settings
  "dbSettings" : {
                   "filename" : "var/dirty.db"
                 },

Replace the preceding lines with:

"dbType" : "mongodb",
"dbSettings" : {
                "user"    : "root",
                "password": "myPassword",
                "host"    : "localhost",
                "dbname"  : "mydb",
                "port"    : 27017
               },

Note: Use the same password as the one specified in the MongoDB installation tutorial.

As root, add a rule to the firewall:

# firewall-cmd --permanent --add-port=9001/tcp
# firewall-cmd --reload

Note: The Etherpad service listens on the 9001 tcp port by default.

Create the /etc/systemd/system/etherpad.service file and paste the following lines into:

[Unit]
Description=Etherpad-lite, the collaborative editor.
After=syslog.target network.target

[Service]
Environment=NODE_ENV=production
User=etherpad
Group=etherpad
WorkingDirectory=/opt/etherpad-lite
ExecStartPre=/opt/etherpad-lite/bin/installDeps.sh
ExecStart=/usr/bin/node /opt/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js
Restart=always

[Install]
WantedBy=multi-user.target

Note: The installDeps.sh script (ExecStartPre) should be run the first time. After you can choose to remove it.

Start and enable at boot the Etherpad service:

# systemctl start etherpad && systemctl enable etherpad

Advanced Configuration

Etherpad‘s got a plugin management system available through the /admin url and 9001 tcp port. Disabled by default, you need to edit the /opt/etherpad-lite/settings.json file and uncomment the following lines:

  "users": {
    "admin": {
      "password": "changeme1",
      "is_admin": true
    },
    "user": {
      "password": "changeme1",
      "is_admin": false
    }
  },

Note: Replace changeme1 with a new password.

Spellchecker Plugin

As an example of plugin, you can install the spellchecker plugin.

Type the http://NAME_OR_IP_ADDRESS/admin/plugins:9001 in your browser and select the spellchecker plugin. Now, if you want to enable the spellchecking by default add the following line in the /opt/etherpad-lite/settings.json file:

"ep_spellcheck": { "disabledByDefault" : false },

Change the language accordingly:

"lang": "en-gb"

There are many other available plugins.

Additional Resources

This tutorial was inspired by the Etherpad-lite official website. The RoseHosting website provides a tutorial to install Etherpad on CentOS 7 with MariaDB & Nginx.

Leave a comment