opam
opam.ocaml.org
- Free plan
- Windows
- macOS
- Linux
What opam is
opam is a free, source-based package manager for OCaml. It installs packages from opam package definition files and archives, resolves dependencies, supports lockfiles, and can work offline. The tool supports Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD, with installation through precompiled binaries, system package managers, or source builds. Multiple OCaml compiler versions can be installed at the same time. Switches create separate prefixes containing their own compiler and installed packages, which helps keep project environments apart. Package constraints are flexible, and sources can be pinned to a version, local path, archive, or Git, Mercurial, or Darcs repository. The default community repository is opam.ocaml.org, while third-party repositories can also be used. Commands cover searching, installing, removing, updating, and upgrading packages. Linux build, install, and remove instructions run in a sandbox described by the FAQ as isolated from the system. The homepage lists 4,679 packages.
Who it suits
opam suits OCaml developers who need dependency management, multiple compiler versions, and separate project environments. It also fits teams working across Linux, macOS, Windows, or BSD systems.
Good to know, and what to watch
- Free plan
- Supports multiple OCaml compiler installations
- Separate switch-based project environments
- Dependency resolution, lockfiles, and offline installation
- Works with third-party package repositories
- Source-based package manager
- Package availability depends on repositories
- Windows support uses an amd64 binary and PowerShell installer
The verdict
opam combines OCaml package management with isolated switches, flexible source pinning, and broad operating-system support. Its free plan and offline capabilities make it practical for structured OCaml development.
What the maker publishes
- Commercial services
- OCamlPro provides commercial support, training, and consulting for opam. source
- Compiler installations
- opam supports multiple simultaneous compiler installations. source
- Compiler versions
- It supports multiple simultaneous OCaml compiler installations. source
- Dependency resolution
- Yes source
- Development workflow
- It supports a Git-friendly development workflow. source
- External archive
- If a package source is not found, opam can try to retrieve it from Software Heritage archives. source
- Free plan
- Yes source
- Installation methods
- The install guide describes binary installation, system package managers, and building from source. source
- Isolated environments
- A switch can have its own prefix, installed packages, and compiler version, allowing separate development environments. source
- Linux downloads
- The install page lists precompiled binaries for Linux amd64, arm64, ppc64le, s390x, riscv64, armhf, and i686. source
- Linux sandboxing
- On Linux, package build, install, and remove instructions run in a sandbox that the FAQ says is guaranteed not to affect the system. source
- Lockfile support
- Yes source
- macOS downloads
- The install page provides precompiled macOS amd64 and arm64 binaries and lists Homebrew and MacPorts packages. source
- Offline installation
- Yes source
- Package constraints
- It supports flexible package constraints. source
- Package count
- The homepage lists 4,679 packages. source
- Package formats
- opam package definition files and archives source
- Package operations
- The usage guide describes commands to search, install, remove, update, and upgrade packages. source
- Package repositories
- opam uses the community repository at opam.ocaml.org by default, and third-party repositories can be added or used instead. source
- Package sources
- Packages can be pinned to a version, local path, archive, or Git, Mercurial, or Darcs repository. source
- Project environments
- Switches provide separate installation prefixes, each with its own compiler and installed packages, for uses such as testing projects with different OCaml versions. source
- Purpose
- opam is a source-based package manager for OCaml. source
- Repositories
- opam uses the community software repository by default and can also use third-party repositories. source
- Support
- Bug reports and feature requests go to opam's issue tracker; general queries can be addressed on the OCaml-platform mailing list. source
Checked against the maker's pages on 8 Oct 2026.