The main challenge in the food packaging industry is preventing food spoilage caused by pathogens and microorganisms, which requires the development of effective antibacterial materials to improve food safety and extend shelf life. To address this issue, a nanocomposite, AgNPs@ZIF-8@CMC, consisting of silver nanoparticles (AgNPs), zeolitic imidazolate framework-8 (ZIF-8), and carboxymethyl cellulose (CMC) using an environmentally friendly, DMF-free process was synthesized. Various concentrations of AgNPs@ZIF-8@CMC were incorporated into gelatin/chitosan films via the solution casting method. The synergistic effects of silver and zinc ions, combined with the high surface area of the porous composite, significantly contributed to its antimicrobial activity. AgNPs@ZIF-8@CMC demonstrated remarkable antibacterial properties, producing inhibition zones of 22 ± 0.6 mm and 20 ± 0.6 mm against E. coli and S. aureus, respectively.Incorporating the nanocomposite into gelatin and chitosan films significantly increased the inhibition zones, from 0 mm to 30 ± 1 mm for S. aureus and from 0 mm to 28 ± 1.15 mm for E. coli. Notably, 4 % (AgNPs@ZIF-8@CMC)-Gel/Chi and 1 % (AgNPs@ZIF-8@CMC)-Gel/Chi composite films eliminated E. coli and S. aureus within 3 h, respectively. This research emphasizes the considerable potential of synthesized composite films as active packaging materials for preserving perishable fruits.