The invention discloses a method for preparing an environment-friendly cleaning agent for external walls of buildings. The technical formula of the cleaning agent comprises the following components: 1-10 parts of fatty methyl ester sulfonate, 1-8 parts of fatty alcohol EO / PO polyether, 0.1-3 parts of EDTA.2Na, 1-5 parts of sodium hydroxide, 0.5-5 parts of sodium silicate SiO2:Na2O, 0.1-3 parts of monoglyceride citrate, 0.1-5 parts of sodium lauryl sulfate, 0.5-5 parts of methyl hydroxypropyl cellulose, 0.1-3 parts of coconut diethanol amide and the balance deionized water. The cleaning agent has a good cleaning effect, is excellent in compatibility and coordination of components, has natural biodegradability, is safe and environment-friendly, and can be cleaned without plenty of water when being used, so that a large amount of manpower can be reduced, and energy resources can be saved.