Setup OCaml with Dune in Under a Minute

The Dune nightly is a binary of the Dune development branch with a nightly release

This Dune installation is an UNSTABLE NIGHTLY RELEASE of Dune

Install Dune

Copy & Install (nightly)

curl -fsSL https://get.dune.build/install | sh

Copy & Install (current stable)

curl -fsSL https://get.dune.build/install | sh -s - --release 3.22.2

Copy & Install (latest stable)

curl -fsSL https://get.dune.build/install | sh -s - --release latest

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 build of the Dune nightly. See the build history section for all past builds.

Installing the binary

After downloading a binary build 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.json

Last Month Build History

Here is a list of the 30 latest builds of the Dune nightly.

dune nightly-2026-04-17
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64656f6c
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64656f6c
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64656f6c
dune nightly-2026-04-16
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch6422b59e
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-6422b59e
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-6422b59e
dune nightly-2026-04-15
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64e82bb6
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64e82bb6
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64e82bb6
dune nightly-2026-04-14
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch6443f34d
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-6443f34d
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-6443f34d
dune nightly-2026-04-13
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch641c124d
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-641c124d
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-641c124d
dune nightly-2026-04-12
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64db211c
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64db211c
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64db211c
dune nightly-2026-04-11
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64b768eb
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64b768eb
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64b768eb
dune nightly-2026-04-11
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64e2a017
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64e2a017
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64e2a017
dune nightly-2026-04-10
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch642b5923
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-642b5923
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-642b5923
dune nightly-2026-04-09
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch6443438a
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-6443438a
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-6443438a
dune nightly-2026-04-08
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64dfb865
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64dfb865
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64dfb865
dune nightly-2026-04-07
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch643a7d3f
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-643a7d3f
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-643a7d3f
dune nightly-2026-04-06
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64a97901
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64a97901
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64a97901
dune nightly-2026-04-05
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64a2496a
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64a2496a
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64a2496a
dune nightly-2026-04-04
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch6468ec7c
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-6468ec7c
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-6468ec7c
dune nightly-2026-04-03
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch648d89e2
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-648d89e2
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-648d89e2
dune nightly-2026-04-02
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64ad9c36
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64ad9c36
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64ad9c36
dune nightly-2026-04-02
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64e2a7db
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64e2a7db
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64e2a7db
dune nightly-2026-04-01
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch642a6a28
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-642a6a28
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-642a6a28
dune nightly-2026-03-31
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64c30a6e
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64c30a6e
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64c30a6e
dune nightly-2026-03-30
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64e4a90c
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64e4a90c
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64e4a90c
dune nightly-2026-03-29
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch647f8ee2
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-647f8ee2
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-647f8ee2
dune nightly-2026-03-28
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch644989ab
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-644989ab
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-644989ab
dune nightly-2026-03-27
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch646c09aa
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-646c09aa
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-646c09aa
dune nightly-2026-03-26
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64601be4
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64601be4
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64601be4
dune nightly-2026-03-25
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch646e8b25
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-646e8b25
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-646e8b25
dune nightly-2026-03-24
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch6414e834
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-6414e834
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-6414e834
dune nightly-2026-03-23
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch6474be8b
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-6474be8b
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-6474be8b
dune nightly-2026-03-22
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch64d969bf
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-64d969bf
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-64d969bf
dune nightly-2026-03-21
File NameKindOSArchCommitCertificate
dune-aarch64-apple-darwin.tar.gzArchivemacOSaarch6433b6ab
dune-x86_64-apple-darwin.tar.gzArchivemacOSx86-6433b6ab
dune-x86_64-unknown-linux-musl.tar.gzArchiveLinuxx86-6433b6ab