Cephalexin is typically administered orally in the form of capsules, tablets, or liquid suspension. The dosage and duration depend on the type and severity of the infection, as well as the patient's age and renal function. Adherence to prescribed regimens is essential to ensure treatment efficacy and prevent the development of resistance.