Hydrogels are very attractive materials due to their multifunctional properties. Many natural polymers, such as polysaccharides, are used for the preparation of hydrogels. The most important and commonly used polysaccharide is alginate because of its biodegradability, biocompatibility, and non-toxicity. Since the properties of alginate hydrogel and its application depend on numerous factors, this study aimed to optimize the gel composition to enable the growth of inoculated cyanobacterial crusts for suppressing the desertification process. The influence of alginate concentration (0.1–2.9%, m/v) and CaCl2concentration (0.4–4.6%, m/v) on the water-retaining capacity was analyzed using the response surface methodology. According to the design matrix, 13 formulations of different compositions were prepared. The water-retaining capacity was defined as the system response maximized in optimization studies. The optimal composition of hydrogel with a water-retaining capacity of about 76% was obtained using 2.7% (m/v) alginate solution and 0.9% (m/v) CaCl2solution. Fourier transform infrared spectroscopy was used for the structural characterization of the prepared hydrogels, while the water content and swelling ratio of hydrogels were determined using gravimetric methods. It was concluded that alginate and CaCl2concentrations play the most important role regarding the gelation time, homogeneity, water content, and swelling ratio of the hydrogel.