We use F-theory to derive a general expression for the flux potential of type II compactifications with D7/D3 branes, including open string moduli and 2-form fluxes on the branes. Our main example is F-theory on K3 $times$ K3 and its orientifold limit T^2/Z_2 x K3. The full scalar potential cannot be derived from the bulk superpotential W=int Omega wedge G_3 and generically destabilizes the orientifold. Generically all open and closed string moduli are fixed, except for a volume factor. An alternative formulation of the problem in terms of the effective supergravity is given and we construct an explicit map between the F-theory fluxes and gaugings. We use the superpotential to compute the effective action for flux compactifications on orbifolds, including the mu-term and soft-breaking terms on the D7-brane world-volume.