What Is Viral Pneumonia?

Medically Reviewed by Shruthi N, MD on June 03, 2025
7 min read

Viral pneumonia is a viral infection in your lungs. The most common cause is the flu. But the common cold and other viruses can also cause pneumonia. These germs usually stick to the upper part of your respiratory system.

Trouble starts when viruses get into your lungs. Your lungs' air sacs fill up with fluid and get infected and inflamed. If your body's defenses (immune system) weaken, you're at higher risk for pneumonia.

Certain risk factors can raise your viral pneumonia risk, such as a weakened immune system. Viruses can travel in air droplets after a person sneezes or coughs. These fluids can get into your body through your nose or mouth. And you can get infected after you touch a virus-covered surface.

You're at higher risk for viral pneumonia if you:

  • Are 65 or older
  • Have chronic conditions such as asthma, diabetes, or heart disease
  • Are recovering from surgery
  • Don’t eat right or get enough vitamins and minerals
  • Have another condition weakening your body’s defenses
  • Smoke
  • Drink too much alcohol
  • Are HIV-positive
  • Recently had an organ transplant
  • Have leukemia, lymphoma, or serious kidney disease

Babies and children aged 2 years or younger also have a higher risk.

Viruses causing pneumonia include:

  • Influenza (flu) A and B, the most common in adults
  • Respiratory syncytial virus (RSV), more common in infants and children than in adults
  • Coronaviruses, including SARS-CoV-2 (which causes COVID-19)
  • Rhinoviruses, parainfluenza viruses, and adenoviruses (cause pink eye)

Rarely, other viruses can cause pneumonia. These viruses can include herpes simplex, measles, and chickenpox.

Can viral bronchitis turn into pneumonia?

With treatment, viral bronchitis doesn't usually turn into pneumonia. Bronchitis is swelling and inflammation of your main airways. With viral bronchitis, a virus causes swelling. The narrowing can make it harder to breathe. With rest and plenty of fluids, bronchitis usually goes away. But your cough can last about three weeks.

Conditions such as asthma or chronic obstructive pulmonary disease can lower immune response. These chronic lung problems can raise your risk for viral pneumonia. But it is important to tell bronchitis from viral pneumonia. Knowing the symptoms for pneumonia can help.

Viral pneumonia usually gets worse over a few days. On the first day, it can feel like the flu. 

With viral pneumonia, you may get:

  • Fever
  • Cough (can be dry)
  • Difficulty catching your breath
  • Headache
  • Sore throat
  • Loss of appetite
  • Muscle pain

After a day or so, your fever might get worse. 

Sometimes, bacteria can also invade your lungs. This can comomonly cause bacterial pneumonia. With this serious pneumonia, you may get:

  • A wet, gunky cough with green, yellow, or bloody mucus
  • Chills that make you shake
  • Fatigue (feeling very tired)
  • Low appetite
  • Sharp or stabbing chest pain, especially when you cough or take a deep breath
  • Sweating a lot
  • Fast breathing and heartbeat
  • Blue lips and fingernails
  • Confusion, especially if you're older

Your doctor can examine you to see if you have viral pneumonia. They'll ask questions about your symptoms and general health. Your doctor uses a stethoscope to listen to your lungs. Certain sounds can mean you have fluid in your lungs. 

But if your doctor isn't sure, they'll order a chest X-ray. You may also get tests such as:

  • Pulse oximetry (a small gizmo clipped to your finger measures your blood oxygen levels)
  • Blood tests
  • Testing for the gunk you cough up (sputum tests)
  • CT scans to look closely at your lungs
  • A pleural fluid culture (a needle takes fluid from your chest)
  • Bronchoscopy to look into your lungs through a scope

Viral pneumonia is contagious. Viruses can travel from an infected person's cough or sneeze. If you inhale these droplets, you can get viral pneumonia. But your immune system also plays a role. With a weakened immune system, you're at higher risk for viral pneumonia.

How long will viral pneumonia last?

With treatment, most people get better after two to three days. You'll likely recover without problems after a week. But viral pneumonia can be mild to serious. 

Depending on your health, it may take a few weeks to a month to feel better. If you're older or have other medical conditions, your recovery could take longer.

Except for COVID, viral pneumonia usually runs its course. Here are some common treatments.

Antibiotics for pneumonia. Because your doctor won't know what's causing your infection, they'll give you an antibiotic. The medicine targets the most likely cause, such as bacteria.

Oxygen therapy. Your doctor may also give you oxygen if you're not getting enough.

Fluids for dehydration. You may get IV fluids (through your vein) if you lose too much water (get dehydrated).

Antiviral medications. Your doctor may prescribe an antiviral, too. This can help if your pneumonia is caused by COVID, influenza, or RSV. If you have COVID, your doctor may prescribe:

  • Nirmatrelvir with Ritonavir (Paxlovid)
  • Molnupiravir (Lagevrio)
  • Remdesivir (Veklury)

With influenza, your doctor may give you an antiviral such as:

  • Baloxavir marboxil (Xofluza)
  • Oseltamivir phosphate (Tamiflu)
  • Peramivir (Rapivab)
  • Zanamivir (Relenza)

If RSV causes your pneumonia, you may get the antiviral ribavirin (Virazole). The medicine can help limit the spread of viruses.

Steroid treatment. Depending on your health condition, you may get a steroid. This can help lower inflammation and prevent injury to your lungs.

Your doctor may also suggest medicines to reduce your pain and fever. Here are some things you can do to feel better:

  • Get lots of rest.
  • Drink plenty of fluids to loosen up the mucus in your lungs, so you can cough it out.
  • Use a humidifier or take a warm bath (which further loosens the mucus).
  • Don't smoke .
  • Stay home until your fever goes down and you're not coughing.

You'll begin to feel better as the virus runs its course. Make sure you keep your follow-up visits. Your doctor can check your lungs.

Hospital stays for viral pneumonia aren't common. But if the virus is serious or doesn't go away, go to the hospital to get:

  • Oxygen treatment
  • IV fluids and medications
  • Treatment to help loosen up the gunk

Although viral pneumonia is usually mild, it can be serious. Long-term problems can happen after a pneumonia infection. Pneumonia from influenza is among the 10 most common causes of death in the U.S.

Most people with "walking" pneumonia get better after a month. But only three-quarters of people with serious viral pneumonia get better. That's because life-threatening problems like sepsis, respiratory failure, or heart problems can happen.

To avoid viral pneumonia, you can:

  • Not smoke.
  • Get the flu vaccine (influenza) every year.
  • If you're at risk, get the pneumococcal vaccine.
  • Get the SARS-CoV-2 (COVID) booster every year.

And you can get vaccinated to prevent RSV, if you're an infant or 60 years or older. To help lower your viral pneumonia risk, you can:

  • Wash your hands regularly, especially before eating or after going to the bathroom.
  • Eat right by adding plenty of fruits and vegetables to your diet.
  • Exercise.
  • Get enough sleep.
  • Use preventive measures such as wear a mask, avoid crowds, and limit face-to-face contact.

Vaccines for viral pneumonia

There isn't a vaccine for viral pneumonia. But you can get vaccinated for the viruses causing viral pneumonia. There is an influenza, COVID, and RSV vaccine. And there are pneumococcal vaccines to prevent bacterial pneumonia, too.

These vaccines can help prevent what's called secondary infections. Sometimes, a common cold virus can lead to a secondary infection (pneumonia). The best way to prevent bacterial pneumonia is getting the pneumococcal vaccine. 

There are two vaccine types:

Pneumococcal conjugate vaccines (PCVs). The PCV15, PCV20, and PCV21 vaccines protect you against strains of pneumococcal bacteria. The number at the end of the vaccine tells you how many strains you're protected from.

PCV15 can protect against 15 bacterial strains. PCVs are given to people younger than 5 and adults 50 years or older.

Pneumococcal polysaccharide vaccine. Only children older than 2 years or with certain conditions get the PPSV23 vaccine. And adults who've had the PCV13 or PCV15 vaccines get it, too.

Influenza, RSV, and COVID commonly cause viral pneumonia.Most people improve after a few days. Depending on your health, it can take a month or more to feel better. To prevent viral pneumonia, avoid smoking, get vaccinated, and if you're at risk, talk to your doctor about pneumococcal vaccination.

Is pneumonia viral or bacterial?

Pneumonia can be caused by a virus or bacteria. But the most common type of pneumonia is caused by bacteria.

How to tell if pneumonia is viral or bacterial

Viral pneumonia is often milder than pneumonia caused by bacteria. With bacterial pneumonia, you may need to stay in the hospital to get better. With viral pneumonia, you'll likely get flu-like symptoms. And you may start to feel better on your own.

Is walking pneumonia viral?​

Walking pneumonia is a mild form of pneumonia. Walking pneumonia can be caused by a virus or bacteria. Most people recover from walking pneumonia after a month.

What does a pneumonia cough sound like?

Your cough may sound like a rumble, crackle, or hacking sound. With viral pneumonia, your cough can be dry.