Here is my simple rail holders that I screw into the ceiling. These would also work screwed into a wall the right way around ofcourse!
I simulated the loads in Fusion 360 and these are overkill for the PETG I use. No evidence of deflection or sagging over time.
I attached the holders to hardwood beams in my garage using deck screws.