Deploy Etherpad for an In-House Alternative to Google Docs

If your developers (or any team in your business) need to make use of an in-house solution to house things like documentation, code, YAML files, or just about anything, there are a vast array of options to choose from.
One such option is Etherpad, which is a web-based text editor that offers real-time collaboration, versioning, and formatting. Etherpad also supports plugins for things like alignment, headings, markdown, image uploads, comments, font colors, TOC, hyperlink embedding, spellcheck, and more. To find a complete list of plugins, check out the official listing here.
Etherpad is also available in 105 languages and is used by millions around the globe.
With this tool, your teams could easily collaborate on many different types of documents, without having to rely on a third-party service.
I’m going to demonstrate deploying Etherpad by way of Docker on Ubuntu Server 22.04. You can deploy Etherpad in-house or even on your third-party cloud host.
What You’ll Need
The only things you’ll need for this are a running instance of Ubuntu Server and a user with sudo privileges. Because we’re deploying this as an in-house service, it doesn’t require a domain name. If, however, you want to access Etherpad from outside your LAN, you’ll have to take the extra steps to configure the server for a domain and make sure your network hardware is configured to route traffic to the Etherpad server.
Installing Docker
Because we’re going to deploy Etherpad as a container, you’ll want to have the Docker runtime engine installed on your machine, which means you can deploy on any platform that supports Docker. Of course, being that Ubuntu Server is my go-to platform of choice, I’ll demonstrate on that OS.
Log into your instance of Ubuntu Server. If your server has a GUI, open a terminal window. Once logged in, the first thing to do is add the official Docker GPG key with the command:
1 |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg |
Next, add the official Docker repository with:
1 |
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
Install the necessary dependencies with:
1 |
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release git -y |
Update apt with the command:
1 |
sudo apt-get update |
You can now install the latest version of the Docker engine with the command:
1 |
sudo apt-get install docker-ce docker-ce-cli containerd.io -y |
Add your to the docker group (so you can work with Docker without having to use sudo…which can be a security risk) with the command:
1 |
sudo usermod -aG docker $USER |
Log out and log back in, so the changes take effect.
With Docker installed, you’re ready to deploy Etherpad.
Deploying Etherpad with Docker
It’s now time to deploy Etherpad. First, let’s pull the latest official image with the command:
1 |
docker pull etherpad/etherpad |
After the image pulls, you can deploy the container with the command:
1 |
docker run --detach --publish 9001:9001 etherpad/etherpad |
Give the container a minute to spin up. You can check its status with the command:
1 |
docker ps -a | grep etherpad |
The output should include healthy, which indicates the container is up and running and ready for connections.
Accessing Etherpad
At this point, Etherpad is ready. Point a web browser (that’s connected to the same network hosting Etherpad) to http://SERVER:9001 (where SERVER is the IP address of the hosting server. You’ll be greeted by the New Pad create button (Figure 1).
-
Figure 1: A fresh Etherpad instance, ready for collaboration.
You can either click New Pad or type a name for a new pad and click OK. Since this is your first time working with Etherpad, there won’t be any Pads to work with. Once Etherpad loads, you’ll see a quick note on the first pad.
The Full Install Route
One thing to keep in mind, however, is that the Docker version of Etherpad uses DirtyDB, which isn’t generally recommended for production. You can suppress this warning (as instructed by the initial Pad) or you can skip the Docker deployment and do a full installation. Here are the steps for installing Etherpad on Ubuntu Server 22.04.
- If you already deployed the container, stop it with docker stop ID (where ID is the ID of the Etherpad container, which can be found with docker ps -a |grep etherpad).
- Add the Nodejs repository with curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash –
- Install Nodejs with sudo apt-get install nodejs -y
- Install MariaDB server with sudo apt-get ijnstall mariadb-server -y
- Log into the MariaDB console with sudo mysql
- Create the database with CREATE DATABASE etherpad_db;
- Create a user with CREATE USER etherpaduser@localhost IDENTIFIED By ‘PASSWORD’; (Where PASSWORD is a strong password).
- Grant the necessary privileges with GRANT ALL PRIVILEGES ON etherpad_db.* TO etherpaduser@localhost;
- Flush the privilege table with FLUSH PRIVILEGES;
- Exit the MariaDB console with EXIT
- Add a dedicated user with sudo adduser ether
- Change to the new user with su ether
- Clone the Etherpad source with git clone –branch master https://github.com/ether/etherpad-lite.git
- Change into the newly-created directory with cd etherpad-lite
- Set a necessary environment variable with export NODE_ENV=production
- Install Etherpad with src/bin/run.sh
- Open the firewall with sudo ufw allow 9001.
The above steps will install and start Etherpad but won’t return your bash prompt. There’s still some work to do. Cancel the running service with the [Ctrl]+[C] keyboard shortcut. Open the Etherpad settings file with the command:
nano etherpad-lite/settings.json
Change this section:
1 2 3 4 |
"dbType" : "dirty", "dbSettings" : { "filename" : "var/dirty.db" }, |
To this:
1 2 3 4 5 6 |
/* "dbType" : "dirty", "dbSettings" : { "filename" : "var/dirty.db" }, */ |
Next, locate the “dbType“: “mysql“, section and remove the /* and */ lines. In that same section, change the user option to etherpaduser and the password option to the password you set for the etherpad database user and change the database entry to etherpad_db. Next, locate the trustProxy line and change it from false to true.
In the same file, locate the requireAuthentication variable and change it from false to true.
Finally, locate the user section (it starts with “users”: {) and remove the /* and */ lines. In that same section, change the password (which defaults to changeme1) to something strong and unique.
Save and close the file.
Install the necessary dependencies by issuing the command:
1 |
./bin/installDeps.sh |
When that completes, exit from the current user with the exit command.
Next, we must create a systemd service file with the command:
1 |
sudo nano /etc/systemd/system/etherpad.service |
Paste the following lines into the file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[Unit] Description=Etherpad-lite, the collaborative editor. After=syslog.target network.target [Service] Type=simple User=ether Group=ether WorkingDirectory=/etherpad-lite Environment=NODE_ENV=production ExecStart=/usr/bin/node /etherpad-lite/src/node/server.js Restart=always [Install] WantedBy=multi-user.target |
Save and close the file.
Reload the systemd daemon with the command:
1 |
sudo systemctl daemon-reload |
Start and enable the service with:
1 |
sudo systemctl enable --now etherpad |
You should now be able to access Etherpad in the same way as you did after deploying it with Docker.
Either way, your teams will enjoy an in-house, real-time collaboration tool where they can work together on documentation, code, YAML files, or just anything that can be created within a text editor.