Skip to content

Build environment

Data apps

By default, your data apps are built on the Observable Cloud environment on a Docker image, available here, running Debian 12 “bookworm”.

The environment first detects your preferred Node package manager, either npm or Yarn 1. Then (using the npm commands for example):

  1. It installs dependencies with npm install, including running any user-defined install script; see below.
  2. It builds your project with npm run build. For this step only, we inject any secrets you’ve defined as environment variables.
  3. It deploys with npm run deploy.

INFO

Currently, we do not support Yarn 2 (upvote #645), pnpm (#647), Bun (#646), or other JavaScript package managers.

Installed software

Our Docker image comes with some common languages, libraries, and utilities installed, including:

  • Node 20
  • Python 3.11
  • R 4.4
  • duckdb 1.0
  • Rust 1.81
  • Perl 5.36
  • csvkit
  • jq
  • optipng

…and more, all of which are listed in our Dockerfile.

INFO

If you are interested in passing your own Docker image to Observable Cloud, upvote #648.

Installing dependencies

For JavaScript, the environment will install whatever Node dependencies you define in package.json. We support either npm or Yarn 1, and choose based on whether you have a package-lock.json or a yarn.lock present.

In package.json, you can also define an install script, which will be run when we install those Node dependencies, and which can install packages for other languages.

For example, below we have a sample package.json. We’ve added the highlighted "install" line to install Python dependencies by passing pip a requirements.txt file at the root of our project directory:

json
{
  "type": "module",
  "private": true,
  "scripts": {
    "clean": "rimraf src/.observablehq/cache",
    "build": "observable build",
    "dev": "observable preview",
    "deploy": "observable deploy",
    "observable": "observable",
    "install": "pip install -r requirements.txt"
  },
  "dependencies": {
    "@observablehq/framework": "^1.11.0"
  },
  "devDependencies": {
    "rimraf": "^5.0.5"
  },
  "engines": {
    "node": ">=18"
  }
}

For R, if your data loaders call install.packages, you generally don’t need any extra scripts in package.json; the packages will be installed normally when the data loader runs. But if your data loaders use library or require to reference already-installed packages, you should use an install script in package.json to install them before the data loaders run; in this example, we install readr, dplyr, and tidyr from CRAN:

json
"install": "R --vanilla -e \"install.packages(c('readr', 'dplyr', 'tidyr'), repos='http://cran.us.r-project.org')\""

Cloud quotas and status

You can check the status of Observable Cloud and your workspace’s compute and storage quotas at the “Observable Cloud” link under “Resources” in the left sidebar.

Screenshot of a page called “Observable Cloud”, showing its status as “Operating normally”. The depicted workspace has used 0% of its compute quota and 12% of its storage quota.

On-premises environments

EnterpriseLearn more about Enterprise

On-premises (or “on-prem”) environments let your data stay on your network and never touch Observable’s servers. An environment includes a builder, to run your data and page loaders, and a server, to host the resulting data app.

The diagram is split into three sections: Observable servers, GitHub servers, and your private network. This shows that data only lives on your private network.
A high-level architectural diagram. The on-premises environment is in the dashed pink outline: a data app builder and a data app server.

Once your environment is configured, you can choose to use it in your app’s build settings. You can still use all the features of Observable Cloud, including secrets, schedules, segmentation, and analytics.

Screenshot of the build settings for a data app. The tab “Build settings” is selected. Under the “Build environment” section, you can choose from two radio buttons: Observable Cloud, labeled a hosted environment, or ACME data app builders, labeled an on-premises environment.

To learn more about Enterprise, please contact our sales team at sales@observablehq.com.