The ghosts keep on closing it because they hear it squeak.
If the door didn't squeak, the ghosts wouldn't close it.
How can you silence a squeaky door?
You need to oil the hinges.
You have access to something oily.
Why don't you use some grease?
There is grease below the hatch in the animal storage room.
How can I unlock the hatch?
How can I get past the rat?
Pick up some of the cooking grease.
Use the glob of grease with the squeaky door.
You can now open it without alerting the ghosts.