Build environment
Data appsBy 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):
- It installs dependencies with
npm install
, including running any user-defined install script; see below. - It builds your project with
npm run build
. For this step only, we inject any secrets you’ve defined as environment variables. - 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:
{
"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:
"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.
On-premises environments
EnterpriseLearn more about EnterpriseOn-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.
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.
To learn more about Enterprise, please contact our sales team at sales@observablehq.com.