Ainaži is a harbour town in Latvia located near the Estonian border at the site of a former Livonian fishing village. Before 1917, it was known by its German name Haynasch (in Russian, Gainash).
Ainaži has a long history of shipbuilding and seafaring; the first Latvian nautical school was established there in 1864 on the initiative of Krisjanis Valdemars. In 1905 a commercial harbour was built, but today Ainaži is not a center of maritime activity, since this industry was severely damaged in war time.
Currently, the most important industries are forestry, woodworking and trade. In addition, its location at the Latvia-Estonia border on the Via Baltica international highway favours transit/transport industries.
Today the building of the nautical school hosts a museum, the Ainažu Jūrskolas Muzejs, dedicated to the history of the school and the tradition of shipbuilding along the Vidzeme coast.