Heat a skillet on medium-high heat and add the butter and onions. Cook for 2-3 minutes until the onions become soft and fragrant. Remove from the skillet and set aside.
Add the ground beef to a large bowl with all of the ingredients including the cooked onions. (excluding the glaze ingredients).
Beak down the meat and combine the ingredients. You can also use your hands. Ensure the meat is coated in all of the seasonings and ingredients, but don't overwork the meat. If you overwork the meat the meatloaf is more likely to fall apart after air frying.
Line a 9x5 loaf pan with parchment paper. Add the meat mixture to the pan. Shape the meat in the pan, pay close attention to the edges, and smooth with a silicone spatula or spoon. A 9x5 pan won't fit in my 5.8 quart air fryer, but it will fit in my air fryer oven. If using an air fryer, use the loaf pan to mold the meatloaf, and then remove it from the pan by pulling up on the parchment paper and place it on the air fryer basket.
Air fry for 35 minutes on 370 degrees.
While the meatloaf bakes in the air fryer, combine all of the ingredients for the glaze in a medium bowl. Stir well to combine.
After 35 minutes, remove the meatloaf from the oven. You can choose to drain any excess fat. I didn't drain any because the parchment paper works well at soaking it up. Spread the glaze over the top. The mixture will create a thick layer on top.
Return the meatloaf to the air fryer and cook for an additional 10-15 minutes (timing will vary based on temperature). Use a meat thermometer to test the inside of the loaf and ensure it has reached an internal temperature of at least 160 degrees. Examine the edges of the meatloaf to ensure the edges are fully cooked.
Allow the meatloaf to cool and rest for at least 10 minutes before removing it from the pan. I allow mine to rest for about 20 minutes. The meat will need to rest before you slice into it.
Use a serrated bread knife to slice the meatloaf, this will prevent it from falling apart as you slice it.