We study the nonlinear oscillations of a forced and weakly dissipative spring–magnet system moving in the magnetic fields of two fixed coaxial, hollow induction coils. As the first coil is excited with a dc current, both a linear and a cubic magnet-position dependent force appear on the magnet–spring system. The second coil, located below the first, excited with an ac current, provides the oscillating magnetic driving force on the system. From the magnet–coil interactions, we obtain, analytically, the nonlinear motion equation of the system, found to be a forced and damped cubic Duffing oscillator moving in a quartic potential. The relative strengths of the coefficients of the motion equation can be easily set by varying the coils’ dc and ac currents. We demonstrate, theoretically and experimentally, the nonlinear behaviour of this oscillator, including its oscillation modes and nonlinear resonances, the fold-over effect, the hysteresis and amplitude jumps, and its chaotic behaviour. It is an oscillating system suitable for teaching an advanced experiment in nonlinear dynamics both at senior undergraduate and graduate levels.