How pneumonia starts in your lungs
Pneumonia develops when an infection—bacterial, viral, or fungal—reaches the air sacs deep in your lungs called alveoli. Normally, these tiny sacs fill with air. When infected, they fill with fluid or pus instead, making it harder for oxygen to pass into your bloodstream. This is why pneumonia causes shortness of breath and the feeling that you cannot get enough air.
The infection usually arrives one of two ways: you breathe in germs directly from the air, or germs already in your mouth or throat slip down into your lungs instead of staying in your esophagus. Most people's lungs have defenses against this—mucus traps particles, and tiny hair-like structures called cilia sweep them back up. But if those defenses are weakened or overwhelmed, infection takes hold.
Key Takeaways
- Pneumonia occurs when bacteria, viruses, or fungi infect the air sacs in your lungs and fill them with fluid, blocking oxygen from entering your blood.
- Most pneumonia follows a respiratory infection like a cold or flu, especially if your immune system is already weakened.
- Certain conditions—age over 65, chronic lung disease, heart disease, diabetes, or a weakened immune system—significantly raise your risk.
- Symptoms typically appear within days of infection and include cough, fever, chest pain, and shortness of breath.
- A chest X-ray or CT scan is needed to confirm pneumonia; a doctor cannot diagnose it by listening to your chest alone.
Why some people get pneumonia and others don't
Your risk depends largely on the strength of your immune system and whether you have conditions that make infection more likely. People over 65, those with chronic lung disease (like COPD or asthma), heart disease, diabetes, or a weakened immune system face much higher risk. Smoking also damages the cilia that normally clear germs, leaving lungs more vulnerable.
Pneumonia often follows another respiratory infection. You recover from a cold or flu, but the virus has already damaged your airway lining, making it easier for bacteria to move in. This is why pneumonia in winter is common—flu season creates the conditions for secondary bacterial infection. People in hospitals or nursing homes face higher risk because they are around more resistant germs and may have weakened defenses from other illnesses.
The difference between viral and bacterial pneumonia
Viral pneumonia usually develops during or right after a cold or flu. The virus itself infects the lung tissue, causing inflammation and fluid buildup. Symptoms tend to come on gradually and feel like a worsening cold—cough, fatigue, mild fever. Viral pneumonia often resolves on its own as your immune system clears the virus, though it can take weeks.
Bacterial pneumonia typically hits harder and faster. Symptoms appear suddenly—high fever, shaking chills, cough with thick or bloody sputum, sharp chest pain when breathing. Bacterial pneumonia is more likely to require antibiotics and hospitalization. Streptococcus pneumoniae is the most common bacterial cause in adults; Haemophilus influenzae and Legionella are also significant.
A third category, fungal pneumonia, is less common and usually occurs only in people with severely weakened immune systems—those with advanced HIV, on immunosuppressant drugs, or recovering from organ transplants.
What happens in your body when pneumonia develops
When germs reach the alveoli, your immune system responds by sending white blood cells to fight the infection. This triggers inflammation—the tissue swells and produces fluid. As more fluid accumulates, the alveoli fill up instead of staying air-filled. Oxygen cannot cross into the blood, so your body does not get the oxygen it needs. Your brain senses this and tells you to breathe faster and harder, which is why shortness of breath is a hallmark symptom.
At the same time, the infection triggers fever as your body tries to kill the germs. You may feel chilled because your body is raising its temperature set point. The cough develops as your lungs try to clear the fluid and irritation. If the infection spreads to the pleura—the membrane surrounding your lungs—you feel sharp pain when you breathe in, a condition called pleurisy.
In severe cases, the infection can spread into the bloodstream, causing sepsis, or the inflammation can be so severe that your lungs cannot deliver enough oxygen even with supplemental air. This is why pneumonia can become life-threatening and why older adults and those with other illnesses are at higher risk of serious outcomes.
Common symptoms and when they appear
Symptoms usually develop over one to three days, though viral pneumonia can come on more gradually. The most common signs are a persistent cough (often producing sputum), fever, chills, fatigue, and shortness of breath. You may also feel chest pain that worsens when you breathe deeply or cough, muscle aches, and headache.
In older adults, symptoms can be subtler—confusion, loss of appetite, or a fall may be the first sign rather than obvious fever or cough. This is one reason pneumonia in elderly people is often caught later. Children may vomit or have diarrhea alongside respiratory symptoms.
If you develop severe shortness of breath, confusion, bluish lips or fingernails, or chest pain, seek immediate medical attention. These suggest the infection is affecting your oxygen levels significantly.
How doctors confirm pneumonia
A doctor cannot diagnose pneumonia by listening to your chest with a stethoscope alone, even though certain sounds suggest it. Confirmation requires imaging—usually a chest X-ray, which shows areas of the lung filled with fluid or consolidation. A CT scan may be used if the X-ray is unclear or if the doctor suspects complications.
Blood tests can help identify whether the cause is bacterial or viral. A sputum culture—analyzing the mucus you cough up—can identify the specific bacterium, which guides antibiotic choice. In hospitalized patients, doctors may do a blood culture to check whether the infection has entered the bloodstream.
Pulse oximetry measures the oxygen level in your blood; a reading below 95% suggests your lungs are not delivering oxygen effectively. This simple test often determines whether you need hospitalization.
Risk factors that make pneumonia more likely
Age is a major factor—people 65 and older have weaker immune responses and are more likely to have chronic conditions that complicate pneumonia. Smoking damages lung defenses and increases risk at any age. Chronic diseases like COPD, asthma, heart disease, and diabetes all raise susceptibility.
A weakened immune system from HIV, chemotherapy, or immunosuppressant medications makes pneumonia more likely and more severe. Recent hospitalization or surgery also increases risk because you may have been exposed to resistant bacteria. Alcohol use disorder impairs immune function and increases aspiration risk—the chance that stomach contents or saliva slip into the lungs instead of going down the esophagus.
Living in close quarters—dormitories, military barracks, nursing homes—raises exposure risk. Bedridden patients face higher risk because they cannot clear secretions from their lungs as effectively.
Frequently Asked Questions
Can you catch pneumonia from someone else?
Yes, but not always. Viral pneumonia spreads through respiratory droplets—coughing, sneezing, or close contact. Bacterial pneumonia is less contagious; you usually develop it from germs already in your own mouth or throat, not from breathing in someone else's bacteria. If you have pneumonia, covering your cough and washing your hands reduces spread to others.
Is pneumonia always serious?
Not always. Many people recover from mild viral pneumonia at home with rest and fluids. But pneumonia can become serious quickly, especially in older adults, people with chronic illness, or those with weakened immune systems. This is why any persistent cough with fever warrants evaluation by a doctor.
Can you get pneumonia twice?
Yes. Having pneumonia once does not make you immune. You can catch different strains of bacteria or virus, or develop pneumonia from a different cause. People with chronic lung disease are at higher risk of recurrent pneumonia.
What's the difference between pneumonia and bronchitis?
Bronchitis inflames the airways that carry air to the lungs; pneumonia infects the air sacs themselves. Bronchitis usually causes a cough but does not fill the lungs with fluid. Pneumonia causes shortness of breath and shows up on a chest X-ray. Bronchitis typically clears without antibiotics; bacterial pneumonia usually requires them.
Does cold weather cause pneumonia?
Cold weather does not directly cause pneumonia, but it increases risk indirectly. People spend more time indoors in close contact, spreading respiratory viruses. Flu season peaks in winter, and pneumonia often follows flu. Cold air can also irritate airways, making them more vulnerable to infection.