Boundary perturbations are considered as flow control forcing and their distributions are optimised to suppress transient energy growth induced by the most energetic disturbances in the domain. For a given control cost (square integration of the control forcing), the optimal control calculated from the proposed optimisation algorithm is proved to be unique. For small values of control cost, a sensitivity solution is obtained and its distribution indicates the sensitivity of perturbation energy on boundary control. For larger control cost, the distribution of the optimal control approaches the stablest mode of a directadjoint operator and tends to be gridtogrid oscillatory. A controllability analysis is further conducted to identify the uncontrollable component of perturbations in the domain. This work underpins the recently thriving linear feedback flow control investigations, most of which use empirically distributed control actuators, in terms of choosing the location and magnitude of the control forcing and evaluating the maximum control effect. Two case studies are conducted to demonstrate the proposed algorithm; in a stenotic flow, the optimised wall boundary control is observed to suppress over 95% of the transient energy growth induced by the global optimal initial perturbation; in the Batchelor vortex flow, the optimal inflow control can effectively suppress the spiral vortex breakdown induced by the development of initial perturbations.