Formal:
* Fermez la porte: This is the most literal and formal translation, meaning "Close the door."
* Fermer la porte: This is also formal and means "To close the door."
Informal:
* Ferme la porte: This is a more casual version of "Close the door."
* Ferre la porte: This is a more colloquial way of saying "Shut the door."
Other options:
* La porte est ouverte, ferme-la! (The door is open, close it!)
* La porte est ouverte, fermez-la! (The door is open, close it!)
The best translation will depend on the specific situation and the relationship between the speaker and listener.