How pneumonia starts in your lungs
Pneumonia develops when germs—usually bacteria, viruses, or fungi—enter your lungs and multiply. Your lungs fill with fluid or pus, which makes it hard for oxygen to reach your bloodstream. You don't catch pneumonia the way you catch a cold. Instead, germs that are already in your body or that you breathe in settle in your lungs and trigger an infection.
Most people get pneumonia after their immune system has been weakened by another illness. A cold or flu virus damages the lining of your airways, making it easier for bacteria to take hold. Sometimes pneumonia develops on its own, but often it follows a respiratory infection you've already had.
The germs that cause pneumonia are common. Many people breathe them in without getting sick because their immune system fights them off. Pneumonia happens when that defense fails—either because the germs are particularly aggressive or because your body is too weakened to stop them.
Key Takeaways
- Pneumonia develops when bacteria, viruses, or fungi multiply in your lungs and fill the air sacs with fluid or pus.
- Most cases follow a cold or flu that has already weakened your immune system or damaged your airways.
- You can get pneumonia by breathing in germs from the air, from droplets when an infected person coughs, or from germs already in your own body.
- Certain conditions—age over 65, smoking, chronic lung disease, or a weakened immune system—make pneumonia more likely to develop.
- Pneumonia can develop over days or come on suddenly, depending on which germ is causing it.
The three main routes pneumonia enters your lungs
Breathing in contaminated air is the most common way. When someone with pneumonia coughs or sneezes, they release droplets into the air. If you breathe those droplets in, the germs can settle in your lungs. This is why pneumonia spreads more easily in crowded places like hospitals, nursing homes, or public transit.
Aspiration happens when you breathe in something you should have swallowed instead. This can be food, saliva, or stomach contents. If your swallowing reflex is weak—because of a stroke, sedation, or difficulty swallowing—germs from your mouth or throat can slip into your lungs. Aspiration pneumonia is common in people who have had a stroke or who are bedridden.
Germs already in your body can also cause pneumonia. Bacteria live harmlessly in your mouth and throat all the time. If your immune system weakens, these bacteria can travel down into your lungs and start an infection. This is why pneumonia often follows a cold or flu—the virus has already damaged your immune defenses.
Why some people get pneumonia and others don't
Your age and overall health determine how easily pneumonia takes hold. Adults over 65 have weaker immune systems and are more likely to develop pneumonia after a respiratory infection. Babies under 2 are also at high risk because their immune systems are still developing.
Certain medical conditions make pneumonia more likely. Chronic obstructive pulmonary disease (COPD), asthma, and other lung diseases damage the airways and make it harder to clear germs. Diabetes, heart disease, and kidney disease all weaken your immune response. If you have HIV or take medications that suppress your immune system, pneumonia is a serious risk.
Smoking damages the cells that line your airways and clear away germs, so smokers develop pneumonia more often than non-smokers. Alcohol use disorder also weakens immunity and increases risk. Even something as simple as being bedridden for a long time can lead to pneumonia because fluid pools in your lungs and germs can grow there.
How quickly pneumonia develops
The speed depends on which germ is causing it. Bacterial pneumonia often comes on suddenly—you might feel fine one day and very sick the next. Streptococcus pneumoniae, the most common bacterial cause, can develop over 24 to 48 hours.
Viral pneumonia usually develops more slowly. You might have a cold for several days, then notice your cough getting worse and your breathing becoming harder. The illness can linger for weeks. COVID-19 pneumonia, caused by the coronavirus, typically develops 5 to 14 days after infection.
Fungal pneumonia develops slowly over weeks or even months. It's less common and usually only happens in people with severely weakened immune systems. Because it develops gradually, people often don't realize they have pneumonia until it's advanced.
What happens inside your lungs when infection takes hold
When germs reach your lungs, they settle in the tiny air sacs called alveoli. Your immune system responds by sending white blood cells to fight the infection. This battle causes inflammation—swelling and irritation of the lung tissue. The inflammation makes the alveoli leak fluid, which fills the air sacs instead of air.
As more fluid accumulates, less oxygen can pass into your bloodstream. This is why pneumonia makes you short of breath. Your body tries to compensate by making you breathe faster and harder, which is why rapid breathing is often one of the first signs.
The fluid can be clear (from inflammation), cloudy (from pus and dead white blood cells), or bloody (if the infection damages blood vessels). A chest X-ray shows this fluid as white patches on the image, which is how doctors confirm pneumonia.
Risk factors that make pneumonia more likely
Recent respiratory illness is the biggest risk factor. If you've had a cold, flu, or bronchitis in the past two weeks, your lungs are more vulnerable. The damage to your airways and the temporary weakening of your immune system create the perfect conditions for pneumonia to develop.
Hospitalization increases risk significantly. Hospitals contain more aggressive germs, and being in a hospital bed weakens your body. Ventilators—breathing tubes used in intensive care—can introduce germs directly into the lungs. This is why hospital-acquired pneumonia is a serious concern.
Lifestyle factors matter too. Poor nutrition makes your immune system weaker. Sleep deprivation does the same. Stress hormones suppress immunity, so people under extreme stress are more vulnerable. Even exposure to air pollution or secondhand smoke can damage your airways and increase risk.
When pneumonia develops after surgery or anesthesia
Surgery and anesthesia create a window of vulnerability. Anesthesia paralyzes your muscles temporarily, including the ones that help clear fluid from your lungs. After surgery, you're often immobile and in pain, which makes you less likely to cough or move around—both of which help keep your lungs clear.
Pain medications and sedatives also suppress your immune response. If you aspirate during surgery (breathe in stomach contents), bacteria can be introduced directly into your lungs. This is why doctors encourage patients to move, cough, and breathe deeply after surgery—these actions help prevent pneumonia.
Pneumonia that develops within 48 hours of surgery is usually caused by aspiration or by germs introduced during the procedure. Pneumonia that develops days or weeks later is more likely to be from a new infection or from germs that were already in your body.
Frequently Asked Questions
Can you get pneumonia from being cold or wet?
No. Cold weather and wet clothes don't cause pneumonia directly. However, cold stress can temporarily weaken your immune system, making you more vulnerable if you're exposed to pneumonia germs. The real risk is being indoors with others in winter, where germs spread more easily in heated, dry air.
Is pneumonia contagious?
Yes, but only in the early stages. Bacterial pneumonia is contagious for about 24 hours after you start antibiotics. Viral pneumonia is contagious for several days. Once you're on treatment and feeling better, you're much less likely to spread it. Fungal pneumonia is rarely contagious between people.
Can pneumonia develop from a single exposure to germs?
Rarely. Most people breathe in pneumonia germs regularly without getting sick. Pneumonia usually requires either repeated exposure, a very aggressive germ, or a weakened immune system. The exception is if you aspirate a large amount of contaminated material directly into your lungs.
Why do some people get pneumonia every year?
Repeated pneumonia usually means your immune system is compromised or your lungs are already damaged. Chronic lung disease, smoking, or conditions like COPD make recurrence common. Some people have anatomical problems with swallowing that make aspiration pneumonia likely. A doctor can help identify why you're getting it repeatedly.
Can you get pneumonia without being around sick people?
Yes. You can develop pneumonia from germs already in your own mouth and throat if your immune system weakens enough. You can also get it from environmental sources like contaminated water or air conditioning systems, though this is less common. Aspiration pneumonia can happen without any exposure to sick people.