This paper proposes a design methodology for power-dense and high-efficient electrohydraulic units (EHUs) that can be used to select design specifications for the electric machine (EM) for a given hydraulic machine (HM) architecture. The proposed method evaluates EHU performance considering both electric and hydraulic power losses. The compactness of the EHU is achieved by integrating an axial piston unit as HM inside a permanent magnet EM. The paper provides a sensitivity analysis for important EHU design specifications and discusses the best choices for reducing total mass and energy loss. The study finds that greater aspect ratios promote power-to-weight ratio, while high voltage promotes energy efficiency. The paper also discusses the choice of fixed versus variable displacement HMs, with the finding that a variable displacement unit helps address low efficiency limits of low-speed operation, particularly for low voltage electric machines. Additionally, variable displacement can also be used to reduce EM losses when meeting a flow-pressure demand. The proposed methodology has applications in fields such as off-road vehicles.