(CNN) Whether you're housebound for the next couple of weeks from a COVID-19 quarantine, or simply trying to survive a school or work shutdown , you'll likely be limiting or avoiding trips to the grocery store.

So you may be wondering: What are the best foods to buy when you know you're going to be stuck at home -- and is it even possible to consume a nutritious diet?

Well, here's some good news: You can make nutrition a priority, and it's something that is all the more important if your immune system may be compromised.

"Though it might look a little different than normal, it's possible to eat healthfully when stuck at home," said Alyssa Pike, a registered dietitian and manager of nutrition communications at the International Food Information Council. "Choosing shelf-stable foods like canned goods, pastas, rice and legumes and utilizing your freezer -- [where] you can store breads, meats, vegetables, fruits and more -- are great ways to ensure you have a nice variety when your trips to the grocery store are limited."

Below is a list of foods that are not only nutritious but versatile too. They can be eaten solo; combined with other ingredients to assemble mini-meals; or used as the base for several recipes.

Just remember that there's no need to buy out the stock at your local grocery store. "Right now there's no indication that food retailers will be unable to meet the demand of consumers," Pike said, and "it's also important to consider the needs of others and not overbuy."

So only purchase what you actually need -- and these items will last you awhile, which is convenient when you're unable to leave your abode.

What to buy for your pantry:

Beans and legumes

Reach for these on your next trip to the store, because they're not only long-lasting but also a great starting point for a nutrient-rich meal. "Beans and legumes are excellent shelf-stable sources of plant protein," Pike said.

Chickpeas or lentils for example, can be mixed with salads and pasta dishes, or used in soups and stews. They can also be used for making homemade hummus, according to culinary nutritionist Jackie Newgent, author of "The Clean & Simple Diabetes Cookbook" and advisor to Lunch Unpacked.

Canned fish

Canned or vacuum-packed protein sources like tuna or salmon are also highly nutritious, and offer a boost of heart-healthy omega-3 fatty acids.

Nut butters

These are a great source of protein and healthy fats, and pair well with lots of foods, from crackers and breads to apples and bananas, according to Pike. Sun butter, which is made from sunflower seeds, is appropriate for those with peanut or tree nut allergies.

Whole-wheat and bean pastas, quinoa and brown rice

These are the nutrient-rich grains to stock up on, and they can be used as a side dish or mixed with proteins and vegetables.

Steel-cut oats

You can cook oats and add savory toppings like grated cheese, sundried tomatoes or even eggs for a quick, nutrient-rich meal.

And note that while eggs do require refrigeration, they still "have a longer shelf-life than most refrigerated foods and can be very versatile as well," Pike added.

High-fiber cereal

Canned, sugar-free fruits and vegetables

Stocking up on canned vegetables, canned fruit and applesauce without added sugar is also wise. Be sure to rinse canned vegetables to get rid of extra sodium.

And don't forget canned or jarred tomato-based sauces, Newgent said: "You don't need to make your own sauce, unless you prefer it."

Dried fruit, popcorn and yes, chocolate

Dried fruits like prunes, apricots, raisins, cranberries, figs are a sweet source of iron, fiber and antioxidants. They can be combined with nuts -- including my favorite, omega-3 rich walnuts -- or almonds, cashews, pistachios, peanuts or pecans. Sunflower seeds or pumpkin seeds are also a tasty nutritious option, and can be used for DIY trail mixes.

Popcorn is also a great source of fiber , and you can sprinkle some Parmesan cheese on top to turn it into a savory snack or add dried fruit or mini chocolate chips for added sweetness.

You can even indulge in a stash of chocolate, though the healthiest kind is dark chocolate, which is rich in anti-aging flavanols.

"It is certainly okay to incorporate a few indulgent foods, like chocolates or other sweets," especially during stressful times, Pike said. "As with any eating occasion, be mindful and check in with your hunger before and after."

Water, shelf-stable milk and coffee

Remember, in addition to stocking up on foods it's important to stay hydrated.

"The general rule of thumb for emergencies is to store at least one gallon of water per person or pet per day and to have a three-day supply handy. However, if you typically drink tap water or have some sort of filter, I wouldn't worry about buying copious amounts of water," Pike said.

Milk is also a good source of calcium and immune-boosting vitamin D, but it doesn't necessarily have to be refrigerated. "Having a shelf-stable milk or plant beverage on hand isn't a bad idea if you don't want to or cannot venture out to the grocery store," Pike explained.

And caffeine counts too. "Consider whether you have enough caffeine to get you through a few weeks," Pike said. "You may need to create your own latte or brew your own pot of coffee if you don't want to or cannot venture to your favorite coffee shop."

What to buy for your freezer:

Bread, deli meat and fresh seafood

Remember, fresh foods can be frozen, which will allow you to enjoy them at a later date. "Take full advantage of your freezer, including for foods that freeze well but that you might not typically freeze, such as milk, deli meats and breads," Newgent said.

But dairy products like cheese and yogurt are another story. "Due to texture changes when you freeze yogurt or cheese, I only recommend freezing yogurt if you plan to use it in a recipe, like for a smoothie, and I only recommend freezing shredded cheese that you plan to use in cooking, such as packaged shredded mozzarella," Newgent said. Hard cheese, like Parmesan, can keep in the refrigerator for weeks though, Newgent added.

Additionally, if you already have fresh fish and meat, consider freezing it. "Animal proteins like seafood, poultry, and beef hold well in a freezer -- typically for a few months," Pike said.

Additional fruits and vegetables

Here's some uplifting news: Reearch has revealed that frozen fruits and vegetables can have just as many vitamins -- and sometimes more -- as compared to fresh.

Frozen strawberries, blueberries and peaches can be used for smoothies, while spinach, broccoli, carrots, cauliflower, asparagus and green beans can be used as a solo side dish or mixed with pasta or rice.

Packaged foods help meet the nutrition needs of many of us, including vegetarians, as well as those who have special dietary restrictions.

"For vegans and vegetarians, packaged alternatives are a good option," Pike said, including items such as frozen bean burritos, frozen veggie burgers and frozen veggie pizza.

Easy, healthy recipes to make at home

When it comes to actually putting a meal together, you can get creative with simple combinations using carbs, protein and healthy fats, according to Pike.

For example, oatmeal, nuts and peanut butter could be one nutritious combination; canned salmon, rice and olives might be another; and a smoothie consisting of yogurt, milk and frozen fruit can be another mini-meal. "The key isn't to be too specific about foods but make sure the eating occasion as a whole has all three macronutrients if possible," Pike said.

Make a sporty chili. Bring to a boil 2 (15-ounce) cans drained, no-salt-added kidney beans; 1 (14-ounce) can crushed tomatoes with chilies; 1¼ cups vegetable broth; 1 tablespoon chili powder; and ¼ teaspoon cinnamon. Then stir in three thinly sliced scallions, if desired, and simmer over medium heat for 10 minutes. Enjoy as is, stuffed into baked potatoes, or ladled on top of spaghetti as a twist on Cincinnati chili.

Create a niçoise-inspired salad. If you've got fresh baby arugula or other greens, top them with canned tuna, quartered hard-boiled eggs, sliced black olives, fresh grape tomatoes or jarred roasted red pepper, and then dress as desired, such as with Dijon vinaigrette.

Make a no-cook, cowboy or cowgirl "caviar." For an easy side, stir together canned, drained black beans; canned and drained, or thawed from frozen, sweet corn; and pico de gallo or chunky salsa.

Make the easiest stuffed grape leaves. You can still add culinary intrigue to meals with globally-inspired canned foods, such as canned stuffed grape leaves. Drain them well; sprinkle with lemon juice and cinnamon; and quickly heat in the microwave (on a microwave-safe plate) to enjoy warm.

Create an Asian-inspired side dish. Cook frozen asparagus in a little toasted sesame oil, then sprinkle with toasted sesame seeds and a pinch of sea salt for Asian flair.

Try buffalo garbanzo snackers. Like spice? Make these by tossing together 1 (15-ounce) can drained, no-salt-added garbanzo beans with 1 tablespoon extra-virgin olive oil, then add 2 teaspoon each hot pepper sauce and white wine vinegar and ¼ teaspoon sea salt. Bake for 25 minutes at 425°F. Snack on right away!

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

Make a healthy milkshake. For a healthful dessert, try a sweet cherry milkshake for two by blending together 1 cup frozen pitted dark sweet cherries; 2/3 cup plain 0% fat Greek yogurt; 1 teaspoon lemon juice; and a couple ice cubes.

Whatever you decide to stock up on, remember to keep your food expectations in check. "In the event that we are spending more time at home, remind yourself that every meal doesn't have to be the most exciting. Sometimes the basics really get the job done," Pike said.

But to keep spirits high, particularly if your kids are home from school, you can make indoor dining more of an experience by incorporating a theme to meal time, Newgent suggested. "That may include planning an indoor picnic, or creating DIY 'bars,' like a chili bar, taco or burrito bar, pasta bar, omelet bar, or stuffed baked potato bar," Newgent added.