As others have said, it can be done on the ground.
The sway bar is a big spring with 4x connection points. When there's pressure on one of these connection points it's gonna be a real bugger to work loose or put back on.
Taking the tension out of the spring by having all 4 points inline would likely make the job a lot easier. As jacob7071 said, disconnecting the endlinks will make everything a lot easier as that's now just a pipe going through some bushings on the axle.
My rear sway bar was rusted onto the truck... tension or not, it was a bugger to get off.