We report here the epitaxial growth of InGaN/GaN quantum wells on freestanding GaN gratings by molecular beam epitaxy (MBE). Various GaN gratings are defined by electron beam lithography and realized on GaN-on-silicon substrate by fast atom beam etching. Silicon substrate beneath GaN grating region is removed from the backside to form freestanding GaN gratings, and the patterned growth is subsequently performed on the prepared GaN template by MBE. The selective growth takes place with the assistance of nanoscale GaN gratings and depends on the grating period P and the grating width W. Importantly, coalescences between two side facets are realized to generate epitaxial gratings with triangular section. Thin epitaxial gratings produce the promising photoluminescence performance. This work provides a feasible way for further GaN-based integrated optics devices by a combination of GaN micromachining and epitaxial growth on a GaN-on-silicon substrate.