It's supposed to be temporary. The UCMJ only has jurisdiction over active duty military personnel, or reservists on active duty. They do have to obey the various regulations, however, and if they do not they could be subject to prosecution, but in federal court, not a military court. Some military installations in United States territory, most in fact, are under the concurrent jurisdiction of the state where the post is located, and the federal government. A civilian committing a crime on such a place would most likely be prosecuted in the state court.
Some posts are under the exclusive jurisdiction of the United States.
Interestingly, there are relatively few federal criminal offenses concerning day to day crimes - assault, for example. This insures that conduct prohibited in the local state is also prohibited on the military base in that state. Overseas, outside combat areas, both the active duty military and civilians accompanying the military can be subject to foreign courts. Everyone is subject to the foreign laws, of course, and is expected to obey local laws. Status of Forces Agreements are treaties between the United States and the host country regarding procedures and rights if a military member or civilian is accused of a crime that also breaks the law of the host country.