Many people put their nestboxes up too high – really you want it 2-4m off the ground if it’s a nestbox with a hole. Something around 2m up should be fine once there’s no way for cats to get near it. The exception is for open-fronted nestboxes for Robins, Wrens and Blackbirds which should be lower than 2m but amongst dense vegetation and somewhere cats and other predators won’t easily see or access it.
If you’re attaching it to a tree, don’t drill or nail it as this will damage the tree, but instead use a wire strap wrapped around the tree.