opam
opam is a free, source-based package manager for OCaml.
What opam is
opam is a free, source-based package manager for OCaml. It handles opam package definitions and archives, resolves dependencies, supports lockfiles, and allows offline installation. Multiple OCaml compiler versions can be installed simultaneously, while switches create separate environments with their own compiler, prefix, and installed packages. This supports keeping project setups apart or testing different compiler versions. Package sources can be pinned to a version, local path, archive, or Git, Mercurial, or Darcs repository. The default community repository is opam.ocaml.org, and third-party repositories can be added or used instead. Commands cover searching, installing, removing, updating, and upgrading packages. Precompiled binaries are listed for Linux, macOS, FreeBSD, OpenBSD, NetBSD, and Windows, with system-package-manager and source builds also described. On Linux, build, install, and removal instructions run in a sandbox that the FAQ says is guaranteed not to affect the system. The homepage lists 4,679 packages. Software Heritage archives may be used when a package source is unavailable. Bug reports and feature requests go through the issue tracker.
Good
- Free package manager for OCaml
- Supports isolated switch environments
- Handles dependency resolution and lockfiles
- Allows offline installation
- Runs on Linux, macOS, Windows, and BSD
Watch out
- Focused on OCaml packages
- Uses source-based package management
- Linux sandboxing is platform-specific
Who it suits
opam suits OCaml developers who need dependency management, isolated compiler environments, lockfiles, or offline installation. It supports Linux, macOS, Windows, and BSD systems.
Verdict
opam provides broad platform support and flexible, isolated OCaml environments. Its repository, pinning, lockfile, and offline features fit development workflows that need repeatable package setups.
The facts
Each one read from opam's own pages, with the date it was checked.
What it does
- Commercial services
- OCamlPro provides commercial support, training, and consulting for opam.checked 8 Oct 2026
- Compiler installations
- opam supports multiple simultaneous compiler installations.checked 8 Oct 2026
- Compiler versions
- It supports multiple simultaneous OCaml compiler installations.checked 8 Oct 2026
- Dependency resolution
- Yeschecked 22 Sep 2026
- Development workflow
- It supports a Git-friendly development workflow.checked 8 Oct 2026
- External archive
- If a package source is not found, opam can try to retrieve it from Software Heritage archives.checked 8 Oct 2026
- Installation methods
- The install guide describes binary installation, system package managers, and building from source.checked 8 Oct 2026
- Isolated environments
- A switch can have its own prefix, installed packages, and compiler version, allowing separate development environments.checked 8 Oct 2026
- Lockfile support
- Yeschecked 22 Sep 2026
- Offline installation
- Yeschecked 22 Sep 2026
- Package constraints
- It supports flexible package constraints.checked 8 Oct 2026
- Package count
- The homepage lists 4,679 packages.checked 8 Oct 2026
- Package formats
- opam package definition files and archiveschecked 22 Sep 2026
- Package operations
- The usage guide describes commands to search, install, remove, update, and upgrade packages.checked 8 Oct 2026
- Package repositories
- opam uses the community repository at opam.ocaml.org by default, and third-party repositories can be added or used instead.checked 8 Oct 2026
- Package sources
- Packages can be pinned to a version, local path, archive, or Git, Mercurial, or Darcs repository.checked 8 Oct 2026
- 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.checked 8 Oct 2026
- Purpose
- opam is a source-based package manager for OCaml.checked 8 Oct 2026
- Repositories
- opam uses the community software repository by default and can also use third-party repositories.checked 8 Oct 2026
- Support
- Bug reports and feature requests go to opam's issue tracker; general queries can be addressed on the OCaml-platform mailing list.checked 8 Oct 2026
Money
- Free plan
- Yeschecked 22 Sep 2026
Where it runs
- Linux downloads
- The install page lists precompiled binaries for Linux amd64, arm64, ppc64le, s390x, riscv64, armhf, and i686.checked 8 Oct 2026
- 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.checked 8 Oct 2026
- macOS downloads
- The install page provides precompiled macOS amd64 and arm64 binaries and lists Homebrew and MacPorts packages.checked 8 Oct 2026


