This post contains affiliate links. As an Amazon Associate I earn from qualifying purchases.
This easy pesto mac and cheese is made with short pasta (such as macaroni, rotini or small shells) tossed in a creamy homemade cheese sauce.

Who else really enjoys fancy boxed mac and cheese?
It's not just me, is it?
While I don't eat boxed mac and cheese often, I like to have some on hand as an emergency, super-quick backup meal.
But guys, I like the fancy kind! I'm spoiled like that.
A few years ago, I bought some really tasty boxed pesto mac and cheese at Aldi. Sadly, there isn't an Aldi nearby where we live now, and I found myself missing their pasta.
So, I started making my own homemade pesto mac and cheese. It's probably no surprise that the homemade version is even more delicious than the boxed version.
This pesto mac and cheese is an easy, filling pasta dinner or side dish that's (almost!) as easy as the boxed version.
Want more pasta in your life? Try making smoked salmon alfredo, acorn squash pasta, lemon spinach pasta and pasta con le sarde.
What is Basil Pesto?
Basil pesto is traditionally made with fresh basil, oil, Parmesan cheese and pine nuts.
Homemade variations may swap out or omit some of the ingredients. For instance, I prefer to make my homemade basil pesto with cashews and no cheese.
Pesto should be easy to find in your regular grocery store.
What Kind of Pasta Should I Use?
Use whatever short pasta you have on hand.
This recipe works well with macaroni, small shells, penne or rotini. The pasta in the photos is rotini.
Can I Make This Gluten-Free?
Yes, absolutely!
I really like this mac and cheese with chickpea pasta, because the flavors in the sauce work really well with the (somewhat strongly flavored) pasta. The pasta in the photos is Banza's chickpea pasta.
How to Make Pesto Cheese Sauce
While the pasta cooks, melt butter in a heavy-bottomed pot or a large pan. Add flour and quickly stir, stir, stir until the butter absorbs the flour.

Next, stir warm milk or cream into the butter and flour mixture.
And yes, the milk really does need to be warm. If it's cold, the flour could seize up and make clumps.

Turn off the heat and add freshly grated cheese to the sauce.
Stir until it's completely melted.


Finally, add the pesto.
Stir it into the cheese sauce.

How to Make Pesto Mac and Cheese
When your pasta is al dente (cooked but slightly firm), add it to the cheese sauce.
Use tongs to toss the pasta into the sauce. You may want to add a splash of pasta water if the sauce seems too thick.


Serve this extra cheesy pasta as a main course or as a side dish. I like to serve my pasta along with a lower-carb vegetable side, such as oven-roasted broccoli or braised kale.

Pesto Mac and Cheese
Ingredients
- 8 ounces short pasta (such as macaroni, rotini, penne or small shells) Use gluten-free pasta if needed. I love Banza's chickpea rotini in this recipe.
- 1 cup milk (2% or whole) Optionally, swap all or part of the milk for heavy cream
- 2 tablespoons butter
- 1 teaspoon flour Use gluten-free all-purpose flour if needed
- ½ cup freshly shredded white cheddar (or use gouda) See "cheese tips" in recipe notes
- ½ cup freshly grated Parmesan, plus more to serve if desired
- 1 tablespoon basil pesto
Instructions
Cook the Pasta:
- Bring a large pot of salted water to a boil. Once the water reaches a rolling boil, add the pasta. Boil until al dente (about 1 minute less than the package directions call for).Reserve 1 cup of pasta water, and remove pasta from the heat.
Make the Cheese Sauce:
- Add the milk to a small pot (such as a butter warmer) and warm over low heat. Keep warm while you prepare the sauce.Add butter to a large pot or pan and melt over medium heat. Whisk in the flour until it is completely absorbed by the butter.
- Slowly begin adding the warm milk, stirring constantly. Bring the milk to a simmer, and continue simmering for about 2 minutes.Tip: The milk must be warm when added to the butter and flour mixture, otherwise the flour might clump. Also, make sure to bring the milk to an actual simmer for 2 minutes, or the cheese might not melt correctly.
- Turn off the heat and whisk in the Parmesan and cheddar. Continue whisking until the cheese melts into the sauce.Tip: The sauce must be piping hot when the cheese is added, otherwise the cheese will not melt. If you paused your cooking for any reason in between adding the cream and butter, reheat the sauce before proceeding.Add the pesto and stir until incorporated.
- Add the pasta to pesto cheese sauce and toss to incorporate. If the sauce seems dry or stringy, add another splash of the reserved pasta water. (I usually add at least one splash of pasta water, sometimes two, when cooking this meal.)Tip: If you forgot to reserve pasta water, add a splash of cream, milk or white wine to the sauce instead (not tap water).Serve right away. Top with extra Parmesan if desired.
Notes
- Pre-grated or pre-shredded cheese will not work in this recipe, because it's tossed in anti-clumping additives that will prevent the cheese from melting.
- White cheddar and gouda are two of my favorite cheeses in this recipe, but feel free to experiment with other varieties of cheese.
Amanda | The Kitcheneer
This sounds AMAZING to me right now!
[email protected]
I love that this is a 20 minute dish and delicious combination of cheeses.
champagne-tastes
Thanks! 20 minutes is always a plus!!!
Sandhya Ramakrishnan
Absolutely love adding greens in classic recipes like this. I have 2 spinach loving boys and they would absolutely love this cheesy dish. Love the idea of adding pesto as well as they add another layer of flavor. Going to try this soon!
champagne-tastes
Thanks! It makes me feel a little healthier and tastes delicious.. so it seemed like a good idea 😉
champagne-tastes
Haha thanks! Mine too actually and I still have an hour and a half to go!
Meg | Meg is Well
I know that feeling very well-if only we could train our pets to cook for us instead of tripping you up in the kitchen like my dog does. I love the idea of putting pesto in mac and cheese! Gourmet and easy-my two favorite things.
champagne-tastes
Haha if only right!?! And thanks- I just have to remind myself it'll taste better and takes almost the same amount of time.
Ruby & Cake
Sometimes the allure of easy instant foods is to great for my lazy self. What follows is immediate regret though. Im adding this into my weeknight meals this week! Looks delish x
champagne-tastes
I agree! Haha I should post a list of quick recipes on my fridge for when this happens!
Dawn @ Girl Heart Food
Such a perfect weeknight meal...plus I love how quick it comes together and three types of cheese? Yes please!!