install a door on stairs
The Code requires a landing at the top and bottom of all stairways, except a landing is not required at the top of a stairway provided the door does not swing out over the stairs. (See ICC R311.5.4)
If you need to install a door at the bottom of the stairs, maybe you could turn the door 90 degrees and install it in the hallway.
If you try to install it at the bottom of the stairs, the doorknob will be difficult to reach when you descend the stairs.