K. pneumoniae is a non-motile, encapsulated bacterium from the Enterobacteriaceae family. The illnesses related to this opportunistic pathogen are pneumonia, Urinary Tract Infection (UTI), pyogenic liver abscess, endophthalmitis, and meningitis. Among them, UTI is predominant due to its biofilm formation leading to the mortality of 150 million people worldwide. The function of monovalent and divalent ions on Klebsiella biofilm, aside from physiochemical variables, remains unclear. Hence the present study was performed to analyze the role of K+, Ca2+, Na+, Mg2+, NH+4 in biofilm formation and its influence on biofilm-related genes. Among the tested cations, K+ and Ca2+ yielded strong biofilm in clinical and environment isolates in pH between 6.5 to 9.5. Increasing Ca2+ ions concertation reduced the Klebsiella biofilm. When compared to the hypercalciuria condition (Ca2+ level > 5 mM), 2.5 mM resulted in high biofilm mass. Cations concurrently enhanced the size of the capsule and cell density of Klebsiella but were not correlated with biofilm mass. Expression of the LPS gene (WbaG) either in planktonic or biofilm stage promoted biofilm formation in the presence of K+, Ca2+ and Na+. Whereas, expression of fimbriae genes (FimH and mrkD) was co-regulation, and capsule genes (RmpA and Wcab) were absent. Stating, the primary component needed for the Klebsiella biofilm is not the capsule or fimbriae, rather LPS. Resulting as a potent target in the treatment of Klebsiella biofilm in UTI. To the best of our knowledge, this is the first kind of study on the effect of cation ions on biofilm and planktonic cells of Klebsiella spp. and demonstrating the role of LPS biosynthesis gene (WbaG) in biofilm development.