The story
The original saying may have been keep the wolf from the gate, which dates from at least 1470. By the 1500s the saying had become keep the wolf from the door, with the current meaning that it bears: see, for example, the 1645 quotation. There is a suggestion that the phrase may have originated from French or German phrases. Compare the French manger comme un loup (“eat like a wolf”), and the German Wolfsmagen (literally “wolf’s stomach”) means “a keen appetite”.
Etymology from Wiktionary, CC BY-SA 4.0.