Medications your doctor may prescribe

The treatment for pneumonia depends on what caused it — bacteria, virus, or fungus — because different organisms respond to different drugs. Your doctor will usually start antibiotics before knowing the exact cause, because bacterial pneumonia can worsen quickly. The most common first choices are amoxicillin-clavulanate (Augmentin) for mild cases or azithromycin (Z-pack) if you cannot take penicillin-type drugs. For pneumonia serious enough to need hospital care, doctors often use ceftriaxone or fluoroquinolones like levofloxacin.

If your pneumonia is viral — which is common with flu or COVID-19 — antibiotics will not help, and your doctor will focus on letting your immune system fight the infection while managing your symptoms. Antiviral drugs exist for influenza (oseltamivir, or Tamiflu) and COVID-19 (Paxlovid), but they work best when started within the first few days of illness. Fungal pneumonia, which is rare and usually only happens in people with weakened immune systems, requires antifungal medications like fluconazole or amphotericin B.

Key Takeaways

  • Antibiotics treat bacterial pneumonia but do not work for viral pneumonia, so your doctor needs to determine the cause or likely cause before prescribing.
  • Common first-line antibiotics for outpatient pneumonia are amoxicillin-clavulanate or azithromycin, taken by mouth for 5 to 7 days.
  • Antiviral drugs for flu or COVID-19 pneumonia only work in the first few days of illness, so timing matters.
  • Over-the-counter fever reducers and cough medicines can ease symptoms while your body clears the infection, but they do not treat pneumonia itself.
  • Hospital-treated pneumonia often uses stronger intravenous antibiotics and may include oxygen support or other breathing assistance.

Over-the-counter symptom relief

While antibiotics or antivirals treat the infection itself, over-the-counter drugs can make you more comfortable while you recover. Acetaminophen (Tylenol) and ibuprofen (Advil, Motrin) both reduce fever and ease body aches — either one is fine, though you should not alternate between them or take both at once. Ibuprofen may reduce inflammation in your airways slightly, which some people find helps with breathing, but the difference is small.

For cough, dextromethorphan (found in Robitussin and many cough syrups) can suppress the urge to cough, which helps you sleep. Guaifenesin (Mucinex) thins mucus so it is easier to cough up — some people prefer this because coughing actually helps clear your lungs. Neither is essential; many people recover fine without cough medicine. Avoid cough suppressants if you are coughing up mucus, because you want that out of your lungs.

When you need hospital treatment

Pneumonia that causes low oxygen levels, confusion, very high fever, or signs of sepsis (rapid heartbeat, extreme weakness) requires hospital care. In the hospital, antibiotics are given through an IV rather than by mouth, which gets them into your bloodstream faster and in higher doses. Your oxygen level will be monitored continuously, and you may receive supplemental oxygen through a mask or nasal tube.

Severe pneumonia sometimes requires a ventilator — a machine that breathes for you — if your lungs cannot take in enough oxygen on their own. This is not common, but it is more likely in older adults, people with chronic lung disease, or those with weakened immune systems. Hospital stays for pneumonia typically last 3 to 7 days, though some people need longer depending on how quickly they improve.

Antibiotics and how long they take to work

Antibiotics begin killing bacteria within hours, but you usually will not feel much better for 24 to 48 hours. Your fever may drop within a day or two, and your energy may start returning after 3 to 5 days. Even though you feel better, you should finish the entire course — usually 5 to 7 days — because stopping early can allow bacteria to survive and cause the infection to return or worsen.

If you are not improving after 48 to 72 hours on antibiotics, tell your doctor. This can mean the bacteria are resistant to that particular drug, the infection is viral (not bacterial), or something else is going on. Your doctor may switch you to a different antibiotic or order imaging to check for complications like a fluid collection around the lung.

Steroids and when they are used

Corticosteroids like prednisone or dexamethasone reduce inflammation in the lungs and airways. They are not routine for pneumonia, but doctors may prescribe a short course (3 to 5 days) if you have severe inflammation, difficulty breathing, or a history of asthma or COPD. Steroids can help you breathe easier and may shorten recovery slightly, but they also suppress your immune system temporarily, so they are used carefully and only when the benefit outweighs the risk.

Steroids are more commonly used in hospital settings for severe pneumonia than for mild outpatient cases. If your doctor prescribes them, take the full course even though you may feel better quickly — stopping abruptly can cause problems.

Oxygen therapy and breathing support

If your blood oxygen level drops below 90 percent (measured by a pulse oximeter), supplemental oxygen is needed. This can be delivered through a nasal cannula (two small tubes in your nose), a face mask, or in severe cases through a tube placed in your windpipe. Oxygen does not treat the infection, but it keeps your organs and tissues supplied with the oxygen they need while your lungs are inflamed and not working at full capacity.

At home, if you have been prescribed an oxygen concentrator, use it as directed — usually when your oxygen level drops or during sleep. In the hospital, oxygen levels are checked regularly and adjusted as your lungs improve. Most people can stop supplemental oxygen once their oxygen level stays above 90 percent on room air.

What not to take

Do not take antibiotics prescribed for someone else, even if they had pneumonia — different bacteria and different patient factors mean different drugs are needed. Do not use cough suppressants if you are coughing up mucus; your cough is helping clear your lungs. Avoid smoking and secondhand smoke, which irritates your airways and slows healing.

Do not stop antibiotics early because you feel better. Do not use decongestants (like pseudoephedrine) without asking your doctor first — they can sometimes make pneumonia worse by thickening secretions. If you are taking other medications, tell your doctor before starting pneumonia treatment, because some drugs interact with antibiotics.

Recovery and when to call your doctor

Most people with bacterial pneumonia treated with antibiotics improve steadily over 1 to 2 weeks. Fatigue can linger for weeks even after the infection clears, which is normal. You can usually return to light activity after a few days if you feel up to it, but avoid strenuous exercise until your doctor says it is safe.

Call your doctor if your fever returns after it had gone away, if you develop chest pain, if you cough up blood, if you feel more short of breath instead of better, or if you feel confused or very weak. These can be signs that the infection is not responding or that a complication has developed. If you cannot catch your breath or feel chest pain, go to the emergency room.

Frequently Asked Questions

How long do I need to take antibiotics for pneumonia?

Most pneumonia is treated with antibiotics for 5 to 7 days. Some cases, especially if you are hospitalized or have a more serious infection, may need 10 to 14 days. Your doctor will tell you the exact length based on which antibiotic you are taking and how you are responding.

Can I treat pneumonia at home without going to the hospital?

Mild pneumonia can be treated at home with oral antibiotics, rest, fluids, and over-the-counter fever reducers. You will need a doctor to diagnose it first and prescribe antibiotics. If your oxygen level is low, you have severe shortness of breath, or you are very ill, hospital care is necessary.

What if I am allergic to penicillin?

Doctors have several alternatives, including azithromycin, fluoroquinolones, or cephalosporins (which are safe for most penicillin-allergic people unless you had a severe reaction). Tell your doctor exactly what happened when you had the allergic reaction so they can choose the safest option.

Will cough medicine help me recover faster?

Cough medicine eases discomfort and helps you sleep, but it does not speed recovery. If you are coughing up mucus, letting yourself cough actually helps clear your lungs, so suppressants may slow healing. Guaifenesin (Mucinex) is a better choice if you want cough relief without stopping the productive cough.

How do I know if my pneumonia is bacterial or viral?

Your doctor may order a chest X-ray or sputum culture to help determine the cause, but often they start antibiotics based on your symptoms and exam findings. If you have flu or COVID-19, a rapid test can confirm that. Viral pneumonia improves with rest and supportive care; antibiotics will not help unless bacteria are also present.