Structural, electronic and optical properties of 2H-CuAlO2 were computed, using the plane-wave ultrasoft pseudopotential technique based on the first-principles density functional theory (DFT). The equilibrium lattice parameters, band structure, densities of states (DOS) and charge densities of 2H-CuAlO2 have been obtained. The equilibrium lattice parameters, band structure and DOS are found to be in good agreement with the available experimental and calculational values. The charge densities and the chemical bonding of 2H-CuAlO2 are analyzed, which show that bonding between Cu and O is mainly covalent due to Cu 3d and O 2p hybridization and that bonding between Al and O is mainly ionic. The complex dielectric function, refractive index and absorption coefficient of 2H-CuAlO2 have been predicted. The calculated static dielectric constant and static refractive index of 2H-CuAlO2 is 7.1 and 2.66, respectively.