Take neck and giblets out of the turkey. Remove any excess fat and leftover pinfeathers. Wash the turkey inside out. Pat dry with paper towels.
Preheat oven to 375°F (190°C). Combine all dry rub ingredients in a small bowl.
Place turkey breast side up on a roasting rack inside a deep pan. Rub olive oil all over the turkey.
Stuff onion in the neck cavity and fold the neck skin flap over the onion. Stuff sprigs of thyme into the body cavity and sprinkle with some dry rub.
Pat the rest of the dry rub all over the body of the turkey.
Tug the wings under the body. Tie the legs together if turkey does not come with the plastic ties for cooking.
Transfer turkey to the preheated 375˚F (190˚C) oven and roast for 30 minutes.
Reduce heat to 325˚F (165˚C) and continue to roast for another 2 to 2½ hours.
According to the FDA, the turkey is safe when a food thermometer inserted into the innermost part of the thigh and wing and the thickest part of the breast reaches a temperature of 165°F (74°C).
Remove from oven and allow turkey to rest for 20 minutes before carving.