Due to its flexibility, cost-effectiveness, and quick deployment abilities, unmanned aerial vehicle-mounted base station (UmBS) deployment is a promising approach for restoring wireless services in areas devastated by natural disasters such as floods, thunderstorms, and tsunami strikes. However, the biggest challenges in the deployment process of UmBS are ground user equipment’s (UE’s) position information, UmBS transmit power optimization, and UE-UmBS association. In this article, we propose Localization of ground UEs and their Association with the UmBS (LUAU), an approach that ensures localization of ground UEs and energy-efficient deployment of UmBSs. Unlike existing studies that proposed their work based on the known UEs positional information, we first propose a three-dimensional range-based localization approach (3D-RBL) to estimate the position information of the ground UEs. Subsequently, an optimization problem is formulated to maximize the UE’s mean data rate by optimizing the UmBS transmit power and deployment locations while taking the interference from the surrounding UmBSs into consideration. To achieve the goal of the optimization problem, we utilize the exploration and exploitation abilities of the Q-learning framework. Simulation results demonstrate that the proposed approach outperforms two benchmark schemes in terms of the UE’s mean data rate and outage percentage.