Plasma by itself behaves like a gas in a container - it will do its best to fill it completely. That happens because of the collisions between the particles themselves.
Magnetic field can contain the plasma because of the ions and electrons in it which are sent to move on along the lines of the magnetic field instead of going into every direction possible. In such containers plasma is in constant movement which creates some additional obstacles.
At the moment, the most viable types of containers are toroidal containters - those which are shaped like a doghnut (with a hole in the middle).