This article explains how to install Etherpad on Ubuntu Linux.
Etherpad is an open-source and customizable online editor that provides real-time collaborative editing.
Users can write articles and other documents with their friends, fellow students, or colleagues, working on the same documents simultaneously.
Whether you want to use your server or any available public instances, you can run and manage Etherpad quickly. The steps below show you how to install Etherpad on the Ubuntu Linux server.
Install prerequisites
Before installing Etherpad packages, run the commands below to install some helpful packages that may be needed to install Etherpad successfully.
To do that, run the commands below.
sudo apt update sudo apt install gnupg2 git curl unzip libssl-dev pkg-config gcc g++ make build-essential
Install the MariaDB database server
Etherpad requires a database server to store its content. The best open-source database server is the MariaDB database server.
To install the MariaDB database server, use the instructions below.
sudo apt update sudo apt install mariadb-server
Once the MariaDB database server is installed, use the commands below to stop, start and enable the MariaDB server to start up when the server boots automatically.
sudo systemctl stop mariadb sudo systemctl start mariadb sudo systemctl enable mariadb
Setup Etherpad database
Now that you have installed the MariaDB database log on to the database server and create a blank database for Etherpad.
sudo mariadb
Run the commands below to create a database called etherdb
. Also, create a database account etheruser
with a password and grant all privileges to manage the database.
CREATE DATABASE etherdb; GRANT ALL PRIVILEGES on etherdb.* to etheruser@localhost IDENTIFIED BY 'type_password_here';
Exit and flush changes.
FlUSH PRIVILEGES; exit
Install Node.js
Etherpad uses Node.js and requires Node.js to be installed. Use the commands below to install Node.js packages on Ubuntu Linux.
sudo apt-get install -y nodejs
The commands above will install the latest version of Node.js on Ubuntu Linux.
Install Etherpad
Now we have prepared Ubuntu Linux, go and download Etherpad and install it. But first, create a system account for Etherpad with a password.
sudo useradd --system -d /opt/etherpad --shell=/bin/bash etherpad sudo passwd etherpad sudo install -d -m 755 -o etherpad -g etherpad /opt/etherpad
Next, change the Etherpad directory and download the Etherpad packages.
cd /opt/etherpad su - etherpad git clone --branch master https://github.com/ether/etherpad-lite.git
After downloading, run the commands below to configure the Etherpad environment.
cd etherpad-lite bin/run.sh
Next, open the settings.json
file.
nano settings.json
Make the changes below and save the file. Type in the database name
and user account
created above with the password
.
Also, change the trustProxy
line to true. Finally, type in an admin password
when you want to configure Etherpad.
"dbType" : "mysql", "dbSettings" : { "user": "etheruser", "host": "localhost", "port": 3306, "password": "type_password_here", "database": "etherdb", "charset": "utf8mb4" }, /* * When you use NGINX or another proxy/load-balancer set this to true. * * This is especially necessary when the reverse proxy performs SSL * termination, otherwise the cookies will not have the "secure" flag. * * The other effect will be that the logs will contain the real client's IP, * instead of the reverse proxy's IP. */ "trustProxy": true, /* "users": { "admin": { // 1) "password" can be replaced with "hash" if you install ep_hash_auth // 2) please note that if password is null, the user will not be created "password": "type_password_here", "is_admin": true },
Run the commands below after saving the file above. The commands below will install dependencies.
./bin/installDeps.sh
Exit using the Etherpad account.
exit
Next, create a service account for Etherpad.
sudo nano /etc/systemd/system/etherpad.service
Type the content below into the file and save it.
[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
Reload and start the Etherpad services.
sudo systemctl daemon-reload sudo systemctl start etherpad sudo systemctl enable etherpad
Install Nginx
You can use Etherpad without Nginx or Apache webserver. Howerver, the best way to run Etherpad is using a proxy server.
We can use Nginx for that.
sudo apt install nginx
Create an Nginx server block config file.
sudo nano /etc/nginx/sites-available/etherpad.conf
Copy the content below and paste it into the file, then save it.
upstream etherpad { server localhost:9001; keepalive 32; } server { listen 80; server_name etherpad.example.com; location / { client_max_body_size 50M; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; proxy_pass http://etherpad; } }
Enable the site and reload.
sudo ln -s /etc/nginx/sites-available/etherpad.conf /etc/nginx/sites-enabled/ sudo systemctl restart nginx
Access Etnerpad portal
At this point, you are all done. Open your browser and browse to the domain name in the Nginx server block to access the Etherpad portal.
http://etherpad.example.com
You will see a welcome page for Etherpad. You can create a new Pad or enter or open an existing page using a link.

Begin using Etherpad

That should do it!
Reference:
Conclusion:
This post showed you how to install Etherpad on Ubuntu Linux. If you find any errors above or have something to add, please use the comments form below.