Pneumonia treatment depends on what caused it and how severe it is

Bacterial pneumonia is treated with antibiotics, which your doctor prescribes based on which bacteria they believe is responsible. Viral pneumonia has no antibiotic treatment — your body's immune system clears it on its own, though your doctor may prescribe antivirals in specific cases. Fungal pneumonia requires antifungal medication and is less common. The first step is always a doctor visit or urgent care evaluation, where they listen to your lungs and may order a chest X-ray to confirm pneumonia and rule out other conditions.

Most people with pneumonia recover at home with rest, fluids, and medication. Hospital admission happens when oxygen levels drop, you have severe breathing trouble, you are very young or elderly, or you have other serious health conditions. Recovery takes weeks even after you feel better — fatigue and a lingering cough are normal and do not mean the pneumonia is returning.

Key Takeaways

  • Bacterial pneumonia requires antibiotics prescribed by a doctor; viral pneumonia clears on its own but needs supportive care like rest and fluids.
  • A chest X-ray or other imaging usually confirms pneumonia, and blood tests may identify which bacteria is responsible so the right antibiotic is chosen.
  • Most people recover at home, but hospital care is needed if oxygen levels are low, breathing is severely difficult, or you have other serious illnesses.
  • Recovery takes several weeks, and a lingering cough or fatigue after treatment ends is common and does not mean treatment failed.
  • Preventing complications means finishing all antibiotics even when you feel better, staying hydrated, and watching for signs of worsening like increased shortness of breath.

How antibiotics work and why finishing them matters

Antibiotics kill the bacteria causing bacterial pneumonia, but they work only if you take the full course — usually 7 to 14 days depending on the antibiotic and severity. Stopping early because you feel better leaves bacteria alive, and those bacteria can become resistant to that antibiotic and cause the pneumonia to return or worsen. Your doctor will tell you how long to take the medication; follow that timeline even if symptoms disappear after a few days.

If you have a penicillin allergy or other drug allergies, tell your doctor before they prescribe. Alternatives exist, but your doctor needs to know your history to choose safely. If the antibiotic causes side effects like nausea or diarrhea, contact your doctor — they may switch you to a different one rather than having you stop treatment.

What happens during a pneumonia diagnosis visit

Your doctor will listen to your lungs with a stethoscope and ask about your symptoms, how long you have had them, and whether you have other health conditions. They will likely order a chest X-ray, which shows whether pneumonia is present and how much of the lung is affected. A blood test may be done to identify the specific bacteria, though treatment often starts before results come back based on what is most common in your area.

Pulse oximetry — a small clip on your finger that measures oxygen in your blood — tells your doctor whether your lungs are moving oxygen into your bloodstream well enough. If oxygen is below 90 percent, or if you are struggling to breathe, hospital admission becomes necessary. If oxygen is adequate and you are managing at home, your doctor will send you home with antibiotics and instructions on what to watch for.

Managing pneumonia at home

Rest is the most important part of recovery. Your body is fighting infection, and sleep helps that process. Drink plenty of water, warm tea, or broth — staying hydrated helps loosen mucus and prevents dehydration, which can slow healing. You can use a humidifier or breathe steam from a hot shower to ease congestion and coughing.

Over-the-counter pain relievers like acetaminophen or ibuprofen can reduce fever and chest discomfort, but follow the package directions and do not exceed the recommended dose. Cough suppressants may help you sleep, but coughing is your body's way of clearing mucus, so do not suppress it completely during the day. If you smoke, stop — smoking slows lung healing and increases the risk of complications.

Avoid going to work, school, or public places while you are contagious. Bacterial pneumonia is contagious for about 24 to 48 hours after you start antibiotics; viral pneumonia can be contagious for a week or longer. Wash your hands often and cover your mouth when you cough to protect others.

When to seek urgent care or go to the hospital

Contact your doctor or go to urgent care if you develop a high fever (above 103°F), severe chest pain, confusion, or if your symptoms worsen after starting antibiotics. Go to the emergency room or call 911 if you have severe shortness of breath, blue lips or fingernails, coughing up blood, or loss of consciousness. These signs mean your lungs are not moving enough oxygen into your blood and you need hospital care.

If you were treated at home and your symptoms return or get worse after you finish antibiotics, contact your doctor. This can happen if the antibiotic did not work or if a different infection developed, and your doctor may order another X-ray and switch your medication.

How long recovery takes and what to expect

Most people feel noticeably better within 3 to 5 days of starting antibiotics, but that does not mean the pneumonia is gone. The infection takes 1 to 3 weeks to fully clear, and your lungs need additional time to repair. A lingering cough can last 3 to 4 weeks after treatment ends, and fatigue may persist for several weeks. This is normal and does not mean you need more antibiotics.

Return to normal activity gradually. Start with light activity like short walks, and increase as your energy returns. Going back to work or school too soon can set back your recovery and increase the risk of complications. Most doctors recommend waiting at least a week after your fever is gone and you are off antibiotics before returning to normal routine.

Preventing pneumonia from returning

Once you have had pneumonia, you are at higher risk of getting it again, especially if you smoke, have chronic lung disease, or have a weakened immune system. A pneumonia vaccine is recommended for people over 65 and for younger people with certain health conditions — ask your doctor whether it is right for you. The flu vaccine also reduces your risk, since flu can lead to pneumonia.

Avoid respiratory irritants like smoke and air pollution, which damage your lungs and make infection more likely. If you have a chronic condition like asthma or COPD, keep it well controlled with your regular medications. Wash your hands regularly and avoid close contact with people who are sick.

Frequently Asked Questions

Can pneumonia go away on its own without antibiotics?

Viral pneumonia clears on its own with rest and supportive care, though it takes weeks. Bacterial pneumonia does not go away without antibiotics and can worsen or cause serious complications like sepsis. A doctor must determine whether your pneumonia is bacterial or viral, which usually requires a chest X-ray and sometimes blood tests.

How do I know if my pneumonia is getting worse?

Worsening pneumonia causes increased shortness of breath, chest pain that gets worse, confusion, or a very high fever. If you are on antibiotics and these symptoms appear or worsen after 48 hours, contact your doctor — the antibiotic may not be working and you may need a different one or hospital care.

Is it safe to exercise while recovering from pneumonia?

Light activity like walking is fine once you feel up to it, but intense exercise should wait until you are fully recovered, usually 3 to 4 weeks after treatment ends. Pushing too hard too soon can delay healing and cause a relapse. Start slowly and increase activity as your energy improves.

What if I am allergic to penicillin?

Tell your doctor about your allergy before they prescribe. Many alternatives exist, including fluoroquinolones, macrolides, and other classes of antibiotics. Your doctor will choose one that is safe for you and effective against the bacteria causing your pneumonia.

Can I catch pneumonia again right after recovering?

It is uncommon but possible, especially if you return to activity too soon or if your immune system is weak. If you develop pneumonia symptoms again within a few weeks of finishing treatment, contact your doctor — you may have a different infection or a complication that needs attention.