After her final confrontation with the Babadook, Amelia locks him in the basement. As the story says, you can't get rid of Mister Babadook, so she and Sam instead are forced to allow him to take up residence in their home.
The Babadook Ending Explained: What The Monster Really Means - IMDb. The Babadook's ending serves as a metaphor for accepting and living with one's inner demons, particularly depression, rather than trying to banish them.