How to Install Etherpad in Linux

To Install Etherpad for Linux

Etherpad is a free and Real Time Web Based Online Collaborative Document Editor. Installation process of Etherpad in Linux is explained in this article.

To Install Dependency packages

Download and install the required libraries by running the following command.

[root@linuxhelp Desktop]# yum install gzip git-core curl python openssl-devel & &  yum groupinstall " Development Tools"  For FreeBSD: portinstall node, npm, git -y
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
 * base: centos.excellmedia.net
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
.
.
.
Installed:
  bison.x86_64 0:2.7-4.el7                                                      
  byacc.x86_64 0:1.9.20130304-3.el7                                             
  cscope.x86_64 0:15.8-7.el7                                                    
  ctags.x86_64 0:5.8-13.el7                                                     
  diffstat.x86_64 0:1.57-4.el7                                                  
  doxygen.x86_64 1:1.8.5-3.el7                                                  
  flex.x86_64 0:2.5.37-3.el7                                                    
  gcc.x86_64 0:4.8.5-4.el7                                                      
  gcc-c++.x86_64 0:4.8.5-4.el7                                                  
  gcc-gfortran.x86_64 0:4.8.5-4.el7                                             
  indent.x86_64 0:2.2.11-13.el7                                                 
  intltool.noarch 0:0.50.2-6.el7                                                
  libtool.x86_64 0:2.4.2-21.el7_2                                               
  patch.x86_64 0:2.7.1-8.el7                                                    
  patchutils.x86_64 0:0.3.3-4.el7                                               
  rcs.x86_64 0:5.9.0-5.el7                                                      
  redhat-rpm-config.noarch 0:9.1.0-68.el7.centos                                
  rpm-build.x86_64 0:4.11.3-17.el7                                              
  rpm-sign.x86_64 0:4.11.3-17.el7                                               
  subversion.x86_64 0:1.7.14-10.el7                                             
  swig.x86_64 0:2.0.10-4.el7                                                    
  systemtap.x86_64 0:2.8-10.el7                                                 

Dependency Installed:
  cpp.x86_64 0:4.8.5-4.el7                                                      
  dwz.x86_64 0:0.11-3.el7                                                       
  gettext-common-devel.noarch 0:0.18.2.1-4.el7                                  
  gettext-devel.x86_64 0:0.18.2.1-4.el7                                         
  glibc-devel.x86_64 0:2.17-106.el7_2.6                                         
  glibc-headers.x86_64 0:2.17-106.el7_2.6                                       
  kernel-devel.x86_64 0:3.10.0-327.18.2.el7                                     
  kernel-headers.x86_64 0:3.10.0-327.18.2.el7                                   
  libgfortran.x86_64 0:4.8.5-4.el7                                              
  libmpc.x86_64 0:1.0.1-3.el7                                                   
  libquadmath.x86_64 0:4.8.5-4.el7                                              
  libquadmath-devel.x86_64 0:4.8.5-4.el7                                        
  libstdc++-devel.x86_64 0:4.8.5-4.el7                                          
  mokutil.x86_64 0:0.9-2.el7                                                    
  perl-XML-Parser.x86_64 0:2.41-10.el7                                          
  perl-srpm-macros.noarch 0:1-8.el7                                             
  subversion-libs.x86_64 0:1.7.14-10.el7                                        
  systemtap-client.x86_64 0:2.8-10.el7                                          
  systemtap-devel.x86_64 0:2.8-10.el7                                           

Complete!

Additionally, we need To Install Node.js package.

[root@linuxhelp Desktop]# yum install nodejs
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
.
.
.
Installed:
  nodejs.x86_64 0:0.10.42-4.el7                                                 

Dependency Installed:
  libuv.x86_64 1:0.10.34-2.el7                                                  

Complete!

Once the package is installed, verify the Node.js version using the following command.

[root@linuxhelp Desktop]# node --version
v0.10.42

To Download and Install Etherpad Lite

Create a separate user named " etherpad" to execute Etherpad application independently. So, first create a user with its home directory.

[root@linuxhelp Desktop]# useradd --create-home etherpad

In " etherpad" user, use GIT repository to download the latest version of Etherpad Lite.

[root@linuxhelp Desktop]# su - etherpad 
[etherpad@linuxhelp ~]$ cd /home/etherpad 
[etherpad@linuxhelp ~]$ git clone http://github.com/ether/etherpad-lite.git
Cloning into ' etherpad-lite' ...
remote: Counting objects: 28271, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 28271 (delta 16), reused 0 (delta 0), pack-reused 28241
Receiving objects: 100% (28271/28271), 19.31 MiB | 20.00 KiB/s, done.
Resolving deltas: 100% (20105/20105), done.

After downloaded the source files,go to the newly created directory having the cloned source code.

[etherpad@linuxhelp ~]$ cd etherpad-lite/bin/

Execute the run.sh script.

[etherpad@linuxhelp bin]$ ./run.sh 
Copy the settings template to settings.json...
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.
.
.
.
Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...
Started Etherpad...
[2016-06-17 15:21:54.980] [WARN] console - DirtyDB is used. This is fine for testing but not recommended for production.
[2016-06-17 15:22:00.559] [INFO] console - Installed plugins: 
[2016-06-17 15:22:00.614] [INFO] console - Report bugs at https://github.com/ether/etherpad-lite/issues
[2016-06-17 15:22:00.636] [INFO] console - Your Etherpad version is 1.6.0 (85cdb1c)
[2016-06-17 15:22:01.014] [INFO] console - You can access your Etherpad instance at http://0.0.0.0:9001/
[2016-06-17 15:22:01.014] [WARN] console - Admin username and password not set in settings.json.  To access admin please uncomment and edit ' users'  in settings.json

To Access and Create New Pad

Open the browser and navigate to http://< ip_address> :9001 or http://localhost:9001

Create a new document by giving a Pad name. Here, we have created a new document called " linuxhelp" and you can create multiple new pads in different window.

All newly created document has its own URL structure. Here, linuxhelp pad get' s a URL as http://< ip_address> :9001/p/linuxhelp.

Click the STAR button to save the document which is in editing. For accessing a saved revision of the document add the number of the saved revision.

Etherpad has built-in feature to import any external document or to export a current saved document to another separate file. The document will be downloaded in HTML, Microsoft Word or Plain text format.

To explore the history of the pad, enable " time slider" .

To use Etherpad Lite with MySQL Backend

By default Etherpad will store all the documents in a flat-file database. Here, we are using MySQL database. Run the following command to install it.

[root@linuxhelp ~]# yum install mysql-server mysql -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
.
.
.
Running transaction
  Installing : 1:mariadb-5.5.47-1.el7_2.x86_64                              1/1 
  Verifying  : 1:mariadb-5.5.47-1.el7_2.x86_64                              1/1 

Installed:
  mariadb.x86_64 1:5.5.47-1.el7_2                                               

Complete!

After installing MySQL, connect to mysql shell by executing the following command.

[root@linuxhelp ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with   or g.
Your MariaDB connection id is 10
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.

MariaDB [(none)]>  create database etherpad_lite 
Query OK, 1 row affected (0.01 sec)

MariaDB [(none)]>  grant all privileges on etherpad_lite.* to etherpad@localhost identified by ' linuxc'  
Query OK, 0 rows affected (0.09 sec)

MariaDB [(none)]>  exit
Bye

Switch to " etherpad" user, move to the etherpad directory and execute the following commands.

[root@linuxhelp ~]# su &ndash  etherpad
[etherpad@linuxhelp ~]$ cd /home/etherpad/etherpad-lite/
[etherpad@linuxhelp etherpad-lite]$ cp settings.json.template settings.json

Open settings.json file and then change the settings as shown below,

[etherpad@linuxhelp etherpad-lite]$ vim settings.json
" sessionKey"  : " linuxhelp" ,

To find.

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

To comment it out like,

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

To set mysql and admin settings as like below.

  /* An Example of MySQL Configuration
   " dbType"  : " mysql" ,
   " dbSettings"  : {
                    " user"     : " root" ,
                    " host"     : " localhost" ,
                    " password" : " " ,
                    " database" : " store" ,
                    " charset"  : " utf8mb4" 
                  },
  */

" users" : {
        " admin" : {
        " password" : " linuxc" ,
        " is_admin" : true
}},

Install dependency packages with the following script.

[etherpad@linuxhelp etherpad-lite]$ ./bin/installDeps.sh 
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.
npm WARN package.json async-stacktrace@0.0.2 No repository field.
npm WARN package.json channels@0.0.4 No repository field.
npm WARN package.json tinycon@0.0.1 No repository field.
Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...

Execute Etherpad script again. It creates the appropriate tables in the database.

[etherpad@linuxhelp etherpad-lite]$ ./bin/run.sh 
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.
npm WARN package.json async-stacktrace@0.0.2 No repository field.
npm WARN package.json channels@0.0.4 No repository field.
npm WARN package.json tinycon@0.0.1 No repository field.
Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...
Started Etherpad...
[2016-06-17 12:19:33.390] [WARN] console - DirtyDB is used. This is fine for testing but not recommended for production.
[2016-06-17 12:19:35.061] [INFO] console - Installed plugins: 
[2016-06-17 12:19:35.094] [INFO] console - Report bugs at https://github.com/ether/etherpad-lite/issues
[2016-06-17 12:19:35.096] [INFO] console - Your Etherpad version is 1.6.0 (85cdb1c)
[2016-06-17 12:19:35.324] [INFO] console - You can access your Etherpad instance at http://0.0.0.0:9001/
[2016-06-17 12:19:35.324] [INFO] console - The plugin admin page is at http://0.0.0.0:9001/admin/plugins
[2016-06-17 12:20:35.560] [INFO] access - [CREATE] Pad " linuxc" : Client /#1_rChIKHCSoE4eSkAAAA with IP " 127.0.0.1"  created the pad
^C[2016-06-17 12:21:08.814] [INFO] console - graceful shutdown...
[2016-06-17 12:21:08.814] [INFO] console - db sucessfully closed.

After Etherpad loaded successfully, click Ctrl+C to stop the process. Once again login the mysql shell to alter the database.

[etherpad@linuxhelp etherpad-lite]$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with   or g.
Your MariaDB connection id is 11
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.

MariaDB [(none)]>  alter database etherpad_lite character set utf8 collate utf8_bin 
Query OK, 1 row affected (0.05 sec)

MariaDB [(none)]>  use etherpad_lite 
Database changed

Now we have successfully installed and configured Etherpad tool to use MySQL as backend.

[etherpad@linuxhelp etherpad-lite]$ ./bin/run.sh
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.
npm WARN package.json async-stacktrace@0.0.2 No repository field.
npm WARN package.json channels@0.0.4 No repository field.
npm WARN package.json tinycon@0.0.1 No repository field.
Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...
Started Etherpad...
[2016-06-17 12:23:56.496] [WARN] console - DirtyDB is used. This is fine for testing but not recommended for production.
[2016-06-17 12:24:01.474] [INFO] console - Installed plugins: 
[2016-06-17 12:24:01.504] [INFO] console - Report bugs at https://github.com/ether/etherpad-lite/issues
[2016-06-17 12:24:01.537] [INFO] console - Your Etherpad version is 1.6.0 (85cdb1c)
[2016-06-17 12:24:01.953] [INFO] console - You can access your Etherpad instance at http://0.0.0.0:9001/
[2016-06-17 12:24:01.954] [INFO] console - The plugin admin page is at http://0.0.0.0:9001/admin/plugins
[2016-06-17 12:24:06.048] [INFO] access - [CREATE] Pad " linuxc" : Client /#BZHsyGunbes2_8DtAAAA with IP " 127.0.0.1"  created the pad

Please Keep in mind that Etherpad application will terminate its process when you close your terminal window. You can also use screen command to use Etherpad. To know more about screen command visit,
https://www.linuxhelp.com/useful-screen-command-examples/

Tag : Etherpad
FAQ
Q
What is Etherpad?
A
Etherpad is a free and Real-Time Web Based Online Collaborative Document Editor.
Q
What are the dependent packages required for Etherpad?
A
Dependent packages for Etherpad are "yum install -y gcc-c++"
Q
How to resolve "git command not found error" in Etherpad settings?
A
Install development tools again "git" will come along with it and continue the setup for Etherpad.
Q
How to resolve "./run.sh" error in Etherpad?
A
Make run.sh file as executable by "chmod +x run.sh" and proceed with Etherpad other settings.
Q
How to rectify the web interface issue, website not getting loaded?
A
Make sure you have opened required ports for etherpad in firewall,