Pesto Mac and Cheese
This creamy stovetop Pesto Mac and Cheese with bacon, tomatoes, basil pesto, smoked gouda, and cheddar cheese is craveable comfort food that tastes like summer in every bite. It’s rich, cheesy, and bursting with garlicky, nutty flavor. Ready in under an hour!

I always buy heirloom tomatoes, freshly baked sourdough bread, and fragrant basil to make panzanella salad and homemade tomato soup.
Then with the fresh basil leftover, I make my homemade basil pesto so I can eat this Pesto Mac and Cheese for dinner.
It’s mac and cheese for two made with bacon and smoked gouda then mixed together with herbaceous basil pesto and fresh cherry tomatoes.
It’s creamy. It’s comforting. It tastes like summer in every bite.
Although you can make pesto mac n cheese any day of the year, summer is usually when fresh herbs are in abundance at farmer’s markets.
If you can’t buy any from a farmer and you have the room for it, buy a basil plant from your local greenhouse. It ends up being cheaper (and fresher) in the long run.
But I certainly won’t tell anyone if you opt to use premade jarred pesto. Sometimes we need a little help in the kitchen.
The best part? This pesto mac and cheese recipe is ready from prep to plate in under an hour! And it’s made on the stovetop so you don’t need to heat up your oven.

What is pesto?
Pesto is an Italian sauce made of fresh basil leaves, grated cheese, garlic, nuts, and olive oil blended together in a food processor.
Although basil is the most traditional, you can change up by using another herb or by adding another main ingredient to make more unique flavors such as broccoli pesto and tomato pesto.
For my macaroni with pesto sauce, I’m focusing on traditional basil but the directions are the same for any pesto you use.
If you have leftover pesto, use it to make pesto dip and pesto burgers.

Ingredients For Pesto Mac and Cheese
Here’s what you need to make your easy pesto macaroni and cheese:
- Elbow macaroni: Elbows are the traditional shape for macaroni and cheese, although you can certainly use other shapes such as cavatappi or shells.
- Bacon: Not only does it add some salty crispiness to your pasta, you also use the bacon fat to make a roux for your cheese sauce.
- Onion: Aromatic used to build flavor in your sauce
- Flour: Thickens the sauce by making a roux
- Milk: Use whole milk for maximum creaminess. You can also use half and half or heavy cream for a richer sauce (I personally prefer milk).
- Smoked gouda: I like the extra depth of flavor you get from the smokiness. However, you can substitute it with more cheddar cheese if that’s more your style.
- Shredded cheddar cheese: It’s better to grate a block of cheese yourself as the pre-shredded contains a caking agent. However, I’ve used pre-shredded plenty of times and it still works. You just have to be extra careful not to rush it while melting.
- Basil pesto: Use homemade or jarred
- Salt: Ensures both your pasta and sauce aren’t bland
- Tomatoes: Adds a pop of freshness to balance the richness of the sauce

How To Make Pesto Macaroni and Cheese
Here’s how to make your macaroni with pesto sauce:
- Boil pasta in salted water until al dente.
- Fry bacon in large skillet then remove and crumble.
- Cook onion in the bacon fat.
- Whisk in flour and milk then bring to a boil.
- Cook sauce until thickened then stir in gouda, cheddar cheese, and pesto.
- Mix together sauce, cooked pasta, bacon, and tomatoes.
The sauce will thicken as it cools. If it gets too thick, thin it out with more milk.
Refrigerate leftovers in an airtight container for up to 4 days.
Why is my pesto macaroni and cheese grainy?
A grainy sauce is the result of melting your cheese over too high heat, causing the fat in the cheese to separate.
To prevent this, remove the skillet from the heat then stir in your cheese until melted. Do not rush it.
If your sauce does separate, you can add some warm milk (not cold) and try to smooth it back out.
More Mac and Cheese Recipes
If you enjoyed this pesto mac and cheese recipe, check out my other macaroni recipes:
- Buffalo Chicken Mac and Cheese
- Pulled Pork Mac and Cheese
- Alfredo Mac and Cheese
- French Onion Mac and Cheese
- Beer Mac and Cheese with kielbasa
- Pumpkin Mac and Cheese
Pesto Mac and Cheese
This creamy stovetop Pesto Mac and Cheese with bacon, tomatoes, basil pesto, smoked gouda, and cheddar cheese is craveable comfort food that tastes like summer in every bite. It’s rich, cheesy, and bursting with garlicky, nutty flavor.
Ingredients
- 1/2 pound (8 ounces) uncooked elbow macaroni
- 2 slices uncooked bacon
- 1/4 cup diced yellow or white onion
- 1 tablespoon all-purpose flour
- 1/4 teaspoon salt (preferably kosher)
- 1 cup whole milk, room temperature
- 1/2 cup grated smoked gouda
- 1/2 cup shredded cheddar cheese
- 1/3 cup basil pesto (homemade or store bought)
- 1 cup halved grape or cherry tomatoes
Instructions
- Bring a large pot of water to a boil. Once boiling, add a big handful of salt then add the pasta. Cook as directed on the package until al dente, about 9-11 minutes. Drain into a colander.
- While the pasta is cooking, add the bacon to a cold large skillet and turn the heat on to medium. Once the bacon starts cooking, cook on one side until crispy, about 3-4 minutes then flip and finish cooking the other side, another 2-3 minutes.
- Remove the bacon and place on a plate lined with a paper towel; pat off as much grease as you can. When cool enough to handle, crumble bacon. Leave the bacon drippings in the skillet.
- Add the onion to the skillet and cook for 5 minutes or until softened (if there isn't enough bacon grease, add 1 tablespoon butter).
- Stir in the flour to coat and cook 1 minute. Slowly whisk in the milk then add 1/4 teaspoon salt. Bring to a boil and cook until it starts to thicken, about 2-3 minutes.
It'll thicken as it cooks more and cools, so leave it a bit thinner than you would want. - Remove from the heat and whisk in the gouda, cheddar, and pesto until melted. Taste and adjust for salt. If the sauce gets too thick, add more milk to thin it out.
- Once the pasta is done mix it with the sauce, bacon, and tomatoes.
Refrigerate leftovers for up to 4 days.
Notes
- Enjoyed this recipe? Check out my Buffalo Chicken Macaroni and Cheese, Pulled Pork Mac and Cheese, and Alfredo Mac and Cheese.
- If you have leftover pesto, use it to make Pesto Dip and Pesto Burgers.
This post may contain affiliate links. As an Amazon Associate and member of other affiliate programs, I earn from qualifying purchase.
If you were to use prepared pesto how much would you use? This sounds so good!
Thanks,
Tracey O’Keefe
IIRC I believe it’s 1 cup, but it’s been awhile since I made it. Start with 1/2 cup then taste. If it needs more, you can gradually add up to 1 cup total.
If you were to use prepared pesto how much would you use? This sounds so good!
I’d use about 1/2 cup – 1 cup. Start with 1/2 cup, taste, then add more as needed.
I made your small batch basil pesto and spied at the bottom the link for Pesto Mac and Cheese. So I made that as well. Gosh the pesto lifts mac and cheese to another level! I won’t go back to plain mac and cheese. I always put breadcrumbs, dots of butter and cheese on top and bake for 15 ish minutes. Thanks for the simple and tasty recipe.
So happy you enjoyed both recipes!