In this work, a novel design of a portable leg rehabilitation system (PLRS) is presented. The main purpose of this paper is to provide a portable system which allows patients with lower limb disabilities to perform leg and foot rehabilitation exercises anywhere without any embarrassment compared to other devices that lack the portability feature. The model of the system is identified by inverse kinematics and dynamics analysis. In kinematics analysis, the pattern of motion of both leg and foot holders for different modes of operation has been investigated. The system is modeled by applying Lagrangian dynamics approach. The mathematical model derived considers calf and foot masses and moment of inertias as important parameters. Therefore, a gait analysis study is conducted to calculate the required parameters to simulate the model. PD controller and PID controller are applied to the model and compared. The PID controller optimized by Hybrid Spiral-Dynamics Bacteria-Chemotaxis (HSDBC) algorithm provides the best response with a reasonable settling time and minimum overshot. The robustness of the HSDBC-PID controller is tested by applying disturbance force with various amplitudes. A setup is built for the system experimental validation where the system mathematical model is compare with the estimated model using System Identification Toolbox. A significant difference is observed between both models when applying the obtained HSDBC-PID controller for the mathematical model. The results of this experiment are used to update the controller parameters of the HSDBC-optimized PID.