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. (If possible, the 64-bit version of cygwin is installed. The 32-bit version is no longer recommended)

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 default "" -c "ocaml-variants.4.07.1+mingw32c" --disable-sandboxing
# or, if you prefer the 64-bit version
opam init default "" -c "ocaml-variants.4.07.1+mingw64c" --disable-sandboxing
eval $(opam config env)

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

opam init default "" -c "ocaml-variants.4.07.1+mingw32" --disable-sandboxing
# or
opam init default "" -c "ocaml-variants.4.07.1+mingw64" --disable-sandboxing

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.