Preheat the oven to 350°F (175°C).
Caramelize the onions: In a skillet over medium heat, melt the butter and sauté the thinly sliced onions for 20-25 minutes, stirring occasionally, until they are caramelized and golden brown. Add a splash of beef broth to deglaze the pan, stirring until the liquid is absorbed. Set the onions aside to cool.
Prepare the meatloaf mixture: In a large bowl, combine the ground beef, breadcrumbs, milk, minced garlic, beaten egg, Worcestershire sauce, Dijon mustard, dried thyme, salt, and pepper. Mix until well combined.
Add onions and cheese: Fold in the caramelized onions and half of the shredded Gruyère cheese into the meat mixture.
Shape the meatloaf: Shape the mixture into a loaf and place it in a greased baking dish.
Bake: Bake in the preheated oven for 1 hour, or until the internal temperature of the meatloaf reaches 160°F (70°C).
Cheese topping: Once the meatloaf is cooked, sprinkle the remaining Gruyère cheese over the top. Bake for an additional 5-10 minutes until the cheese is melted and bubbly.
Rest and serve: Let the meatloaf rest for 10 minutes before slicing. Serve with your favorite sides, such as mashed potatoes or roasted vegetables, for a complete and satisfying meal.
