There are two ways to setup this opam repository:

Graphical Installer

You can try the graphical installer:

The installer will first create a customized cygwin environment and then set up opam and OCaml inside this environment. The setup should be easy and fast this way. However, the installer won’t allow you to set custom options: proxy configuration, select the initial OCaml version to install, etc. The 32-bit version will install a 32-bit version of cygwin and then download a 32-bit version of OCaml; the 64-bit version will download 64-bit versions of both toolchains.

Manual Installation

tar -xf 'opam32.tar.xz' # or tar -xf 'opam64.tar.xz'
bash opam32/  # --prefix /usr/foo, the default prefix is /usr/local
opam init mingw '' --comp 4.02.3+mingw32c --switch 4.02.3+mingw32c
# or, if you prefer the 64-bit version
opam init mingw '' --comp 4.02.3+mingw64c --switch 4.02.3+mingw64c
eval $(opam config env)

The above commands will download and install precompiled versions of OCaml. You can also compile it from source:

opam init mingw '' --comp 4.02.3+mingw32 --switch 4.02.3+mingw32
# or
opam init mingw '' --comp 4.02.3+mingw64 --switch 4.02.3+mingw64

There are also mingw-versions for the obsolete 4.01.0 version of OCaml available.

Next Step

Install depext and depext-cygwinports, if you want to use libraries like pcre or lablgtk.