How pneumonia starts in your lungs
Pneumonia develops when germs—bacteria, viruses, or fungi—get into your lungs and cause an infection. Your lungs fill with fluid or pus, making it harder for oxygen to reach your bloodstream. This happens in stages: first the germ enters your respiratory tract, then it travels down to the air sacs (called alveoli) deep in your lungs, where it multiplies and triggers inflammation.
Most people catch pneumonia after their body has already been fighting off another infection. A cold or the flu weakens your immune system just enough that a secondary germ can take hold. This is why pneumonia often follows a respiratory illness by a week or two, even after you thought you were getting better.
The germs travel into your lungs through the air you breathe. When someone with pneumonia coughs or sneezes, they release droplets containing the infection. You inhale those droplets, and if your immune system is not strong enough to fight them off immediately, the infection settles in your lungs.
Key Takeaways
- Pneumonia occurs when bacteria, viruses, or fungi infect the air sacs in your lungs and cause them to fill with fluid or pus.
- Most cases develop after a cold or flu has already weakened your immune system, typically one to three weeks later.
- You catch pneumonia by breathing in infected droplets from a cough or sneeze, or less commonly from germs already in your own mouth or nose.
- Certain groups—older adults, people with chronic illnesses, and those with weakened immune systems—are at higher risk of developing pneumonia.
- Pneumonia can develop quickly (over hours or days) or slowly (over a week or more), depending on which germ is causing it.
Why some people get pneumonia and others don't
Your immune system is your first line of defense against the germs that cause pneumonia. When it is working well, it kills invading bacteria or viruses before they can multiply in your lungs. But several things can weaken your immune system and make pneumonia more likely.
Age is one factor. Adults over 65 have immune systems that do not respond as quickly to new infections. Children under 5, especially under 2, are still building their immune defenses and are more vulnerable. Chronic illnesses like diabetes, heart disease, or COPD also increase your risk because they tax your immune system or damage your lungs directly.
Smoking damages the cells that line your airways and help clear out germs, so smokers are at higher risk. People living with HIV, those taking medications that suppress the immune system (like steroids for autoimmune conditions), and people who have recently had surgery or a serious illness are all more vulnerable. Even severe stress or poor nutrition can tip the balance in favor of infection.
The difference between viral and bacterial pneumonia
Viral pneumonia usually develops during or right after a cold or flu. The virus that caused your initial illness spreads down into your lungs. Viral pneumonia often comes on gradually—you feel tired, your cough worsens, and you develop a low fever. It typically causes less severe illness than bacterial pneumonia, though some viral strains can be serious.
Bacterial pneumonia often strikes more suddenly. You may feel fine one day and very sick the next, with a high fever, severe cough, and chest pain. Streptococcus pneumoniae is the most common bacterial cause in adults. Bacterial pneumonia is more likely to require hospitalization and antibiotics.
Fungal pneumonia is less common and usually only develops in people with significantly weakened immune systems. It tends to progress slowly and can be harder to diagnose because the symptoms are subtle at first.
How pneumonia spreads from person to person
Pneumonia spreads the same way colds and flu do: through respiratory droplets. When someone with pneumonia coughs, sneezes, or even talks, they release tiny droplets containing the infection. If you are nearby—usually within about six feet—you can breathe those droplets in.
You are most contagious in the first few days of pneumonia, when your cough is worst. This is why people with pneumonia are asked to stay home and cover their cough. If you have pneumonia and live with others, keeping distance and washing your hands frequently reduces the chance of spreading it.
Not everyone who breathes in the germ will develop pneumonia. Your immune system may fight it off before it reaches your lungs, or it may cause only a mild cough. Whether you get sick depends on how strong your immune system is at that moment and how many germs you were exposed to.
When pneumonia develops after surgery or hospitalization
Hospital-acquired pneumonia (sometimes called nosocomial pneumonia) develops while someone is in the hospital or within 48 hours of discharge. It is caused by germs found in the hospital environment, which are often different from the bacteria that cause community pneumonia. These hospital germs are sometimes resistant to common antibiotics, making the infection harder to treat.
People on ventilators (breathing machines) are at particular risk because the tube bypasses your body's normal defenses. Germs can travel down the tube directly into the lungs. This is called ventilator-associated pneumonia.
After surgery, your immune system is focused on healing the surgical wound, and your ability to cough and clear your lungs is reduced—especially if you received strong pain medication or anesthesia. This creates an opening for infection. Doctors watch post-surgery patients closely for signs of pneumonia and encourage early movement and deep breathing to reduce the risk.
Aspiration pneumonia: when food or liquid enters the lungs
Aspiration pneumonia develops when food, liquid, or stomach contents accidentally enter your lungs instead of going down your esophagus to your stomach. This can happen if you have difficulty swallowing, are unconscious, or aspirate while vomiting. The material irritates your lungs and can introduce bacteria from your mouth or stomach.
People at higher risk of aspiration include those with swallowing disorders (dysphagia), people with stroke or neurological conditions, those with severe reflux, and people who are sedated or unconscious. Aspiration pneumonia often develops more slowly than other types and may be harder to diagnose because the initial trigger—the aspiration event—may not be obvious.
If you have a condition that affects swallowing, your doctor may recommend eating smaller bites, sitting upright while eating, and avoiding foods that are hard to swallow. These steps reduce the risk of aspiration.
Frequently Asked Questions
Can you get pneumonia from being cold or wet?
No. Cold weather and wet clothes do not cause pneumonia. You get pneumonia from germs, not from temperature or moisture. However, cold weather may increase your risk indirectly because people spend more time indoors in close contact with others, making it easier for respiratory infections to spread.
How long after exposure to pneumonia do symptoms appear?
It depends on the type of germ. Viral pneumonia symptoms often develop gradually over several days as a cold or flu worsens. Bacterial pneumonia can come on suddenly, sometimes within 24 to 48 hours of exposure. Fungal pneumonia may take weeks to show clear symptoms.
If someone in my house has pneumonia, will I definitely get it?
No. Many people exposed to pneumonia do not develop it. Your risk depends on your age, overall health, whether you have been vaccinated, and how strong your immune system is at that moment. Washing your hands, keeping distance, and asking the sick person to cover their cough all reduce transmission.
Can pneumonia develop without a cough?
Rarely, but it is possible. Some people, especially older adults, may develop pneumonia with minimal cough symptoms. They might have only fatigue, fever, or shortness of breath. This is one reason doctors sometimes order a chest X-ray even when a cough is not the main complaint.
Does pneumonia always follow a cold or flu?
No. While pneumonia often develops after another respiratory illness, it can also develop on its own, especially in people with weakened immune systems or chronic lung disease. However, having a recent cold or flu does increase your risk significantly.