The effectiveness of a humidifier depends on the dimensions of a room compared to the the humidifier's capacity. If you have a humidifier that is appropriate for the room it is in, keeping the door closed is recommended.
Buy the right capacity.
There are whole-house humidifiers and single-room humidifiers. Single-room humidifiers are varied in their capacity, and this is done purposely — if you buy too large of a humidifier for your room, you can end up with a soaking wet room. If it is too small, you will never achieve your goal of humidifying the room.
Choosing the size for a new humidifier
First, determine the square footage of your room. If it is a standard bedroom of 12-by-2 size, you have 144 square feet to humidify. If you are buying a new appliance, look for one that says it will be most effective in that range. If your room is especially large or has very high ceilings, you may need a larger unit than is standard.
Opening doors while in use.
Do not open the door of a room where the humidifier is the appropriate size for the room; if you do so, the humidity will escape the room. If the humidifier is too powerful for the room, you can open a door to let some of the humidity escape. Many higher-end models have automatically adjusting humidity levels, so keep the door closed to ensure that the space does not exceed the humidifier's designed capacity.