Question about D&D gods


I am working on my first homebrew setting using a spelljammer sort of cosmology, and I have run into some confusion. So far, my understanding is that gods in D&D only exist where they have followers. How, then, does a god create a world from nothing? If no world = no worshipers = no god to create the world?