Getting Started with OCaml on Debian


At time of writing (April 2007), you should use the OCaml packages in Debian/unstable (OCaml 3.10). The version in Debian/stable is rather ancient (OCaml 3.09.2). This will of course change when Lenny is released to the world.

This page assumes that you are installing OCaml 3.10 from Debian/unstable.

Basic OCaml environment

Use the apt-get command to install the following packages:

Gtk2 support

For developing graphical applications using Gtk2:

Database access

To access PostgreSQL and/or MySQL databases:

You can also access ODBC databases by installing:


To parse and validate XML documents:

For more information, see the PXP project page.

Internet standards

The basic OCaml library supports fundamentals such as sockets and IPv6. For more advanced features such as the manipulation of MIME email messages you may wish to install:

You can find out more at the OCamlNet project page.

Apache integration

A project called mod_caml provides full integration with the Apache web server. However there is no Debian package for this at the time of writing (a Debian package is in preparation).

You can though get unofficial Debian packages of mod_caml.

Perl and Python integration

To reuse existing Perl or Python libraries:

More informations

If you want the full list of OCaml debian packages, their build order and their current state in different versions of Debian, you should take a look at the Debian Ocaml Maintainer pages.