EtherCalc is a web-based Spreadsheet that allows you to create a Spreadsheet through a web browser. You can edit the Spreadsheet and allow multiple users to work on the same file. It is very similar to Google Sheets and comes with many mathematical formulas and functions.
These are its main features:
- Free and Open-source.
- Exports your files to CSV or XLSX format.
- Uses randomly generated URLs.
- Supports Linux, FreeBSD, Mac OS X, and Windows operating systems.
In this tutorial, we'll show you how to install EtherCalc with Nginx as a reverse proxy on Debian 10.
Requirements
- A Debian 10 installed in your server.
- A valid domain name pointed to your server IP.
- A root password set on the server.
Install Required Dependencies
Before installing EtherCalc, you'll need to install some dependencies in your server. You can install all of them with the following command:
# apt-get install nginx redis curl gnupg2 git wget -y
Once all the packages are installed, start the Redis and Nginx service with the following command:
# systemctl start redis-server
# systemctl start nginx
Install Node.js
Next, you will need to install Node.js and NPM to your system. By default, the latest version of Node.js is not included in the Debian 10 default repository. So you will need to install Node source repository to your system. You can do it with the following command:
# curl -sL https://deb.nodesource.com/setup_14.x | bash -
Once the repository is added, install Node.js with the following command:
# apt-get install nodejs -y
After installing Node.js, verify the Node.js and NPM version with the following command:
# node --version
This is the output that you should get:
v14.17.0
Regarding the NPM version, the output should be this one:
# npm -v
6.14.13
Install EtherCalc
Next, you can install EtherCalc using the NPM command as shown below:
# npm install -g ethercalc
Once is installed, run EtherCalc with the following command:
# ethercalc
You should see the following output:
Please connect to: http://debian10:8000/
Starting backend using webworker-threads
Falling back to vm.CreateContext backend
Express server listening on port 8000 in development mode
Next, press "CTRL+C" to stop EtherCalc.
Create a Systemd Service File for EtherCalc
First, create a user to run EtherCalc with the following command:
# adduser ethercalc
Next, add the EtherCalc user to www-data group with the following command:
# usermod -a -G ethercalc www-data
To go on, create a systemd service file to manage the EtherCalc service:
# nano /etc/systemd/system/ethercalc.service
And then, add the following lines:
[Unit]
Description=Run Ethercalc, the collaborative spreadsheet editor.
After=syslog.target network.target
[Service]
Type=simple
User=ethercalc
ExecStart=/usr/bin/ethercalc --port 8080 --cors --expire 31104000
#RuntimeMaxSec=86400
#Restart=always
[Install]
WantedBy=multi-user.target
Save and close the file then reload the systemd daemon to apply the changes with the following command:
# systemctl daemon-reload
Next, start and enable the EtherCalc service using the command below:
# systemctl start ethercalc
# systemctl enable ethercalc
For the next step, verify the status of the EtherCalc service with the following command:
# systemctl status ethercalc
Below there is the output that you should get:
● ethercalc.service - Run Ethercalc, the collaborative spreadsheet editor.
Loaded: loaded (/etc/systemd/system/ethercalc.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2021-06-03 15:55:58 UTC; 6s ago
Main PID: 3647 (node)
Tasks: 11 (limit: 2359)
Memory: 57.6M
CGroup: /system.slice/ethercalc.service
└─3647 node /usr/bin/ethercalc --port 8080 --cors --expire 31104000
Jun 03 15:55:58 debian10 systemd[1]: Started Run Ethercalc, the collaborative spreadsheet editor..
Jun 03 15:55:58 debian10 ethercalc[3647]: Please connect to: http://debian10:8080/
Jun 03 15:55:59 debian10 ethercalc[3647]: Starting backend using webworker-threads
Jun 03 15:55:59 debian10 ethercalc[3647]: Falling back to vm.CreateContext backend
Jun 03 15:55:59 debian10 ethercalc[3647]: Cross-Origin Resource Sharing (CORS) enabled.
Jun 03 15:55:59 debian10 ethercalc[3647]: Express server listening on port 8080 in development mode
Jun 03 15:55:59 debian10 ethercalc[3647]: Zappa 0.5.0 "You can't do that on stage anymore" orchestrating the show
Jun 03 15:55:59 debian10 ethercalc[3647]: Connected to Redis Server: localhost:6379
At this point, EtherCalc is started and listening on port 8080. You can verify it with the following command:
# ss -antpl | grep 8080
This is the output that you should get:
LISTEN 0 128 0.0.0.0:8080 0.0.0.0:* users:(("node",pid=3647,fd=18))
Configure Nginx as a Reverse Proxy for EtherCalc
Next, create an Nginx virtual host configuration file to serve EtherCalc on port 80:
# nano /etc/nginx/conf.d/ethercalc.conf
And then add the following lines:
upstream ethercalc {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name ether.example.com;
location / {
proxy_pass http://ethercalc/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
}
}
Save the file and then restart the Nginx service to apply the changes with the following command:
# systemctl restart nginx
Access EtherCalc
Now, access EtherCalc using the URL http://ether.example.com. You should see EtherCalc as in the following screenshot:
Next, click on the "Create Spreadsheet" tab. You should see the following image:
Now, you can easily create a new spreadsheet or edit the existing spreadsheet from the web browser.
Conclusion
In the above tutorial, you've learned how to install EtherCalc on Debian 10. You've also learned how to configure Nginx as a reverse proxy to access the EtherCalc through port 80. We hope that this useful for you.
If you have questions, don't hesitate to send an e-mail to support@clouding.io. We´ll be glad to answer them.