Creating and managing information in a database doesn’t have to be complex or time consuming. In fact, it can be as easy as using a spreadsheet. The article “When to Use a Database (as a Spreadsheet)” showcases why you should use a database as a spreadsheet. This guide covers how to set up a database as a spreadsheet using Baserow.
What is Baserow?
Baserow is an open source no-code platform that turns your PostgreSQL database into a smart spreadsheet. A no-code development platform allows programmers and non-programmers to create application software through graphical user interfaces instead of traditional programming methods. Baserow describes itself as an Airtable alternative, which is a platform for building collaborative applications via smart spreadsheets. Since Baserow is open source, this means you can achieve the functionality of Airtable — by self-hosting an instance of Baserow — for free!
Baserow uses an MIT license with an exception for certain directories. This means a majority of the project is FREE to use and modify as you wish.
How to Set Up Baserow
A full setup of Baserow entails two steps.
Setting up a PostgreSQL relational database (optional).
A relational database provides data storage and query functionality. Baserow currently supports the PostgreSQL relational database . This article will not focus on setting up a database due to the variety of methods available. In addition, Baserow doesn’t require you to set up a database to use it. However, do note that connecting to an external database requires its connection credentials.
Set up the Baserow Instance
The Baserow web application (source on GitLab) provides the database as a spreadsheet functionality which includes the graphical interface used to interact with your data. This application must be run on a computer (server) that is able to access your database from a remote connection unless you are hosting the database in the same server as the Baserow instance (localhost). In any case, you must set up a running instance of the application.
A variety of methods to set up an instance of the Baserow application are provided in the Baserow Documentation (Installation). While you are able to set up this application on any computer, this guide assumes that you want your Baserow instance to be available from anywhere (on your desktop or mobile device) and at all times. As a result, you should start with a physical or virtualized server that has access to the internet. In this guide, a virtualized server from Digital Ocean (Basic Droplet) will be used with the Ubuntu 22.04 LTS Operating System to install Baserow using Docker.
At the current time, it’s recommended that your machine allocates at least 2 GB of RAM during the installation of Baserow. However, Baserow itself only requires around 512 MBof RAM during runtime. If your machine doesn’t have that much, DON’T WORRY! You can add memory on Ubuntu 22.04 via Swap Space using the following article: How To Add Swap Space on Ubuntu 22.04. In Step 3, add 2 GB of Swap Space using sudo fallocate -l 2G /swapfile. Step 6 is optional.
Step Two: Install the Baserow Instance (via Docker)
The steps to install Baserow using a Docker command are found in the Baserow Documentation (Install via Docker). Alternatively, use ONE of the command configurations below from the terminal of your server. In any case, a docker image will be pulled from Baserow’s repository on Docker Hub.
A basic installation of Baserow sets up an instance using the default configuration. This will start your application on port 80 (binding 80 on the container to 80 on the machine) and port 443 (binding 443 on the container to 443 on the machine) using a PostgreSQL database.
An installation that exposes the application externally allows anyone who is able to access your Baserow installation to create an account on it (with the first being an Admin). If you prefer to only allow accounts to be created from the backend, there are two ways to do so.
Disable Allow creating new accounts in the Settings (Admin > Settings > Account Restrictions).
Start the Baserow Instance on the localhost (i.e basic installation), set up the admin account, disable the creation of new accounts, then use docker commit to restart the container of your Baserow instance with external access.
Baserow does NOT use telemetry in self-hosted installations (source).
Set up Baserow with SSL (HTTPS)
Without a Secure Socket Layer (SSL), attackers are able to read and modify information that is transferred between your server and the server it’s sent to. This would allow them to perform problematic actions such as sniffing your Baserow credentials (once entered), spoofing the instance, and reading data that is sent from your database. As a result, it’s recommended to add an SSL certificate to your server and interact with the application over the HTTPS protocol. Otherwise, configure a firewall to restrict the IPs your server can receive inbound connections from (in the next section).
Step One: Set Up a Domain
If you haven’t already, set up a domain that you can use to access your application from and point it to the IPv4 address of your server. As a reminder, you can do this by creating an A record in your DNS pointing your subdomain.domain.tls to the IPv4 address.
Step Two: Start a Proxied Baserow Container
Baserow provides an easy way for you to set up an instance on a domain with HTTPS using environment variables (BASEROW_PUBLIC_URL and BASEROW_CADDY_ADDRESSES).
Start a proxied Baserow container using the following command.
You may have to wait a few minutes for the application to be ready for requests. Then, access your instance from the browser. It should indicate that you are accessing from HTTPS.
Configure the Server Firewall
If you haven’t already, you must configure the network firewall of your server so that you can only access the server (containing the Baserow instance) from certain ports. In Digital Ocean, this is as simple as using the provided firewall feature. As an example, provide inbound access to port 22 and 443, then restrict access to port 80 (with the reverse proxy configured). Alternatively, use the universal firewall (ufw) command-line tool to configure the firewall on Ubuntu.