Yup.
A layer of compost OVER the soil isn't really an indoor technique anyway, nor is mulch (I'm not sure if you might mean mulch?).
I grow in a compost-perlite mix but it's sterilized and bagged for commercial sale and doesn't host bugs or unwanted weed seeds.
Save your home-made compost for outdoor plants, where natural predators are present to help control unwanted insects.