Bakufu refers to the government office of military rule or samurai government itself; however, there are some exceptions, such as, the Taira clan government and the Shokuho government (the government of Nobunaga ODA and Hideyoshi TOYOTOMI. "Shoku" and "ho" are the initial letters of Oda and Toyotomi). Usually, the government office was located in the residence of the seii taishogun (literally, "great general who subdues the barbarians") who was the supreme commander. It had been the Japanese military regime in medieval times and early modern times.
"Baku" means curtain or tent and "fu" means a place where treasure and documents of the royal family, etc. are kept. The meaning of the word changed to mean the government office. It originated in China during the period of Warring States; where the general who took command in place of a king was called bakufu. When the word came to Japan, it became the Chinese style name of Konoe no daisho (Major Captain of the Palace Guards), and it was also called Makushita or Ryuei. Later, it became known as another name of the seii taishogun, as Ukone no daisho (Major Captain of the Right Division of Inner Palace Guards) MINAMOTO no Yoritomo was appointed to the seii taishogun. It also meant the headquarters of the seii taishogun when he was on expedition. The place where wartime headquarters was located turned to the place where government policies were dispatched and became a substantive administrative office of the military government.
In the history of Japan, there have been Kamakura bakufu, Muromachi bakufu, and Edo bakufu. All the bakufu formally functioned as a domestic organization of shogun. Therefore, the important posts in the bakufu were occupied by shogun family's hereditary vassals. For vassals of collateral line, they was too proud to take a post of bakufu.
Like the name "han" (feudal clan), the name "bakufu" began to be used for the centralized government after the late Edo period. It was advanced by Confucian scholars who studied the period of Warring States in China with the spread of Neo-Confucianism. Therefore, the terms 'Kamakura bakufu' and 'Muromachi bakufu' were created after that time.
People in those days never called the central government office of Kamakura or Muromachi 'bakufu.'
However, they called the shogun's residence 'bakufu.'