Preheat the oven to 350 degrees F and lightly grease a loaf pan.
In a large bowl, combine the ground beef, chopped onion, BBQ sauce, breadcrumbs, egg, salt, and black pepper. Mix with your hands until the ingredients are evenly distributed.
Transfer the mixture to the prepared loaf pan and shape it into a firm loaf.
Bake for 45 minutes.
While the meatloaf bakes, stir together the brown sugar, ketchup, and apple cider vinegar in a small bowl until smooth.
Remove the meatloaf from the oven and spread the glaze evenly over the top.
Return the meatloaf to the oven and bake for another 15 minutes, or until the glaze looks set and slightly caramelized.
Let the meatloaf rest for 10 minutes before slicing.