The primary instability of the steady two-dimensional flow past rectangular cylinders moving parallel to a solid wall is studied, as a function of the cylinder length-to-thickness aspect ratio
${A{\kern-4pt}R} =L/D$
and the dimensionless distance from the wall
$g=G/D$
. For all
${A{\kern-4pt}R}$
, two kinds of primary instability are found: a Hopf bifurcation leading to an unsteady two-dimensional flow for
$g \ge 0.5$
, and a regular bifurcation leading to a steady three-dimensional flow for
$g < 0.5$
. The critical Reynolds number
$Re_{c,2\text{-}D}$
of the Hopf bifurcation (
$Re=U_\infty D/\nu$
, where
$U_\infty$
is the free stream velocity,
$D$
the cylinder thickness and
$\nu$
the kinematic viscosity) changes with the gap height and the aspect ratio. For
${A{\kern-4pt}R} \le 1$
,
$Re_{c,2\text{-}D}$
increases monotonically when the gap height is reduced. For
${A{\kern-4pt}R} >1$
,
$Re_{c,2\text{-}D}$
decreases when the gap is reduced until
$g \approx 1.5$
, and then it increases. The critical Reynolds number
$Re_{c,3\text{-}D}$
of the three-dimensional regular bifurcation decreases monotonically for all
${A{\kern-4pt}R}$
, when the gap height is reduced below
$g < 0.5$
. For small gaps,
$g < 0.5$
, the hyperbolic/elliptic/centrifugal character of the regular instability is investigated by means of a short-wavelength approximation considering pressureless inviscid modes. For elongated cylinders,
${A{\kern-4pt}R} > 3$
, the closed streamline related to the maximum growth rate is located within the top recirculating region of the wake, and includes the flow region with maximum structural sensitivity; the asymptotic analysis is in very good agreement with the global stability analysis, assessing the inviscid character of the instability. For cylinders with
$AR \leq 3$
, however, the local analysis fails to predict the three-dimensional regular bifurcation.