Install Etherpad on Ubuntu 22.04

In this guide, you will learn to Install and Configure Etherpad on Ubuntu 22.04. Etherpad is an online, web-based editor that allows you to edit a text document and monitor all edits in real time. It is an open-source and easy-to-use text editor.

You can follow this guide to see how to install and Configure Etherpad on Ubuntu 22.04 server and you will learn how to use your Etherpad editor.

Complete Guide To Install Etherpad on Ubuntu 22.04

To complete this guide, you must have access to your server as a non-root user with sudo privileges. To do this, you can follow this guide on Initial Server Setup with Ubuntu 22.04.

Also, you need a valid domain name that is pointed to your server’s IP address.

Step 1 – Install Dependencies for Etherpad

First, you need to run the system update by using the command below:

sudo apt update

Then, use the following command to install the required packages and dependencies for Etherpad:

sudo apt install gnupg2 git unzip libssl-dev pkg-config gcc g++ make build-essential -y

When you are done, proceed to the next step to install MariaDB and create your Etherpad database and database user.

Step 2 – Configure MariaDB for Etherpad on Ubuntu 22.04

At this point, you need a database management system. Here we use MariaDB. To install MariaDB, run the following command:

sudo apt install mariadb-server -y

Then, secure your MariaDB installation by running the following script:

sudo mysql_secure_installation

You will be asked to set a root password for your MariaDB, and from there enter yes to answer other questions.

Now you can access your MariaDB shell with the command below:

sudo mysql -u root -p

Enter your password and press enter. Then, create a database and user for Etherpad on Ubuntu 22.04 by using the following commands:

MariaDB [(none)]> CREATE DATABASE etherpaddb;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON etherpaddb.* TO etherpaduser@localhost IDENTIFIED BY 'password';

Next, flush the privileges and exit from your MariaDB shell:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 3 – Install Node.js for Etherpad

Etherpad is based on Node.js. So you must have Node.js installed on your server. To install the latest Node.js, download the following script by using the curl command:

sudo curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh

Then, run your downloaded script with the command below:

sudo bash nodesource_setup.sh

Next, install Node.js on Ubuntu 22.04 with the following command:

sudo apt install nodejs -y

Verify your Node.js installation by checking its version:

node -v
Output
v18.16.0

Step 4 – Install Etherpad on Ubuntu 22.04

Before installing Etherpad, it is recommended to run Etherpad with a different user. To do this, you can create the user with the command below:

sudo adduser --home /opt/etherpad --shell /bin/bash etherpad

Then, set the correct permissions for your Etherpad directory with the following command:

sudo install -d -m 755 -o etherpad -g etherpad /opt/etherpad

Next, switch to your Etherpad user and use the following git command to clone the Etherpad from GitHub in the latest version:

# su - etherpad
# git clone --branch master https://github.com/ether/etherpad-lite.git

At this point, switch to your downloaded directory and run the Etherpad by using the following command:

# cd etherpad-lite
# bin/run.sh

When it is completed, you will get the following output:

Output
[2023-06-06 08:16:14.177] [INFO] console - Your Etherpad version is 1.8.18 (4b96ff6)
[2023-06-06 08:16:16.054] [INFO] http - HTTP server listening for connections
[2023-06-06 08:16:16.054] [INFO] console - You can access your Etherpad instance at http://0.0.0.0:9001/
[2023-06-06 08:16:16.056] [WARN] console - Admin username and password not set in settings.json. To access admin please uncomment and edit "users" in settings.json
[2023-06-06 08:16:16.056] [WARN] console - Etherpad is running in Development mode. This mode is slower for users and less secure than production mode. You should set the NODE_ENV environment variable to production by using: export NODE_ENV=production
[2023-06-06 08:16:16.057] [INFO] server - Etherpad is running

To stop the server, press CTRL C.

Step 5 – Configure Etherpad on Ubuntu 22.04

At this point, you need to edit the settings.json file and define your database and admin settings. Open the file with your favorite text editor like the vi editor or nano editor:

vi settings.json

Find the following lines and remove them:

"dbType" : "dirty",
  "dbSettings" : {
                   "filename" : "var/dirty.db"
                 },

Then, change the following MySQL settings with your database credentials:

  "dbType" : "mysql",
  "dbSettings" : {
    "user":     "etherpaduser",
    "host":     "localhost",
    "port":     3306,
    "password": "password",
    "database": "etherpaddb",
    "charset":  "utf8mb4"
  },

Find the line trustProxy and set it to true:

  "trustProxy": true,

Finally, define a password for the admin user as shown below:

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

When you are done, save and close the file.

Next, install the required dependencies with the following command:

./bin/installDeps.sh

When it is completed, you can exit from your Etherpad user:

exit

Step 6 – Create a Systemd Unit File for Etherpad

To manage your Etherpad service, you need to create a systemd unit file. To do this, you can run the following command:

sudo vi /etc/systemd/system/etherpad.service

Add the following content to the file:

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

[Service]
Type=simple
User=etherpad
Group=etherpad
WorkingDirectory=/opt/etherpad/etherpad-lite
Environment=NODE_ENV=production

ExecStart=/usr/bin/node /opt/etherpad/etherpad-lite/src/node/server.js

Restart=always

[Install]
WantedBy=multi-user.target

When you are done, save and close the file.

Reload the system daemon with the following command:

sudo systemctl daemon-reload

Then, start and enable your Etherpad service with the commands below:

# sudo systemctl start etherpad
# sudo systemctl enable etherpad

Verify your Etherpad service is active and running on Ubuntu 22.04:

sudo systemctl status etherpad
Output
● etherpad.service - Etherpad-lite, the collaborative editor.
     Loaded: loaded (/etc/systemd/system/etherpad.service; enabled; vendor pres>
     Active: active (running) since Tue 2023-06-06 08:37:12 UTC; 5s ago
   Main PID: 5777 (node)
      Tasks: 11 (limit: 4575)
     Memory: 34.5M
        CPU: 7.935s
     CGroup: /system.slice/etherpad.service
             └─5777 /usr/bin/node /opt/etherpad/etherpad-lite/src/node/server.js

Step 7 – Configure Nginx as a Reverse Proxy for Etherpad

At this point, you need to install Nginx and configure it for Etherpad as a reverse proxy on Ubuntu 22.04.

First, install Nginx by using the command below:

sudo apt install nginx -y

Then, use the following command to create a Nginx virtual host file:

sudo vi /etc/nginx/sites-available/etherpad.conf

Add the following content to the file:

upstream etherpad {
   server localhost:9001;
   keepalive 32;
}

server {
   listen 80;
   server_name examle.com;

   location / {
       client_max_body_size 50M;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_http_version 1.1;
       proxy_pass http://etherpad;
   }
}

When you are done, save and close the file.

Next, activate the Nginx virtual host configuration file with the following command:

sudo ln -s /etc/nginx/sites-available/etherpad.conf /etc/nginx/sites-enabled/

Check your Nginx for syntax errors:

nginx -t
Output
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Then, restart Nginx to apply the changes:

sudo systemctl restart nginx

Step 8 – How To Access Etherpad Dashboard on Ubuntu 22.04?

At this point, you can access your Etherpad web interface by typing your domain name in your web browser followed by 9001:

http://your-domain:9001

You will see the following page. Provide your page name and click Ok:

create Etherpad page

Then, you will see the Etherpad dashboard as shown below:

Etherpad dashboard ubuntu

Step 9 – How To Use Etherpad?

To start using Etherpad, we begin with single-author writing.

Single Writing with Etherpad

You can easily remove the Welcome text that you have seen in the dashboard and start your writing. As you can see in the top left side of the Etherpad dashboard, you can format the text using the provided buttons. These are in order: Bold, Italic, Underline, Strikethough, Numbered list, Unordered list, Indent, Outdent, Undo, and Redo.

Single writing with Etherpad

Multiple Writing with Etherpad

With Etherpad, other people easily can join the pad and start to type their text. And it will appear in a different color. With this option, you can track who has written what.

It is a good idea for you to link your name with your color. To do this, click on the icon of the head and shoulders at the top right of your page. Type a name, select your color, and press enter.

Etherpad multi writing

As more users start to edit the document they will appear in this list. This allows you to see who has written which text. 

Invite others to collaborate with you on Etherpad

To invite others to collaborate with you on your pad, you can click on the share Icon to show options for sharing the pad.

Share pad with Etherpad

Then, copy the link and share it with other people to join you in the writing of the document you have just started.

Chat with other writers on Etherpad

One of the amazing features of Etherpad is that you can communicate in real-time with other writers remotely.

To activate the chat, click on the chat icon at the bottom of the right side.

For more information, you can visit the Etherpad official site.

Conclusion

At this point, you have learned to install Etherpad on Ubuntu 22.04 by cloning it from GitHub and configuring Nginx as a reverse proxy for it. And you have learned to access your Etherpad Web dashboard and how to use it.

Hope you enjoy it. You may be interested in these articles on the orcacore website:

Install Slack on Ubuntu 22.04

Install and Configure Flarum on Ubuntu 22.04

Set up Etherpad on AlmaLinux 9

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!