We have a "pig lot" (with a small hut) we use till they get a little size on them, then they are put on pasture with the sheep. But even then we bring them back to the lot at feed time.
But you can raise a pig without pasture... We used a pig house for years. (12 X 12 pole shed with floor, roof and half sides.)