Install with Docker compose

Any questions, problems or suggestions with this guide? Ask a question in our community or contribute the change yourself at .

Installing requirements

If you haven’t already installed docker and docker-compose on your computer you can do so by following the instructions on and

Docker-compose version 3.4 and Docker version 19.03 are the minimum versions required by our provided files.

If you want to get the docker-compose.yml via git then you can install it by following .

After installing all the required software you should be able to run the following commands in your terminal.

$ docker -v
Docker version 20.10.12, build e91ed57
$ docker-compose -v
docker-compose version 1.26.2, build eefe0d31
$ git --version
git version 2.25.1

If all commands return something similar as described in the example, then you are ready to proceed!

Downloading the Baserow example docker-compose.yml

You can download the example Baserow docker-compose.yml by either directly downloading the file from and running:

curl -o docker-compose.yml
curl -o Caddyfile
docker-compose up -d

or by directly cloning our git repo so you can get updates easier:

$ cd ~/baserow
$ git clone --depth=1 --branch master
$ cd baserow
$ docker-compose up -d
# To update to the latest run:
docker-compose down
git pull
docker-compose up -d

Baserow will take a couple of minutes on your first startup before it works. This is because the templates need to be installed.

There is a security flaw with docker and the ufw firewall. By default docker when exposing ports on will bypass any ufw firewall rules and expose the above container publicly from your machine on its network. If this is not intended then please set HOST_PUBLISH_IP to so Baserow can only be accessed from the machine it is running on. Please see for more information and how to setup ufw to work securely with docker.


To use this docker-compose.yml to run Baserow you must set the three required environment variables in the x-backend-required-variables section inside the docker-compose.yml and review the variables in the x-common-important-variables section. If you receive the following error it is because you need to set the required environment variables first:

ERROR: Missing mandatory value for "environment" option interpolating

If you are upgrading from Baserow 1.8.2 or earlier please read the additional section below.

See Configuring Baserow for information on the other environment variables you can configure.

How to set environment variables

You can set these variables by using docker-compose env file (

  1. Copy the .env.example file found in the root of Baserows repository ( to .env:
curl -o .env
  1. Edit .env and provide values for the missing environment variables.
  2. docker-compose up

Alternatively you can set these variables by either running docker-compose with the environment variables set on the command line (fill in secure values first):


Upgrading from Baserow 1.8.2’s docker-compose file

If you were previously using a separate domain this is no longer needed. Baserow will now work on a single domain accessing the api at

To upgrade from 1.8.2’s docker-compose file from inside the Baserow git repo you need to:

  1. Stop your existing Baserow install when safe to do so: docker-compose down
  2. git pull
  3. Copy .env.example to .env and edit .env filling in the missing variables below:
    • SECRET_KEY to a secure value, existing logins sessions will be invalidated.
    • DATABASE_PASSWORD to a secure password (this defaulted to ‘baserow’ before, in step 3 we are going to change the database users password to the value you set)
    • REDIS_PASSWORD to a secure password.
    • WEB_FRONTEND_PORT back to 3000 if you want to continue accessing Baserow on that port (it now defaults to 80).
    • BASEROW_PUBLIC_URL to the URL/IP/Domain you were using access Baserow remotely (it must begin with http:// or https://). If you have set WEB_FRONTEND_PORT to anything but 80 you must append it to the end of BASEROW_PUBLIC_URL.
    • BASEROW_CADDY_ADDRESSES configures which addresses the new internal Caddy reverse proxy listens on. By default, it will serve http only, enable automatic https by setting to Append ,http://localhost if you still want to be able to access Baserow from localhost.
  4. Run the command below which will change the baserow postgresql users password to what you have set in step 1 in the .env file (no need to edit the command):
docker-compose run --rm backend bash -c "PGPASSWORD=baserow psql -h db -U baserow -c \"ALTER USER baserow WITH PASSWORD '$DATABASE_PASSWORD';\" && echo 'Successfully changed Baserow's db user password'"
  1. docker-compose up -d

How To

Running management commands

You can see and run the Baserow backend management commands like so:

docker-compose exec backend /baserow/backend/docker/ help

View the logs

$ docker-compose logs 

Run Baserow alongside existing services

Baserow’s docker-compose files will automatically expose the caddy service on your network on ports 80 and 433 by default. If you already have applications or services using those ports the Baserow service which uses that port will crash. To fix this you can set the WEB_FRONTEND_PORT variable to change the default of port 80 and WEB_FRONTEND_SSL_PORT to change the default port of 443.

$ WEB_FRONTEND_SSL_PORT=444 WEB_FRONTEND_PORT=3000 docker-compose up 

Using a Domain with automatic https

If you have a domain name and have correctly configured DNS then you can run the following command to make Baserow available at the domain with automatic https provided by Caddy.

Append ,http://localhost to BASEROW_CADDY_ADDRESSES if you still want to be able to access your server from the machine it is running on using http://localhost. See Caddy’s Address Docs for all supported values for BASEROW_CADDY_ADDRESSES.

docker-compose up

Behind a reverse proxy already handling ssl

docker-compose up

On a nonstandard HTTP port

docker-compose up

Disable automatic migration

You can disable automatic migration by setting the MIGRATE_ON_STARTUP environment variable to false (or any value which is not true) like so:

MIGRATE_ON_STARTUP=false docker-compose up -d

Run a one off migration

# Use run if you have stopped your docker-compose environment
docker-compose run backend manage migrate
# Use exec otherwise
docker-compose exec backend /baserow/backend/docker/ manage migrate

Disable automatic template syncing

You can disable automatic baserow template syncing by setting the SYNC_TEMPLATES_ON_STARTUP environment variable to false (or any value which is not true) like so:

SYNC_TEMPLATES_ON_STARTUP=false docker-compose up -d

Back-up your Baserow DB

  1. Please read the output of docker-compose run backend manage backup_baserow --help.
  2. Please ensure you only back-up a Baserow database which is not actively being used by a running Baserow instance or any other process which is making changes to the database.
mkdir ~/baserow_backups
# The folder must be the same UID:GID as the user running inside the container, which
# for the local env is 9999:9999, for the dev env it is 1000:1000 or your own UID:GID
# when using ./
sudo chown 9999:9999 ~/baserow_backups/ 
docker-compose run -v ~/baserow_backups:/baserow/backups backend backup -f /baserow/backups/baserow_backup.tar.gz 
# backups/ now contains your Baserow backup.

Restore your Baserow DB from a back-up

  1. Please read the output of docker-compose run backend manage restore_baserow --help
  2. Please ensure you never restore Baserow using a pooled connection but instead do the restoration via direct database connection.
  3. Make a new, empty database to restore the back-up file into, please do not overwrite existing databases as this might cause database inconsistency errors.
docker-compose run -v ~/baserow_backups:/baserow/backups backend restore -f /baserow/backups/baserow_backup.tar.gz