We have constructed a model of a zeolite which we have optimized using density-functional theory (DFT) in local-density approximation. We have calculated the energy of the zeolite model with and without one potassium atom. From these calculations the adsorption energy of the K atom is found to be -1.057 eV. We find that the bonds in the zeolite ring show an expansion upon addition of a K atom. We have also calculated the spin-dependent bond energy for two K atoms in a zeolite, from which we predict that ferromagnetic order occurs.