LinuxCommandLibrary

datasette

TLDR

Serve a SQLite database

$ datasette [database.db]
copy
Serve multiple databases
$ datasette [db1.db] [db2.db]
copy
Serve on specific port
$ datasette -p [8080] [database.db]
copy
Serve with read-only mode (default)
$ datasette --immutable [database.db]
copy
Create database package for deployment
$ datasette package [database.db] -t [myapp:latest]
copy
Install a plugin
$ datasette install [datasette-vega]
copy
Publish to cloud provider
$ datasette publish [cloudrun] [database.db] --service=[myservice]
copy

SYNOPSIS

datasette [options] database.db...

DESCRIPTION

Datasette is a tool for exploring and publishing SQLite databases as interactive websites and JSON APIs. It instantly creates a browsable interface for any SQLite database with faceted search, SQL querying, and automatic API endpoints.
Every table gets a paginated HTML view, JSON API, and CSV export. Custom SQL queries can be executed through the web interface. Plugins extend functionality with visualization, authentication, and data transformation.
Datasette excels at publishing data: government datasets, research data, logs, and any structured data. The publish command deploys to cloud platforms with a single command.

PARAMETERS

-p, --port port

Port to serve on (default: 8001).
-h, --host host
Host to bind to (default: 127.0.0.1).
--immutable db
Mark database as immutable (enables caching).
-m, --metadata file
YAML/JSON metadata file.
--load-extension ext
Load SQLite extension.
-o, --open
Open browser on startup.
--cors
Enable CORS headers.
--setting key value
Set configuration option.
--secret secret
Secret key for signing.
serve
Serve databases (default command).
publish target
Deploy to cloud (cloudrun, vercel, heroku, fly).
package
Create Docker image.
install plugin
Install Datasette plugin.

CAVEATS

Designed for read-only access by default; write operations require plugins and configuration. Large databases may need optimization for performance. Some SQLite features (full-text search) require building with extensions. Public deployment needs authentication consideration.

HISTORY

Datasette was created by Simon Willison (co-creator of Django) and first released in 2017. It emerged from his interest in data journalism and making databases accessible. The project pioneered the concept of "small data" publishing and has been used for journalism, government transparency, and data exploration. Datasette won a Mozilla Open Source Award in 2021.

SEE ALSO

Copied to clipboard