The term Jōkamachi (城下町?, "castle town") refers to a type of urban structures in Japan in which the city surrounds a feudal lord’s castle. These cities did not necessarily form around castles after the Edo period; some are known as Jinyamachi, cities that have evolved around Jinya or government offices that are not intended to provide military services. Defined broadly, Jokamachi includes Jinyamachi. It is also referred to as Joka as was common before the early modern period.
The advent of Jokamachi dates back to the Sengoku period (period of warring states). Jokamachi functions both as a military base represented by the castle and an administrative and commercial city. Oda Nobunaga was the biggest contributor to the development of early-modern Jokamachi. He aimed at promoting Heinobunri (distinguishing the samurai class from the rest by giving privileged status to samurai and disarming farmers and the rest) by forcing the samurai class to live in Jokamachi, while establishing Rakuichi-rakuza (free markets and open guilds) to stimulate merchandising and trade. Jokamachi flourished even more under Toyotomi Hideyoshi’s regime whose political and commercial epicenter Osaka-joka became very prosperous as the center of commodities. Osaka continued to be the business center in the Edo period and was called the “kitchen of the land.”
Most of the world’s walled cities comprise a castle and a city inside the defensive walls. While Japan did have towns and villages surrounded by moats and earth mounds such as Sakai and Jinaicho, Jokamachi initially had moats and walls only around the feudal lord’s castle and did not build walls around the entire city. However, as Jokamachi developed and increased its economic and political value, it demanded protection from wars and turmoil. More and more cities were built with moats and defensive walls, the style of which is known as Sogamae, and gradually came to resemble walled cities.