Don't place a rooting or established pineapple houseplant in direct sunlight because the harsh light will burn the plant. Once the plant is established, you can repot it into a larger pot ...
Melons and pineapples have a long history of being grown in pots successfully under glass in the UK. Because they need a long, hot growing season to ripen properly, growing them in the greenhouse ...
but if growing in cooler climates, use a terracotta pot as this will help avoid cold, damp soil, which pineapples hate. When planting in the ground, create a ridge or raised bed for good drainage.