Problem with accessing Baserow’s API from within a docker container

I hit this same issue and tried a few different things until I found something that I believe is working.

The key pieces seem to be…

  1. Using the same non-localhost hostname in the “docker network” settings and in the “external network” (DNS/hosts file)
  2. Mapping port 80 to some other, available, external port (which is the aspect of this that probably makes all of it necessary)
  3. Setting the BASEROW_PUBLIC_URL to have both the hostname and the external port
  4. Adding the hostname (not URL - i.e. no protocol / no port) to BASEROW_EXTRA_ALLOWED_HOSTS
  5. Using the docker-internal-hostname (default port 80) URL in n8n (i.e. without appending the mapped external port)

The docker-compose for baserow looks like this:

services:
  baserow:
    container_name: baserow
    hostname: baserow
    image: baserow/baserow:1.29.3
    environment:
      BASEROW_PUBLIC_URL: 'http://baserow:8980'
      BASEROW_EXTRA_ALLOWED_HOSTS: 'baserow'
    ports:
      - "8980:80"
      - "8943:443"
    volumes:
      - baserow_data:/baserow/data
volumes:
  baserow_data:

The n8n credentials item has:

Host: `http://baserow`

External DNS / name resolution

Hostname baserow (outside docker) resolves to the docker-host machine’s address (using the /etc/hosts file).

The baserow UI is reachable from a browser at

http://baserow:8980/workspace/...

Note about “localhost”

Not sure this would work without assigning a hostname other than localhost both inside and outside Docker.