Melt butter in a large heavy pot over medium-high heat. Add bacon and cook, stirring often, until fat has started to render, about 5 minutes.
Toss onion and apples in the fat and cook, stirring occasionally, until onions begin to soften, about 3 minutes. Stir in sauerkraut.
Add beer and season with pepper and caraway seeds. Bring mixture to a boil, then cover the pot. Reduce heat so mixture is just simmering and cook for 45 minutes. Or transfer the covered pot to a 350-degree oven and bake for 1 hour. Stir and serve hot.