Interfacing superconducting quantum processors, working in the GHz frequency range, with optical quantum networks and atomic qubits is a challenging task for the implementation of distributed quantum information processing as well as for quantum communication. Using spin ensembles of rare earth ions provide an excellent opportunity to bridge microwave and optical domains at the quantum level. In this letter, we demonstrate magnetic coupling of Er$^{3+}$ spins doped in Y$_{2}$SiO$_{5}$ crystal to a high-Q coplanar superconducting resonator.