Setup OCaml with Dune in Under a Minute
Install Dune
Copy & Install
Getting Started
You can create and run your first hello-world program using Dune like this
Run
$ PROJECT=hello_world
$ dune init proj "$PROJECT"
$ cd "$PROJECT"
$ # To opt in to using dune for package management
$ cat > dune-workspace <<EOF
> (lang dune 3.21)
> (pkg enabled)
> EOF
$ dune exec "$PROJECT"
Editor Configuration
Here is how to configure some popular editors for OCaml using the Dune nightly.
Visual Studio Code
Install version 1.21.0 or higher of the vscode-ocaml-platform plugin for Visual Studio Code. By default it assumes that you'll be using Opam to install ocamllsp. To configure it to work with the Dune nightly, add the following to your settings.json file:
// settings.json
{
"ocaml.sandbox": {
"kind": "custom",
"template": "$prog $args"
}
}
Neovim
The easiest way to configure Neovim for OCaml is by installing the lspconfig package. The default configuration will work with the Dune nightly, so just enable it with:
-- init.lua
require'lspconfig'.ocamllsp.setup{}
Emacs
Emacs users will need to add the Dune nightly's bin directory to their exec-path and PATH variables. The rest of the configuration is the same as for regular OCaml. Here's a minimal example configuration for Emacs that uses use-package to install packages:
; init.el
; add the dune nightly bin path to exec-path and PATH
(add-to-list 'exec-path "~/.local/bin" t)
(setenv "PATH" (concat (expand-file-name "~/.local/bin") ":" (getenv "PATH")))
; mode for editing ocaml files
(use-package tuareg)
; lsp client mode
(use-package lsp-mode
:init
; start ocamllsp automatically for ocaml files
:hook ((tuareg-mode . lsp)))
Zed
No manual configuration is necessary! Just install the OCaml extensions for Zed (you should get a pop-up the first time you edit an OCaml file).
For more information on Dune and Package Management, check the Dune docs, in particular the the package management tutorial and the the explanation how it works.
Share Feedback
We are excited to learn from your experience with the Dune nightly, so feel encourage to tell us what you think
Frequently Asked Questions
What is the Dune nightly?
The Dune nightly provides early access to the latest development of Dune without having to wait for a stable release. It's a continuous initiative to involve the community in testing and refining upcoming developments.
Is it stable?
No. The Developer nightly is built from unreleased code on the head of the development branch. If you use the nightly, expect bugs and please report them to ocaml/dune. For a stable release of OCaml, please follow the installation guide on OCaml.org. Binary installations of stable release are available atDune Binary Installer.
Can I install the binary on Windows?
No, not yet. Watch this space for news!
Can I build the nightly of Dune from sources?
Yes. The nightly is just a binary distribution of the latest Dune features.
Check out the installation instructions in the Dune repository on how to do a source build of Dune.
Can I access these features from a version of Dune managed by opam?
Yes, but we can't guarantee that every feature of the nightly will make it as-is into future releases.
To enable these features make sure you are pinning Dune to the development version:
$ opam pin add dune --dev-repo
Manual Installation
In this section you’ll find instructions to manually install the Dune nightly, and verify the installation. This is recommended for advanced users, or if you want to understand where the binaries come from.
Featured Downloads
This is the latest release of the Dune nightly. See the release history section for all past releases.
Installing the binary
After downloading a binary release of Dune, make it executable and place it somewhere reachable by your PATH:
Run
$ tar xzf dune-<arch>.tar.gz
$ mv dune-<arch>/dune ~/.local/bin/
You can verify your installation by running:
$ dune --version
Nightly build 2025-11-25T10:09:55Z, git revision 95431847d306a9b7b94748ec2c2903c989f34c34
Verifying the Dune binary
To ensure trust in the binary distribution, we generate a build certificate associated with the Github Actions pipeline where the binaries are built. Once you download this certificate, you can use the gh tool to verify it with the following command:
$ gh attestation verify ./dune -R ocaml-dune/binary-distribution --bundle attestation.jsonl
Last Month Release History
Here is a list of the 30 latest builds of the Dune nightly.
dune nightly-2025-12-03
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | cb5405 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | cb5405 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | cb5405 |
dune nightly-2025-12-02
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | e2401c | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | e2401c | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | e2401c |
dune nightly-2025-11-30
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | f783f8 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | f783f8 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | f783f8 |
dune nightly-2025-11-29
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | fefffb | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | fefffb | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | fefffb |
dune nightly-2025-11-28
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 1a9172 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 1a9172 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 1a9172 |
dune nightly-2025-11-27
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 6b7bdf | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 6b7bdf | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 6b7bdf |
dune nightly-2025-11-26
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 0ee862 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 0ee862 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 0ee862 |
dune nightly-2025-11-25
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 84e072 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 84e072 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 84e072 |
dune nightly-2025-11-21
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | a268d9 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | a268d9 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | a268d9 |
dune nightly-2025-11-20
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 194210 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 194210 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 194210 |
dune nightly-2025-11-19
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 605f30 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 605f30 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 605f30 |
dune nightly-2025-11-18
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 1538b0 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 1538b0 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 1538b0 |
dune nightly-2025-11-17
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 64482b | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 64482b | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 64482b |
dune nightly-2025-11-16
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 7bfd20 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 7bfd20 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 7bfd20 |
dune nightly-2025-11-15
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 7e320d | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 7e320d | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 7e320d |
dune nightly-2025-11-14
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 63857f | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 63857f | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 63857f |
dune nightly-2025-11-13
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | aa803c | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | aa803c | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | aa803c |
dune nightly-2025-11-12
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | e4798d | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | e4798d | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | e4798d |
dune nightly-2025-11-11
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 21c3e9 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 21c3e9 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 21c3e9 |
dune nightly-2025-11-08
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 78236e | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 78236e | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 78236e |
dune nightly-2025-11-07
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 234611 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 234611 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 234611 |
dune nightly-2025-11-06
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 251578 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 251578 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 251578 |
dune nightly-2025-11-05
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | a6d781 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | a6d781 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | a6d781 |
dune nightly-2025-11-04
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | a677f9 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | a677f9 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | a677f9 |
dune nightly-2025-11-03
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 1fb4ec | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 1fb4ec | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 1fb4ec |
dune nightly-2025-11-02
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 03f80c | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 03f80c | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 03f80c |
dune nightly-2025-11-01
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 680e1b | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 680e1b | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 680e1b |
dune nightly-2025-10-31
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 5ab19c | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 5ab19c | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 5ab19c |
dune nightly-2025-10-30
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 821ae4 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 821ae4 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 821ae4 |
dune nightly-2025-10-29
| File Name | Kind | OS | Arch | Commit | Certificate |
|---|---|---|---|---|---|
| dune-aarch64-apple-darwin.tar.gz | Archive | macOS | aarch64 | 04d495 | |
| dune-x86_64-apple-darwin.tar.gz | Archive | macOS | x86-64 | 04d495 | |
| dune-x86_64-unknown-linux-musl.tar.gz | Archive | Linux | x86-64 | 04d495 |
