How you catch pneumonia

Pneumonia starts when germs—bacteria, viruses, or fungi—reach your lungs and multiply there. You catch these germs the same way you catch a cold: through the air when someone coughs or sneezes near you, or by touching a contaminated surface and then touching your face. The germs land in your respiratory tract, usually your nose or throat first.

Most of the time your immune system stops the infection before it reaches your lungs. But if the germs get past your upper airway defenses—your cough reflex, mucus, and white blood cells—they can travel down into the air sacs of your lungs, called alveoli. Once there, they settle in and begin to multiply.

Key Takeaways

  • Pneumonia develops when bacteria, viruses, or fungi reach your lungs and your immune system cannot stop them before they multiply in the air sacs.
  • You catch the germs through respiratory droplets from coughs and sneezes, or by touching contaminated surfaces and then your face.
  • Certain conditions—age, smoking, chronic illness, a weakened immune system—make it much more likely that an infection will progress to pneumonia.
  • Pneumonia can develop during or shortly after another respiratory infection like the flu or a cold, or it can start on its own.
  • The infection causes inflammation and fluid buildup in your lungs, which is why you develop a cough, fever, and difficulty breathing.

Why some people develop pneumonia and others don't

Not everyone exposed to pneumonia-causing germs gets sick. Whether an infection becomes pneumonia depends on two things: how aggressive the germ is and how strong your immune defenses are at that moment.

Your risk is higher if you are very young (under 5), over 65, or have a chronic condition like asthma, COPD, heart disease, or diabetes. Smoking damages the cells that line your airways and clear mucus, making it easier for germs to take hold. A weakened immune system—from HIV, chemotherapy, or certain medications—means your body cannot fight off the infection as quickly. Recent surgery, hospitalization, or a serious illness also temporarily weakens your defenses.

Even healthy people can develop pneumonia, especially if they are exposed to a particularly virulent strain or if they inhale a large number of germs at once. Alcohol use disorder increases risk because it impairs immune function and because aspiration—accidentally inhaling food or liquid into the lungs—is more common.

What happens inside your lungs when pneumonia develops

Once germs multiply in your air sacs, your immune system responds by sending white blood cells to fight the infection. This immune response causes inflammation—swelling and irritation of the lung tissue. The inflamed air sacs fill with fluid or pus instead of air.

This fluid buildup is what causes your symptoms. Your body tries to clear it by triggering a cough. The inflammation makes it harder for oxygen to pass from your lungs into your bloodstream, which is why you feel short of breath. Fever develops as your body raises its temperature to fight the infection. The combination of inflammation, fluid, and reduced oxygen delivery is what makes pneumonia dangerous if left untreated.

Pneumonia that follows another illness

Many cases of pneumonia develop during or right after a viral infection like the flu, COVID-19, or a common cold. The virus damages the lining of your airways, making it easier for bacteria to invade. Your immune system is already working hard to fight the virus, so it may be slower to respond to a secondary bacterial infection.

This is called secondary bacterial pneumonia, and it is why people sometimes feel better for a day or two after a viral illness, then suddenly get much worse. The pattern is: viral infection for several days, brief improvement, then new symptoms like a productive cough with colored sputum, high fever, and chest pain.

Community-acquired versus hospital-acquired pneumonia

Community-acquired pneumonia (CAP) is what you catch in everyday life—from people around you at work, school, or in public spaces. The germs involved are the ones circulating in your community at that time, usually common bacteria like Streptococcus pneumoniae or viruses like influenza and respiratory syncytial virus (RSV).

Hospital-acquired pneumonia (HAP) develops in people who are already hospitalized, usually after at least 48 hours in the hospital. The germs in hospitals are often different—sometimes antibiotic-resistant bacteria—because sick people with serious infections are concentrated there. If you are on a ventilator, the risk is even higher because the tube bypasses your normal airway defenses.

Aspiration pneumonia is a third type that develops when you inhale food, liquid, or stomach contents into your lungs instead of swallowing it normally. This is more common in people with swallowing difficulties, those who are sedated or unconscious, or people with severe reflux.

How long it takes for pneumonia to develop

Pneumonia can develop quickly or slowly depending on the germ and your immune state. Bacterial pneumonia often comes on suddenly—you might feel fine in the morning and be quite sick by evening. Viral pneumonia usually develops more gradually over several days as the virus multiplies.

Some people notice symptoms within 24 to 48 hours of exposure to the germ. Others may have been carrying the germ for a week or more before their immune system becomes overwhelmed and pneumonia develops. This is why timing matters: you might catch a germ on Monday but not develop recognizable pneumonia until Thursday or Friday.

When to seek medical attention

Pneumonia can range from mild (sometimes called "walking pneumonia") to severe. Seek medical attention if you have a cough lasting more than a week, especially if you are coughing up mucus; fever above 100.4°F (38°C) that lasts more than a few days; shortness of breath or chest pain when you breathe; or if you are in a high-risk group (very young, over 65, or with a chronic condition) and develop respiratory symptoms.

Seek immediate care if you have severe shortness of breath, confusion, bluish lips or fingernails, or chest pain. A healthcare provider can listen to your lungs, order a chest X-ray if needed, and determine whether you have pneumonia and what type of germ is causing it.

Frequently Asked Questions

Can you get pneumonia from being cold or wet?

Cold or wet weather does not directly cause pneumonia, but it may increase your risk indirectly. Cold air can irritate airways and trigger coughing, and people spend more time indoors in winter where germs spread more easily. You still need to be exposed to the actual germ that causes pneumonia.

Is pneumonia contagious?

The germs that cause pneumonia are contagious—you can catch them from someone else. But catching the germ does not mean you will develop pneumonia. Most people who are exposed either do not get sick or develop only a mild upper respiratory infection. Your immune system and overall health determine whether the infection progresses to pneumonia.

Can pneumonia develop without a cough?

Yes, especially in older adults and people with weakened immune systems. Some people develop pneumonia with mainly fever, shortness of breath, and fatigue but little or no cough. This is why a healthcare provider may order a chest X-ray even if your cough is mild but you have other signs of infection.

How long after exposure do pneumonia symptoms appear?

Symptoms usually appear within 1 to 3 weeks of exposure to the germ, but this varies widely. Bacterial pneumonia can develop within 24 to 48 hours. Viral pneumonia often takes 3 to 7 days. Some people carry the germ for weeks before symptoms develop, especially if their immune system is weakened.

Can you get pneumonia twice?

Yes. Recovering from pneumonia does not make you immune to future infections. You can catch pneumonia again from a different germ, or even from the same type of germ if your immunity has faded. This is why vaccination against common pneumonia-causing bacteria and viruses is recommended for certain age groups and high-risk people.