How pneumonia infection starts

Pneumonia develops when germs—bacteria, viruses, or fungi—enter your lungs and multiply, causing inflammation in the air sacs where oxygen exchange happens. You don't catch pneumonia from a single exposure the way you might catch a cold. Instead, the germs have to reach deep into your lungs, survive your body's defenses, and establish an infection. Most people breathe in these organisms regularly without getting sick because their immune system clears them.

The path from breathing in a germ to developing pneumonia depends on which organism it is, how many you inhale, and how well your immune system is working that day. A healthy person's lungs have multiple layers of protection: mucus that traps particles, cilia (tiny hairs) that sweep debris out, and white blood cells that kill invaders. Pneumonia takes hold when these defenses are overwhelmed or compromised.

Key Takeaways

  • Pneumonia develops when bacteria, viruses, or fungi reach your lungs and multiply faster than your immune system can clear them.
  • You typically inhale the germs through respiratory droplets from an infected person or by breathing contaminated air, but infection only occurs if defenses fail.
  • Certain conditions—recent respiratory illness, smoking, chronic lung disease, weakened immunity, or advanced age—significantly increase your risk.
  • The infection causes inflammation in your air sacs, which fill with fluid or pus and prevent oxygen from reaching your bloodstream.

The two main routes germs travel to your lungs

Inhalation is the most common way pneumonia-causing germs reach your lungs. When an infected person coughs, sneezes, or talks, they release respiratory droplets into the air. If you breathe those droplets in, the germs land in your nose, throat, or upper airways. From there, they can travel down into your lungs. This is why pneumonia often follows a cold or flu—the initial viral infection damages your airway lining, making it easier for bacteria to move deeper.

Aspiration is the second route, and it happens when you accidentally inhale food, saliva, or stomach contents instead of swallowing them. This is more likely if you have difficulty swallowing, are sedated, or have a swallowing disorder. Aspiration pneumonia develops because your mouth and stomach contain bacteria that don't belong in your lungs. Older adults and people with neurological conditions face higher aspiration risk.

Less commonly, germs can reach your lungs through the bloodstream if you have an infection elsewhere in your body, or through direct spread from a nearby infection like an abscess. These routes account for a small fraction of pneumonia cases.

Why some people's immune systems can't stop the infection

Your lungs are constantly exposed to germs, yet most people never develop pneumonia. The difference lies in immune function. When your defenses are working normally, white blood cells recognize and destroy invading organisms before they multiply. But several conditions can weaken this response.

Recent viral illness—especially influenza or COVID-19—damages the cells lining your airways and temporarily impairs immune function, creating a window where bacterial pneumonia can take hold. Smoking damages cilia and reduces mucus clearance, leaving germs in your lungs longer. Chronic lung diseases like COPD or asthma narrow airways and trap secretions, giving bacteria a place to grow. Conditions that weaken immunity directly—HIV, cancer treatment, organ transplant, or medications that suppress the immune system—make pneumonia more likely to develop from any exposure.

Age matters too. Adults over 65 have weaker immune responses and are more likely to develop severe pneumonia. Infants under age 2 have immune systems that are still developing. People with diabetes, heart disease, or kidney disease face higher risk because these conditions stress the immune system or affect how well it responds.

What happens inside your lungs during pneumonia

Once germs establish themselves in your air sacs (the alveoli), your immune system responds by sending white blood cells to fight the infection. This immune response causes inflammation—swelling and increased fluid in the tissue. The infected air sacs fill with fluid or pus instead of air, a process called consolidation. This is what shows up as white patches on a chest X-ray.

As more air sacs fill with fluid, less oxygen can cross into your bloodstream. Your body responds by making you breathe faster and harder to try to get enough oxygen. This is why pneumonia causes shortness of breath and rapid breathing. If the infection spreads to many air sacs or if your immune system is very weak, oxygen levels can drop dangerously low, which is why severe pneumonia requires hospitalization.

The type of germ determines how quickly this happens and how severe it becomes. Viral pneumonia usually develops over several days as the virus damages cells. Bacterial pneumonia can progress faster, sometimes causing severe illness within 24 to 48 hours. Fungal pneumonia typically develops slowly over weeks.

Specific germs that cause pneumonia

Streptococcus pneumoniae (pneumococcus) is the most common bacterial cause of pneumonia worldwide. Haemophilus influenzae and Legionella pneumophila are other bacterial culprits. Viruses—including influenza, respiratory syncytial virus (RSV), rhinovirus, and coronaviruses—cause viral pneumonia, which is often milder than bacterial pneumonia but can still be serious. Mycoplasma pneumoniae causes "walking pneumonia," a milder form that doesn't usually require hospitalization.

Fungal pneumonia is less common and typically occurs in people with weakened immunity. Pneumocystis jirovecii (formerly called PCP) is associated with advanced HIV. Histoplasma, Coccidioides, and Blastomyces are environmental fungi found in specific geographic regions. Candida and Aspergillus can cause pneumonia in hospitalized patients or those on prolonged antibiotics.

Risk factors that increase your chance of developing pneumonia

Certain conditions and behaviors make pneumonia more likely. Smoking damages your lungs' natural defenses and is one of the strongest modifiable risk factors. Alcohol use impairs immune function and increases aspiration risk. Recent surgery or hospitalization exposes you to hospital germs and requires sedation, which increases aspiration risk.

Chronic conditions that increase risk include COPD, asthma, cystic fibrosis, heart disease, diabetes, kidney disease, and liver disease. Neurological conditions that affect swallowing—stroke, Parkinson's disease, dementia—raise aspiration pneumonia risk. People living with HIV, those on immunosuppressive medications, and cancer patients undergoing chemotherapy face significantly higher risk. Malnutrition and homelessness are also associated with higher pneumonia rates, likely because they involve both weakened immunity and exposure to crowded conditions.

Frequently Asked Questions

Can you get pneumonia from being cold or wet?

Cold weather and wet conditions don't directly cause pneumonia, but they may increase risk indirectly. Cold air can irritate airways, and people spend more time indoors in crowded spaces during winter, increasing germ exposure. Being wet and cold might stress your immune system slightly, but pneumonia requires actual infection with bacteria, viruses, or fungi—not just exposure to cold.

Is pneumonia contagious?

The germs that cause pneumonia are contagious, but pneumonia itself is not. You can catch the cold or flu virus from someone with viral pneumonia, but whether you develop pneumonia depends on your immune system and risk factors. Most people who catch the virus will have mild symptoms or no symptoms at all.

How long does it take to develop pneumonia after exposure?

This varies widely. Viral pneumonia typically develops over three to seven days as the initial cold or flu worsens. Bacterial pneumonia can develop within one to three days of exposure, sometimes appearing suddenly. Fungal pneumonia develops slowly over weeks or months. Many people are exposed to pneumonia-causing germs without ever developing the disease.

Can pneumonia develop without being around sick people?

Yes. You can develop aspiration pneumonia from your own mouth bacteria if you have a swallowing problem. You can also develop pneumonia from environmental germs—fungal spores in soil or water, or bacteria in contaminated water systems. Additionally, bacteria that normally live in your nose and throat can sometimes travel to your lungs if your defenses are weakened.

Why do some people get pneumonia repeatedly?

Recurrent pneumonia usually indicates an underlying problem: chronic lung disease, a swallowing disorder, weakened immunity, or smoking. Some people have anatomical issues that trap secretions. Others have conditions that impair immune response. If someone develops pneumonia more than once in a year, their doctor will investigate the underlying cause rather than treating each episode in isolation.