20 C
Texas

How To Install Etherpad On Ubuntu 20.04

In this tutorial you’ll learn that how to install Etherpad on Ubuntu 20.04. Etherpad is a web based online editor that helps you to wathc your edits in real time. It provides many features & it is fully customizable and seprates each author text in separate color and many other features. With the help of various plugins, you can make it more comfortable. So, here we’ll see the steps to install it on our system.

Step 1: Update Your System

First of all update your system.

sudo apt update -y

And install some other required packages by typing

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

Step 2: Install & Configure MariadDB

Run the below command to install MariaDB on your system.

sudo apt install mariadb-server -y

Type mysql in the terminal to login.

sudo mysql -u root -p

Then create a database for etherpad

create database etherpad;
grant all privileges on etherpad.* to [email protected] identified by 'Your_Password';
flush privileges;
exit;

Step 3: Install Node.js on Ubuntu 20.04

As Etherpad is based on Node.js, so you’ve to install it on your system. By default the latest version is not provided on Ubuntu repositories. Install it with the help of below commands.

sudo curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs -y

Verify the installed version by typing

node -v

Output:

[email protected]:~$ node -v
v14.15.1

Step 4: Install & Configure Etherpad

First of all create a user for etherpad to run it as a seprate user.

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

Provide the password and other details.

[email protected]:~$ sudo adduser --home /opt/etherpad --shell /bin/bash etherpad
Adding user etherpad' ... Adding new groupetherpad' (1001) …
Adding new user etherpad' (1001) with groupetherpad' …
Creating home directory /opt/etherpad' ... Copying files from/etc/skel' …
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for etherpad
Enter the new value, or press ENTER for the default
Full Name []: Sabor
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y

Give permissions to newly created user.

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

Now, switch to the user & download the etherpad with the help of below commands.

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

Switch to the downloaded directory & run the script.

cd etherpad-lite
bin/run.sh

Output:

2020-12-05 10:41:17.826] [INFO] console - Your Etherpad version is 1.8.6 (2c8769a)
[2020-12-05 10:41:17.930] [INFO] console - You can access your Etherpad instance at http://0.0.0.0:9001/
[2020-12-05 10:41:17.930] [WARN] console - Admin username and password not set in settings.json. To access admin please uncomment and edit 'users' in settings.json
[2020-12-05 10:41:17.930] [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
Simply stop the server by pressing Ctrl+C & edit the settings.json file.
sudo nano settings.json

And delete the given lines:

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

And do the similar changes as given below:

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

Note: Provide your own credentials.

And set the trustProxy to true state.

"trustProxy": true,

Also, type the pass for admin user.

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

Finally save & exit the file.

Hit the below command to resolve dependencies.

./bin/installDeps.sh

On success, exit Etherpad user

exit

Etherpad is now installed & configured.

Step 5: Create Systemd Service File

Create a new file under /etc/systemd/system/ directory.

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

Then paste the below content in 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

Save & exit the file.

Reload the daemon.

systemctl daemon-reload

To start & enable etherpad type,

systemctl start etherpad
systemctl enable etherpad

Confirm the status by typing

[email protected]:~$ sudo systemctl status etherpad
● etherpad.service - Etherpad-lite, the collaborative editor.
Loaded: loaded (/etc/systemd/system/etherpad.service; enabled; vendor preset: ena>
Active: active (running) since Sat 2020-12-05 10:47:47 PKT; 22s ago
Main PID: 13895 (node)
Tasks: 13 (limit: 2285)
Memory: 87.9M
CGroup: /system.slice/etherpad.service
└─13895 /usr/bin/node /opt/etherpad/etherpad-lite/src/node/server.js
دسمبر 05 10:47:47 Ubuntu20 node[13895]: No credentials file found in /opt/etherpad/eth>
دسمبر 05 10:47:47 Ubuntu20 node[13895]: [2020-12-05 10:47:47.270] [INFO] console - Usi>
دسمبر 05 10:47:47 Ubuntu20 node[13895]: [2020-12-05 10:47:47.271] [INFO] console - Ses>
دسمبر 05 10:47:47 Ubuntu20 node[13895]: [2020-12-05 10:47:47.271] [WARN] console - Dir>
دسمبر 05 10:47:49 Ubuntu20 node[13895]: [2020-12-05 10:47:49.114] [INFO] APIHandler - >
دسمبر 05 10:47:49 Ubuntu20 node[13895]: [2020-12-05 10:47:49.252] [INFO] console - Ins>
دسمبر 05 10:47:49 Ubuntu20 node[13895]: [2020-12-05 10:47:49.255] [INFO] console - Rep>
دسمبر 05 10:47:49 Ubuntu20 node[13895]: [2020-12-05 10:47:49.256] [INFO] console - You>
دسمبر 05 10:47:49 Ubuntu20 node[13895]: [2020-12-05 10:47:49.366] [INFO] console - You>
دسمبر 05 10:47:49 Ubuntu20 node[13895]: [2020-12-05 10:47:49.367] [WARN] console - Adm>
lines 1-19/19 (END)

Step 6: Configure Nginx

Install & configure the nginx for etherpad.

sudo apt install nginx -y

Create new /etc/nginx/sites-available/etherpad.conf file.

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

And paste the data given in it.

upstream etherpad {
server localhost:9001;
keepalive 32;
}
server {
listen 80;
server_name etherpad.osradar.com;
location / {
client_max_body_size 50M;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_pass http://etherpad;
}
}

Save & exit the file.

Link the above config file by typing

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

Verify the syntax,

[email protected]:~$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Restart nginx services

sudo systemctl restart nginx

Verify the status

sudo systemctl status nginx

Step 7:Access Etherpad Via Web

Type http://etherpad.osradar.com & you’ll see the similar page.

How To Install Etherpad On Ubuntu 20.04

Give it a name & click “OK”. You’ll see the etherpad dashboard.

How To Install Etherpad On Ubuntu 20.04

So, this is how you can install etherpad on Ubuntu20.04

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article