# Install h2 with Homebrew, Nix

Java SQL database. Version 2.4.240 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:h2
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install h2
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#h2
```

  Evidence: nixpkgs package indexes: pkgs/by-name/h2/h2/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:h2
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/h2>
- **Version:** 2.4.240
- **Source summary:** Java SQL database
- **Homepage:** <https://www.h2database.com/>
- **Repository:** <https://github.com/h2database/h2database>
- **Upstream docs:** <https://h2database.github.io/html/commands.html>
- **License:** MPL-2.0
- **Source archive:** <https://github.com/h2database/h2database/releases/download/version-2.4.240/h2-2025-09-22.zip>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- h2 (cli)
- h2 (alias)

## Dependencies

- openjdk

## Install behavior

- Post-install hook: not defined
- Service: declared
- Bottle: available on all

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.4.240
- Local data: ok
- Upstream repository: https://github.com/h2database/h2database
- info: No package-manager update timestamp was available.
- info: No cached GitHub release or tag data was available.
## Project history and usage

H2 is a Java SQL database engine designed for embedded and server use through standard SQL and JDBC. Its package history matters because it became one of the default lightweight relational databases for Java development, tests, demos, local tools, and applications that need an embeddable database without running a separate server.

### Project history

The official H2 history says development started in May 2004 and the database was first published on December 14, 2005. The original author, Thomas Mueller, was also the original developer of Hypersonic SQL; after he joined PointBase and discontinued Hypersonic SQL work, the HSQLDB Group continued that codebase. H2 means Hypersonic 2, but the official history emphasizes that H2 does not share code with Hypersonic SQL or HSQLDB and was built from scratch.

The project chose Java for portability, simpler integration with Java applications, Unicode support, security advantages over native code, and faster development of algorithms rather than platform-specific memory-management work. The H2 feature documentation presents the result as a fast open source database engine with JDBC API support, embedded and server modes, disk or in-memory databases, transaction support, multi-version concurrency, a browser console, encryption, full-text search, and a small jar footprint.

H2's repository and documentation structure reflect its dual role as library and tool. The README points Java users to Maven coordinates, tutorial pages, SQL command documentation, functions, data types, issue tracking, mailing-list/forum support, and Stack Overflow usage for framework integration questions.

### Adoption history

H2 adoption came from Java developers who needed a relational database that could run inside the same JVM for tests, demos, desktop apps, command-line tools, and server applications. The official features page highlights embedded mode as the fastest and easiest connection mode, while also documenting server and mixed modes for multiple clients.

The README and GitHub repository show a broad open-source footprint: thousands of stars, many forks, thousands of commits, Maven dependency instructions, and documentation aimed at both SQL users and Java integrators. The supplied package facts list Homebrew and Nix packages, while the more important adoption path for Java is the Maven coordinate `com.h2database:h2` shown by the project README.

### How it is used

Common H2 usage includes embedding the database in Java applications through JDBC, running in-memory databases for tests, using file-backed local databases, starting server mode for remote JDBC or ODBC-over-TCP/IP connections, using the browser-based Console, and applying compatibility modes for databases such as DB2, Derby, HSQLDB, MS SQL Server, MySQL, Oracle, and PostgreSQL.

H2 also ships command-line and operational tooling around the database engine. Package managers expose an `h2` executable in addition to the Java jar ecosystem, which is useful for local console workflows, demos, and scripted development setups.

### Why package nerds care

H2 is a package-nerd staple because it collapses a database dependency into a small Java artifact. That makes test suites, examples, development servers, and teaching environments easier to package: no daemon, no external service, no local database bootstrap, and in-memory mode when persistence is unnecessary.

It also has a long tail of compatibility and security implications. Frameworks often include H2 for tests, so packagers and maintainers care about version behavior, SQL compatibility modes, file format changes, console exposure, and transitive dependency updates even when H2 is not the production database.

### Timeline

- 2004: H2 development started in May.
- 2005: H2 was first published on December 14.
- 2000s: H2 established itself as a from-scratch successor in spirit to Hypersonic SQL, separate from HSQLDB code.
- 2010s: H2 became common in Java tests, embedded applications, examples, and framework development setups.
- 2020s: The project documented a small Java footprint, embedded/server/mixed modes, compatibility modes, Maven usage, and package-manager availability.

### Related projects

- H2 is historically related to Hypersonic SQL and HSQLDB through Thomas Mueller's earlier work and the name Hypersonic 2, but the H2 codebase is separate. It is also commonly compared with Apache Derby, SQLite, HyperSQL, embedded PostgreSQL test setups, and Java frameworks that use JDBC databases in development or tests.

### Sources

- <https://github.com/h2database/h2database>
- <https://raw.githubusercontent.com/h2database/h2database/master/README.md>
- <https://raw.githubusercontent.com/h2database/h2database/master/h2/src/docsrc/html/features.html>
- <https://raw.githubusercontent.com/h2database/h2database/master/h2/src/docsrc/html/history.html>
- <https://www.h2database.com/html/history.html>


## Security Notes

broad file, network, media, or database tool signal. formula declares a Homebrew service.

- **Geiger risk:** orange / medium
- broad file, network, media, or database tool signal
- formula declares a Homebrew service

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** h2
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Nix - h2: normalized package name match | nixpkgs package indexes: pkgs/by-name/h2/h2/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [openjdk](https://www.automicvault.com/pkg/brew/openjdk/) - Runtime dependency declared by Homebrew.
- [h3](https://www.automicvault.com/pkg/brew/h3/) - Package name indicates the same formula family.
- [cql](https://www.automicvault.com/pkg/brew/cql/) - Shares av.db curated category or tags: cli, data, database, databases, sql.
- [hbase](https://www.automicvault.com/pkg/brew/hbase/) - Shares av.db curated category or tags: cli, data, database, databases, java.
- [neo4j](https://www.automicvault.com/pkg/brew/neo4j/) - Shares av.db curated category or tags: cli, data, database, databases, java.
- [rocksdb](https://www.automicvault.com/pkg/brew/rocksdb/) - Shares av.db curated category or tags: cli, data, database, databases, embedded-database.
- [tokyo-cabinet](https://www.automicvault.com/pkg/brew/tokyo-cabinet/) - Shares av.db curated category or tags: cli, data, database, databases, embedded-database.
- [apache-geode](https://www.automicvault.com/pkg/brew/apache-geode/) - Shares av.db curated category or tags: cli, data, database, databases.
- [cassandra](https://www.automicvault.com/pkg/brew/cassandra/) - Shares av.db curated category or tags: cli, data, database, databases.
- [cdb](https://www.automicvault.com/pkg/brew/cdb/) - Shares av.db curated category or tags: cli, data, database, databases.

## Combined YAML source

View the package source record on GitHub. [combined/h2.yml](https://github.com/automic-vault/db/blob/main/combined/h2.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
