The inappropriate mechanism designs for demand response (DR) in the community of microgirds (CoMGs) may cause massive problems, such as increase of consumers’ costs, rebound peaks, and thereby lack of optimality in the network. In this article, a bilevel energy management system (EMS) is proposed to tackle the challenges associated with DR programs for CoMGs. The current structure successfully models users’ behavior and dissatisfaction in the first level of optimization to develop best DR program for each of them. Moreover, in the second level, power system constraints are taken into account to prevent voltage and current deviation from their statutory limits. Each user is assumed to be part of a microgrid (MG) whose operation is controlled and optimized through its local EMS in the first level. On the other hand, the overall operation of all MGs is delegated to the whole system operator, which acts as the central EMS (CEMS) in the second level. An iterative transactive energy management method is proposed by CEMS to fairly limit the excess power of the MGs one day ahead for voltage and current regulation. The obtained results indicate the effectiveness of the proposed structure in preventing discomfort issues, voltage deviation and creation of the rebound peaks in the system.