How to Set Up Baserow (with SSL)

Learn how to set up the Baserow open source self-hosted database as a spreadsheet application (Airtable alternative) in a secure manner.
Jan 22, 2023
5 min

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.

  1. Setting up a PostgreSQL relational database (optional).
  2. Setting up an instance of Baserow on a server.

Note: You can use the Baserow Documentation for more information.

Set up the Relational Database

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.

Sign up to Digital Ocean with this referral link and get $200 in credit over 60 days: https://m.do.co/c/9d1115abd57c.

Step One: Install the Baserow Prerequisites

A prerequisite to the Baserow Docker Installation is Docker.

You can install Docker on Ubuntu 22.04 using the following article: How to Install and Use Docker on Ubuntu 22.04. If you set up your server by starting a droplet, then skip to step one of that guide. Step 2 and 3 are optional while step 4+ is NOT required to set up Baserow.

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 MB of 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.

Basic Installation

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.

docker run \
-d \
 - name baserow \
-e BASEROW_PUBLIC_URL=http://localhost \
-v baserow_data:/baserow/data \
-p 80:80 \
-p 443:443 \
 - restart unless-stopped \
baserow/baserow:1.13.3
Baserow Setup Admin Signup Page
Baserow Admin Signup
Baserow User Dashboard
Baserow User Dashboard
Baserow Smart Spreadsheet Project
Baserow Smart Spreadsheet Project

Production Installation

The Baserow Documentation provides a list of examples to set up the application for production-usage with external features (i.e PostgreSQL, Redis, Email). A table of environment variables used to configure the application are provided in Configuring Baserow. While Baserow does NOT require you to perform any special steps for a production installation, keep in mind the steps to Backup and Restore Baserow.

Private Installation

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.

  1. Disable Allow creating new accounts in the Settings (Admin > Settings > Account Restrictions).
  2. 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 Disable Account Signup Steps
Disable Signups in Baserow

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.

docker run \
-d \
 - name baserow \
-e BASEROW_PUBLIC_URL=https://subdomain.domain.tls \
-e BASEROW_CADDY_ADDRESSES=https://subdomain.domain.tls \
-v baserow_data:/baserow/data \
-p 80:80 \
-p 443:443 \
 - restart unless-stopped \
baserow/baserow:latest

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.

Baserow SSL Domain
Congratulations!

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.

For more information on securing a Digital Ocean Droplet, read Recommended Droplet Setup and watch Securing Your Droplet.

Need Help?

Want to save time from the efforts of a technical setup? Baserow provides hosted services for your Baserow project. Get started at https://baserow.io/.

Read More

link