Let
C
h
(
O
)
\mathbf {Ch}(\mathcal {O})
be the category of chain complexes of
O
\mathcal {O}
-modules on a topological space
T
T
(where
O
\mathcal {O}
is a sheaf of rings on
T
T
). We put a Quillen model structure on this category in which the cofibrant objects are built out of flat modules. More precisely, these are the dg-flat complexes. Dually, the fibrant objects will be called dg-cotorsion complexes. We show that this model structure is monoidal, solving the previous problem of not having any monoidal model structure on
C
h
(
O
)
\mathbf {Ch}(\mathcal {O})
. As a corollary, we have a general framework for doing homological algebra in the category
S
h
(
O
)
\mathbf {Sh}(\mathcal {O})
of
O
\mathcal {O}
-modules. I.e., we have a natural way to define the functors
Ext
\operatorname {Ext}
and
Tor
\operatorname {Tor}
in
S
h
(
O
)
\mathbf {Sh}(\mathcal {O})
.