The adaptability of hexapods for various locomotion tasks, especially in rescue and exploration missions, drives their application. Unlike controlled environments, these robots need to navigate ever-changing terrains, where ground irregularities impact foothold positions and origin shifts in contact forces. This dynamic interaction leads to varying hexapod postures, affecting overall system stability. This study introduces a posture control approach that adjusts the hexapod’s main body orientation and height based on terrain topology. The strategy estimates ground slope using limb positions, thereby calculating novel limb trajectories to modify the hexapod’s angular position. Adjusting the hexapod’s height, based on the calculated slope, further enhances main body stability. The proposed methodology is implemented and evaluated on the ATHENA hexapod (All-Terrain Hexapod for Environment Adaptability). Control feasibility is assessed through dynamic analysis of the hexapod’s multibody model on irregular surfaces, using computational simulations in Gazebo software. Environmental complexity’s impact on hexapod stability is tested on both a ramp and uneven terrain. Independent analyses for each scenario evaluate the controller’s effect on roll and pitch angular velocities, as well as height variations. Results demonstrate the strategy’s suitability for both environments, significantly enhancing posture stability.