In this paper, fractional calculus is used to develop a generalized fractional dynamic model of an electrohydraulic system composed of a servo valve and a hydraulic cylinder, where a fractional position controller PIγDμ is proposed for minimizing the performance index according to the integral of the time-weighted absolute error (ITAE). First, the general mathematical equations of the cylinder and servo valve are used to obtain the transfer functions in fractional order by applying Caputo’s definition and a Laplace transform. Then, through a block diagram of the closed-loop system without a controller, the fractional model is validated by comparing its performance concerning the integer-order electrohydraulic system model reported in the literature. Subsequently, a fractional PID controller is designed to control the cylinder position. This controller is included in the closed-loop system to determine the fractional exponents of the transfer functions of the servo valve, cylinder, and control, as well as to tune the controller gains, by using the ITAE objective function, with a comparison of the following: (1) the electrohydraulic system model in integer order and the controller in fractional order; (2) the electrohydraulic system model in fractional order and the controller in integer order; and (3) both the system model and the controller in fractional order. For each of the above alternatives, numerical simulations were carried out using MATLAB®/Simulink® R2023b and adding white noise as a perturbation. The results show that strategy (3), where electrohydraulic system and controller model are given in fractional order, develops the best performance because it generates the minimum value of ITAE.