How pneumonia starts in your body
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 hard for oxygen to reach your bloodstream. This happens in stages: first the germ enters your respiratory tract, then it multiplies in the air sacs (called alveoli), and your immune system responds by causing inflammation. That inflammation is what makes you cough, feel chest pain, and struggle to breathe.
You don't catch pneumonia the way you might catch a cold from someone sneezing on you. Instead, you inhale droplets or particles that contain the germ, or the germ travels down from your upper airways into your lungs. Sometimes pneumonia develops after you've already had a viral infection like the flu—the virus damages your lung tissue, making it easier for bacteria to move in and cause a secondary infection.
Not everyone who is exposed to pneumonia-causing germs will develop the disease. Your age, overall health, smoking history, and whether your immune system is weakened all affect your risk. People over 65, infants, smokers, and those with chronic conditions like asthma or heart disease are more likely to develop pneumonia if exposed.
Key Takeaways
- Pneumonia develops when bacteria, viruses, or fungi enter your lungs and multiply, causing your air sacs to fill with fluid or pus.
- You inhale the germ through respiratory droplets or particles, often after a viral infection has already weakened your lungs.
- Your immune system's response to the infection causes coughing, chest pain, and difficulty breathing.
- Age, smoking, chronic illness, and a weakened immune system increase your risk of developing pneumonia after exposure.
- Pneumonia can develop gradually over days or come on suddenly, depending on the type of germ causing it.
The different types of germs that cause pneumonia
Bacterial pneumonia is the most common type in adults. The bacterium Streptococcus pneumoniae causes about half of all bacterial cases. Other bacteria include Haemophilus influenzae, Legionella pneumophila (which grows in warm water systems), and Staphylococcus aureus. Bacterial pneumonia usually develops quickly and causes high fever, shaking chills, and thick, discolored sputum (the mucus you cough up).
Viral pneumonia is often milder than bacterial pneumonia, though it can be serious. Influenza (flu) virus, respiratory syncytial virus (RSV), and coronaviruses including SARS-CoV-2 (which causes COVID-19) can all cause viral pneumonia. Viral pneumonia typically develops gradually and causes a dry cough, fatigue, and muscle aches before you develop breathing problems.
Fungal pneumonia is less common and usually affects people with weakened immune systems—those with HIV/AIDS, people taking immunosuppressant medications, or those who have had an organ transplant. Pneumocystis jirovecii is a fungus that causes a specific type of pneumonia in people with very low CD4 counts. Fungal pneumonia develops slowly and may not cause obvious symptoms until the infection is advanced.
How the infection spreads through your lungs
Once the germ reaches your lungs, it settles in the air sacs where oxygen normally passes into your blood. The germ multiplies rapidly, and your immune system responds by sending white blood cells to fight the infection. This immune response causes the air sacs to become inflamed and fill with fluid, pus, or blood—a process called consolidation. When this happens, those air sacs can no longer transfer oxygen, so less oxygen reaches your blood.
The infection can spread to nearby air sacs, affecting larger areas of your lung. In some cases, the infection stays in one lung (unilateral pneumonia), but it can affect both lungs (bilateral pneumonia). Bilateral pneumonia is more serious because it reduces oxygen transfer more dramatically. The more air sacs involved, the harder your lungs have to work and the more severe your symptoms become.
If the infection reaches the pleura—the thin membrane surrounding your lungs—you may develop pleural effusion, where fluid builds up between the lung and chest wall. This makes breathing even more painful. In rare cases, the infection can enter the bloodstream and spread to other parts of your body, a condition called sepsis.
Risk factors that make pneumonia more likely
Your age is one of the strongest risk factors. Adults over 65 and children under 5 are at highest risk. Infants under 2 have immature immune systems that cannot fight off germs as effectively, while older adults often have weaker immune responses and may have other health conditions that complicate recovery.
Smoking damages the cells that line your airways and clear out mucus and germs, making it easier for pneumonia-causing bacteria to take hold. People who smoke are two to three times more likely to develop pneumonia than non-smokers. Chronic lung diseases like COPD (chronic obstructive pulmonary disease) and asthma also increase risk because your airways are already inflamed and damaged.
A weakened immune system from any cause raises your risk significantly. This includes people with HIV/AIDS, those undergoing chemotherapy for cancer, people taking medications that suppress the immune system after organ transplants, and those with uncontrolled diabetes. Recent surgery, especially chest or abdominal surgery, also temporarily weakens your ability to fight infection. Alcohol misuse damages immune function and increases aspiration risk—when stomach contents accidentally enter your lungs instead of going to your stomach.
Heart disease, kidney disease, and liver disease all increase pneumonia risk. Being bedridden or having difficulty swallowing makes it easier for germs to enter your lungs. Hospitalization itself is a risk factor because hospital environments contain antibiotic-resistant bacteria.
How pneumonia develops after other illnesses
Pneumonia often follows a viral respiratory infection like the flu or a common cold. The virus damages the protective lining of your airways and air sacs, killing the cells that normally clear out mucus and bacteria. This creates an opening for secondary bacterial infection. You might feel better for a few days after your initial illness, then suddenly develop a high fever, productive cough, and chest pain—signs that bacterial pneumonia has developed on top of the viral infection.
This pattern is especially common with influenza. Flu weakens your lungs' defenses, and Streptococcus pneumoniae bacteria can then move in and cause severe bacterial pneumonia. This is why people who have had the flu sometimes develop pneumonia as a complication weeks later.
Aspiration pneumonia develops through a different route. If you have difficulty swallowing, are sedated, or are unconscious, food, liquid, or stomach contents can enter your lungs instead of going down your esophagus to your stomach. Bacteria that normally live in your mouth and throat then cause an infection in your lungs. This type of pneumonia is common in people who have had a stroke, those with neurological conditions affecting swallowing, and people who are heavily sedated in hospitals.
Symptoms that appear as pneumonia develops
The symptoms of pneumonia vary depending on the type of germ, your age, and your overall health. Bacterial pneumonia usually comes on suddenly. You might develop a high fever (often above 103°F), shaking chills, a cough that produces thick, greenish or rust-colored sputum, chest pain that worsens when you breathe or cough, and shortness of breath. Some people also experience nausea, vomiting, or diarrhea.
Viral pneumonia typically develops more gradually. You might start with a dry cough, fatigue, muscle aches, and a low-grade fever. Over several days, the cough may become productive, and you may develop shortness of breath. Viral pneumonia symptoms can feel similar to a bad cold or flu for the first few days.
In older adults and very young children, pneumonia symptoms can be subtle or atypical. An older person might not develop a high fever; instead, they might become confused, lose their appetite, or simply feel very tired. A young child might have only a mild cough and fever but still have significant pneumonia. This is why pneumonia can be missed in these age groups if you're not alert to the possibility.
When to seek medical evaluation
Contact a doctor if you develop a cough that lasts more than a week, especially if you're coughing up sputum. Seek immediate medical attention if you have difficulty breathing, chest pain, a high fever that doesn't improve with over-the-counter fever reducers, confusion, or bluish lips or fingernails (a sign of low oxygen). If you're over 65, have a chronic health condition, or have recently had the flu or another respiratory infection, be especially alert to these warning signs.
A doctor will listen to your lungs with a stethoscope—pneumonia often produces crackling sounds or areas where breath sounds are quieter than normal. They may order a chest X-ray to confirm pneumonia and see how much of your lung is affected. A sputum sample or blood test can identify which germ is causing the infection, helping your doctor choose the right treatment.
Getting evaluated early matters because pneumonia can worsen quickly. Starting treatment within the first few days of symptoms leads to better outcomes and reduces the risk of serious complications.
Frequently Asked Questions
Can you get pneumonia from being cold or wet?
Cold weather and wet conditions don't directly cause pneumonia, but they can increase your risk. Cold air can irritate your airways, and being wet and cold may stress your immune system temporarily. The real cause is always a germ—bacteria, virus, or fungus. However, if cold weather keeps you indoors around others who are sick, your exposure to pneumonia-causing germs increases.
Is pneumonia contagious?
The germs that cause pneumonia are contagious, but pneumonia itself is not. You can catch the cold or flu virus that someone has, and that virus might lead to pneumonia in you—but not everyone who catches that virus develops pneumonia. Bacterial pneumonia is generally less contagious than viral pneumonia. If you have pneumonia, you can spread the underlying germ to others through respiratory droplets when you cough or sneeze.
Can pneumonia develop without a cough?
Yes, especially in older adults and very young children. Some people develop pneumonia with only a fever and fatigue, without a prominent cough. This is one reason why pneumonia can be missed in these age groups. If you have a fever lasting more than a few days along with shortness of breath or chest discomfort, see a doctor even if you're not coughing much.
How long does it take for pneumonia to develop after exposure?
The timeline varies. Viral pneumonia may develop within a few days of exposure to the virus. Bacterial pneumonia can develop within days or may follow a viral infection by a week or two. Fungal pneumonia develops much more slowly, sometimes over weeks. If you've been exposed to someone with pneumonia or have had a recent respiratory infection, watch for symptoms over the next one to three weeks.
Can you prevent pneumonia if you've been exposed?
There's no way to prevent pneumonia with certainty after exposure, but you can reduce your risk. If you're over 65 or have a chronic health condition, pneumococcal and flu vaccines lower your risk of developing pneumonia from those specific germs. Getting adequate sleep, staying hydrated, and avoiding smoking also support your immune system. If you develop symptoms after exposure, seeking medical attention early can prevent the infection from becoming severe.