I read this one as a kid in the 1980s, though the story might date back to the 1970s.
"Enoch", a short story by Robert Bloch; first published in Weird Tales, September 1946, available at the Internet Archive; reprinted many times. Any of these covers ring a bell?
The basic premise is this: the protagonist is being forced to serve a tiny, usually invisible demon that rides on his head.
Have you ever felt the tread of little feet walking across the top of your skull? Footsteps on your skull, back and forth, back and forth?
The demon, whom I believe is named "Enoch", forces the unlucky man to commit murders
He wants me to kill people for him. Enoch. The thing that lives on the top of my head. I can't see him. I can't catch him. I can only feel him, and hear him, and obey him.
Sometimes he leaves me alone for days. Then, suddenly, I feel him there, scratching away at the roof of my brain. I hear his whisper ever so plainly, and he'll be telling me about someone who is coming through the swamp.
to provide amusement and I think nourishment for the demon.
"After all," Enoch whispered, "I can't help it. I must be served every so often. To keep me alive. To keep me strong. So I can serve you. So I can give you things. That is why you have to obey me. If not, I'll just stay right here and—"
The protagonist has become a haunted drifter as a result, always moving on before the body or bodies are discovered by the local police.
He lives in a shack by the swamp:
People laugh at me and say I have no friends; the girls in town used to call me "scarecrow" Yet sometimes—after I've done his bidding—he brings queens to share my bed.
Just dreams? I don't think so. It's the other life that's just a dream; the life in the shack at the edge of the swamp. That part doesn't seem real any more.
The protagonist talks about his unsuccessful efforts to grab Enoch or resist his demands. The demon is always way too fast for him, and claws and bites at his scalp as punishment.
You can't see who does the walking. After all, it's on top of your head. If you're clever, you wait for a chance and suddenly brush a hand through your hair. But you can't catch the walker that way. He knows. Even if you clamp both hands flat to your head, he manages to wriggle through, somehow. Or maybe he jumps.
He is terribly swift. And you can't ignore him. If you don't pay any attention to the footsteps, he tries the next step. He wriggles down the back of your neck and whispers in your ear.
You can feel his body, so tiny and cold, pressed tightly against the base of your brain. There must be something numbing in his claws, because they don't hurt—although later, you'll find little scratches on your neck that bleed and bleed. But at the time, all you know is that something tiny and cold is pressing there. Pressing, and whispering.
There is also a scene where a local confronts the protagonist, and is killed by the demon.
That would be Edwin Cassidy, the District Attorney, who visits the narrator in his jail cell after he's arrested for murder.
It's a rather grisly (though not explicitly graphic) matter where Enoch burrows into the man's head to get at his brain. In that moment, the protagonist gets a quick glimpse of what Enoch really looks like when not invisible. He describes it as a white, possibly rat-like thing, though I'm not entirely sure of the description.
I reached my hand through the bars and pulled the jail keys from Mr. Cassidy's pocket. I opened my cell door and I was free again.
There was no need for me to stay now, with Mr. Cassidy gone. And Enoch wouldn't be staying, either. I called to him.
That was as close as I've ever come to really seeing Enoch—a sort of a white streak that came flashing out of the big red hole he had eaten in the back of Mr. Cassidy's skull.
Then I felt the soft, cold, flabby weight landing on my own head once more, and I knew Enoch had come home.
The story ends (IIRC) with the protagonist burying the latest victim, and preparing to move on the next town.
He doesn't bury Mr. Cassidy, and we aren't told where they're going next:
I walked through the corridor and opened the outer door of the jail.
Enoch's tiny feet began to patter on the roof of my brain.
Together we walked out into the night. The moon was shining, everything was still, and I could hear, ever so softly, Enoch's happy chuckling in my ear.