The control of complex, unsteady flows is a pacing technology for advances in fluid mechanics. Recently, optimal control theory has become popular as a means of predicting best case controls that can guide the design of practical flow control systems. However, most of the prior work in this area has focused on incompressible flow which precludes many of the important physical flow phenomena that must be controlled in practice including the coupling of fluid dynamics, acoustics, and heat transfer. This paper presents the formulation and numerical solution of a class of optimal boundary control problems governed by the unsteady two-dimensional compressible Navier–Stokes equations. Fundamental issues including the choice of the control space and the associated regularization term in the objective function, as well as issues in the gradient computation via the adjoint equation method are discussed. Numerical results are presented for a model problem consisting of two counter-rotating viscous vortices above an infinite wall which, due to the self-induced velocity field, propagate downward and interact with the wall. The wall boundary control is the temporal and spatial distribution of wall-normal velocity. Optimal controls for objective functions that target kinetic energy, heat transfer, and wall shear stress are presented along with the influence of control regularization for each case. Copyright © 2002 John Wiley & Sons, Ltd.