This is my door stop design that takes 6mm magnets. You will need 4 of them, 2 in the ball and 2 in the cup. This gives them a stronger grip with the smaller magnets.
The threaded plates can be glued or screwed to the door and wall, then screw in the ball and cup. Oh make sure they line up first ;)