Modeling and position control of an Electro-Hydraulic Actuator (EHA) system is investigated in this paper. Linear ARX EHA system model is identified by taking the experimental data using system identification toolbox in the MATLAB/Simulink. From the identified models the best fit ARX 331 model is used to design a controller using fuzzy logic and Particle swarm optimization (PSO) methods. In the self-tuning Fuzzy PID controller, the controller parameters KP,KI, and KD are tuned by the fuzzy controller depending on the two inputs: error and derivatives of the error. In the PSO optimized PID controller, the sum of the time-weighted absolute error objective function is minimized and optimized controller parameters are tuned using PSO algorithms. The results are simulated in the MATLAB/Simulink and compared among conventional Ziegler-Nichols (Z-N), Fuzzy, and PSO PIDs. The results indicate that the self-tuning fuzzy PID and PSO optimized PID give better performance than the Z-N PID controller and the PSO-optimized PID controller demonstrates superior performance in terms of percentage overshot and speed of response with 5% overshoot, 0.02 s rise time and 0.15 s settling time. © ICST Institute for Computer Sciences, Social Informatics and Telecommunications Engineering 2019 Published by Springer Nature Switzerland AG 2019. All Rights Reserved.