Many bacteria colonize surfaces in a manner known as swarming, which involves the collective motion of millions of cells at high densities. Bacteria that can swarm behave similarly in many ways, indicating that swarming is governed by some general behavioral principles of bacterial cells. In this thesis I will present such general behavioral principles that enable bacteria to move in a coordinated manner and to swarm efficiently without any long-range signaling mechanisms. Using a cell-based biomechanical modeling approach and taking Myxobacteria as the model system, we have found that (1) social interactions between bacterial cells, (2) directional reversal and (3) cell elongation all constitute the general behavioral principles that govern swarming. They are crucial to create ordered cellular motion and multicellular structures from random movements, hence leading to efficient swarm expansion of bacterial colonies. The findings resolved several long-standing problems in the biology of Myxobacteria and other swarming bacteria. The findings also broaden the understanding of the physics of collective behavior in far-from-equilibrium systems, and provide new insights to the engineering strategies of traffic or crowd control.