A coil gun is an electromagnetic gun for accelerating a 'bucket' to high speeds, 2.5 km/s or more.
The coil gun consists of a sequence of electromagnetic coils arranged in a line. Each coil has a capacitor that stores the energy necessary for firing that coil as well as a firing circuit. The coils are a few cm's or so in diameter, and are lined up on a common axis. The overall length of the coil gun is about a few tens of meters long.
To fire, a ferromagnetic projectile is placed at one end of the gun and the capacitor(s) are discharged through their coils in sequence. The object leaves the other end going very fast.
Coil guns can be used on the earth to reach escape velocity but are limited in application by the cost of the switching hardware to relatively low masses,
The main projected uses for the guns are for launching objects (people wouldn't survive the acceleration for any reasonable length of gun) from the moon; and for use in space as a way of using just about any object as reaction mass.
Rail guns are a competing technology, however rail guns have issues with rail erosion which limit their life, whereas coil guns are totally contactless and almost infinitely reusable.