In today’s digital age, collaborative tools have become essential for teams to work together efficiently. Etherpad, a free and open-source alternative to services like Google Docs and Zoho Writer, is a powerful web-based text editor that enables real-time collaboration. With features such as versioning, built-in formatting, and support for modern document formats, Etherpad is a highly customizable editor that can enhance team productivity.
This comprehensive guide will walk you through the step-by-step process of installing Etherpad on an AlmaLinux 9 server. We will cover the installation of necessary dependencies, including development tools, Node.js and NPM, MariaDB database server, and Nginx web server. Additionally, we will guide you in configuring the MariaDB server, downloading and installing Etherpad, and running it as a systemd service. Finally, we will show you how to configure Nginx as a reverse proxy to make Etherpad accessible to end-users.
Prerequisites
Before we begin the installation, ensure that you have the following prerequisites:
- An AlmaLinux 9 server with a non-root user and sudo privileges.
- A domain name pointed to the server’s IP address.
- Generated SSL certificates via Letsecnrypt and Certbot.
Now that you have the necessary prerequisites, let’s proceed with the installation.
Installing Dependencies
To install Etherpad, we need to install some dependencies first. These dependencies include development tools, Node.js and NPM, MariaDB server, and Nginx web server. Let’s go through each step.
Installing Development Tools
Development tools are essential for compiling and building software on your AlmaLinux server. To install the necessary development tools, run the following command:
sudo dnf group install "Development Tools"
After the installation is complete, you can verify the installation by running the following command:
gcc --version
Installing Node.js and NPM
Etherpad is primarily written in Node.js, so we need to install the Node.js runtime and NPM (Node Package Manager). AlmaLinux 9 provides Node.js v16 by default, which is compatible with Etherpad. To install Node.js and NPM, run the following command:
sudo dnf install nodejs npm
Once the installation is complete, verify the installation by checking the Node.js and NPM versions:
node --version npm --version
Installing MariaDB Server
Etherpad can use SQLite as its default database, but for larger deployments, it is recommended to use MariaDB or MySQL. To install MariaDB server, run the following command:
sudo dnf install mariadb-server
After the installation is complete, start and enable the MariaDB service:
sudo systemctl start mariadb sudo systemctl enable mariadb
Verify the status of the MariaDB service:
sudo systemctl status mariadb
Installing Nginx Web Server
Nginx will act as a reverse proxy for Etherpad, allowing it to be accessible to end-users. Before installing Nginx, ensure that you have a domain name pointed to your server’s IP address and SSL certificates generated via Letsecnrypt and Certbot.
To install Nginx, run the following command:
sudo dnf install nginx
Start and enable the Nginx service:
sudo systemctl start nginx sudo systemctl enable nginx
Verify the status of the Nginx service:
sudo systemctl status nginx
Open HTTP and HTTPS ports on your server:
sudo firewall-cmd --add-service={http,https} --permanent sudo firewall-cmd --reload
Verify the list of open ports and services:
sudo firewall-cmd --list-all
Configuring MariaDB Server
Before we proceed with the installation of Etherpad, we need to secure the MariaDB server and create a new database and user for Etherpad.
Securing MariaDB Server
To secure the MariaDB server, we will use the mariadb-secure-installation utility. Run the following command to start the secure installation process:
sudo mariadb-secure-installation
During the secure installation process, you will be prompted to configure the following:
- Change the authentication method for the MariaDB root user to
unix_socket. Inputnfor No. - Set up a new password for the MariaDB root user. Input
yto confirm and enter a new password. - Disable remote login for the MariaDB root user. Input
yto confirm. - Remove the default test database. Input
yto confirm. - Remove anonymous user accounts. Input
yto confirm. - Reload table privileges to apply the changes. Input
yto confirm.
Creating a New Database and User
After securing the MariaDB server, we will create a new database and user specifically for Etherpad. To create a new database and user, follow these steps:
- Log in to the MariaDB server as the root user:
sudo mariadb -u root -p
- Run the following queries to create a new database and user:
CREATE DATABASE etherpad_lite_db CHARACTER SET utf8mb4; CREATE USER etherpaduser@localhost IDENTIFIED BY 'StrongPasswordEtherpadDB'; GRANT CREATE,ALTER,SELECT,INSERT,UPDATE,DELETE on etherpad_lite_db.* to etherpaduser@localhost; FLUSH PRIVILEGES;
- Verify the privileges for the MariaDB user:
SHOW GRANTS FOR etherpaduser@localhost;
- Exit the MariaDB server:
quit
Downloading and Installing Etherpad
Now that we have all the necessary dependencies and a secure MariaDB server, we can proceed with downloading and installing Etherpad.
Creating a System User
Before downloading Etherpad, let’s create a system user specifically for running the Etherpad service. Run the following commands:
sudo groupadd etherpad sudo adduser -r -M -d /opt/etherpad-lite -g etherpad etherpad
Downloading Etherpad Source Code
To download the Etherpad source code, run the following command:
sudo git clone --branch master https://github.com/ether/etherpad-lite.git/opt/etherpad-lite
Installing Etherpad Dependencies
Move to the Etherpad working directory:
cd /opt/etherpad-lite
Install Etherpad dependencies:
sudo su -s /bin/bash -c "./bin/installDeps.sh" etherpad
Configuring Etherpad
Open the Etherpad configuration file:
sudo nano settings.json
Update the following configurations:
- Change the title of your Etherpad installation:
"title": "Etherpad AlmaLinux 9",
- Change the default IP address for Etherpad to localhost or 127.0.0.1:
"ip": "127.0.0.1", "port": 9001,
- Remove the default database configuration:
/*
*"dbType": "dirty",
*"dbSettings": {
* "filename": "var/dirty.db"
*},
*/
- Add the details for the MariaDB database:
"dbType" : "mysql",
"dbSettings" : {
"user": "etherpaduser",
"host": "localhost",
"port": 3306,
"password": "StrongPasswordEtherpadDB",
"database": "etherpad_lite_db",
"charset": "utf8mb4"
},
Save and close the file.
Running Etherpad
To verify the Etherpad installation, run the following command:
/bin/node --experimental-worker /opt/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js
If the installation is successful, you will see the output indicating that Etherpad is running.
Press Ctrl+C to terminate the process.
Running Etherpad as a Systemd Service
To run Etherpad as a systemd service, we need to create a systemd service file.
Create the file:
sudo nano /lib/systemd/system/etherpad.service
Paste the following configuration into the file:
[Unit] Description=Etherpad-lite, the collaborative editor. After=syslog.target network.target mariadb.service nginx.service [Service] Type=simple User=etherpad Group=etherpad WorkingDirectory=/opt/etherpad-lite Environment=NODE_ENV=production ExecStart=/bin/node --experimental-worker /opt/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js # use mysql plus a complete settings.json to avoid Service hold-off time over, scheduling restart. Restart=always [Install] WantedBy=multi-user.target
Save and close the file.
Reload the systemd manager and apply the Etherpad service file:
sudo systemctl daemon-reload
Start and enable the Etherpad service:
sudo systemctl start etherpad sudo systemctl enable etherpad
Verify the Etherpad service:
sudo systemctl status etherpad
To verify the list of open ports on your system:
sudo ss -tulpn | grep 9001
Etherpad is now running as a systemd service.
Configuring Nginx as a Reverse Proxy
To make Etherpad accessible to end-users, we will configure Nginx as a reverse proxy.
Create an Nginx server block configuration file:
sudo nano /etc/nginx/conf.d/etherpad.conf
Paste the following configuration into the file:
# enforce HTTPS
server {
listen 80;
server_name etherpad.example.io;
return 301 https://$host$request_uri;
}
# we're in the http context here
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl http2;
server_name etherpad.example.io;
access_log /var/log/nginx/eplite.access.log;
error_log /var/log/nginx/eplite.error.log;
ssl_certificate /etc/letsencrypt/live/etherpad.example.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/etherpad.example.io/privkey.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
location / {
proxy_pass http://127.0.0.1:9001;
proxy_buffering off; # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf
proxy_set_header Host $host;
proxy_pass_header Server;
# Note you might want to pass these headers etc too.
proxy_set_header X-Real-IP $remote_addr; # https://nginx.org/en/docs/http/ngx_http_proxy_module.html
proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP
proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used
proxy_http_version 1.1; # recommended with keepalive connections
# WebSocket proxying - from https://nginx.org/en/docs/http/websocket.html
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
Save and close the file.
Check if the Nginx configuration is correct:
sudo nginx -t
Restart the Nginx service:
sudo systemctl restart nginx
Now, you can access Etherpad by visiting your domain name (e.g.,https://etherpad..io/). You should see the default home page of Etherpad.
Create a new pad by entering the pad name and clicking OK.
Congratulations! You have successfully installed Etherpad on your AlmaLinux 9 server. Etherpad is now ready for collaborative editing.
Conclusion
In this comprehensive guide, we have walked you through the step-by-step process of installing Etherpad on an AlmaLinux 9 server. We covered the installation of necessary dependencies, including development tools, Node.js and NPM, MariaDB database server, and Nginx web server. We also guided you in configuring the MariaDB server, downloading and installing Etherpad, and running it as a systemd service. Finally, we showed you how to configure Nginx as a reverse proxy to make Etherpad accessible to end-users.
With Etherpad, you now have a powerful collaborative editor that can enhance team productivity and streamline document collaboration. Enjoy the benefits of real-time collaboration, versioning, and built-in formatting as you work together with your team.
For reliable and scalable cloud hosting solutions, consider Shape.host’s Cloud VPS services. Shape.host offers secure and efficient cloud hosting solutions to empower businesses with seamless collaboration and enhanced productivity. Visit Shape.host to learn more about their hosting services and take your collaboration to the next level.