# Installing OCaml

**URL:** <https://discuss.ocaml.org/t/installing-ocaml/2238>\
**Category:** Ecosystem\
**Created:** [July 6, 2018, 2:28pm UTC](https://discuss.ocaml.org/t/installing-ocaml/2238 "2018-07-06T14:28:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SYStems](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/systems/32/5770_2.png) [@SYStems](https://discuss.ocaml.org/u/SYStems)\
**Post date:** [July 6, 2018, 2:28pm UTC](https://discuss.ocaml.org/t/installing-ocaml/2238/1 "2018-07-06T14:28:08Z")

</div>

hi,

i just wanted to raise this point  
on the two most popular operating systems/distribution

it is kind of hard to get the latest or a recent release of OCaml

on ubuntu 18, you get ocaml 4.05  
and on windows you get ocaml 4.03

is there an easy way to install the latest ocaml on both platforms, that is not well advertised, or one that i am not aware of

i think it is very important to have ocaml binaries both 32 and 64 bit for windows and ubuntu

---

<div class="post-metadata">

**Author:** ![anuragsoni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/anuragsoni/32/1107_2.png) [@anuragsoni](https://discuss.ocaml.org/u/anuragsoni)\
**Post date:** [July 6, 2018, 3:06pm UTC](https://discuss.ocaml.org/t/installing-ocaml/2238/2 "2018-07-06T15:06:16Z")

</div>

I don’t use windows but on any unix like system you can use opam to install any version of OCaml that has been published.

- With opam 1.2: `opam switch 4.06.1`
- With opam 2: `opam switch create 4.06.1`

---

<div class="post-metadata">

**Author:** ![perry](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/perry/32/518_2.png) [@perry](https://discuss.ocaml.org/u/perry)\
**Post date:** [July 7, 2018, 2:10pm UTC](https://discuss.ocaml.org/t/installing-ocaml/2238/3 "2018-07-07T14:10:29Z")

</div>

> [@SYStems](#):
>
> on ubuntu 18, you get ocaml 4.05

Just to be clear: once you have any version of OCaml running on your Linux box, you can use opam to manage your packages, including your compiler package. This is the preferred way to deal with OCaml packages. You can then install 4.06.1 with it, or the flambda variant of the compiler, or anything else you like.

If you want the default on Ubuntu to be a more recent OCaml, then I recommend talking to whomever manages the OCaml packages for Ubuntu, which is an Ubuntu rather than an OCaml thing as such.

---

<div class="post-metadata">

**Author:** ![loxs](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/loxs/32/961_2.png) [@loxs](https://discuss.ocaml.org/u/loxs)\
**Post date:** [July 8, 2018, 2:28pm UTC](https://discuss.ocaml.org/t/installing-ocaml/2238/4 "2018-07-08T14:28:23Z")

</div>

For ubuntu this is as simple as

```auto
sudo apt install opam
opam init
opam switch 4.06.1

```

And following the instructions
