In 1705 the king of Mataram ceded sovereignty over the Preanger territories, Semarang and Cheribon to the Company. In Semarang the Company encouraged the cultivation of indigo, which was used as a dyestuff. The local ruler declared his willingness to invest in indigo production, and soon delivered the first shipments. Growers continued to produce indigo, even when the price fell drastically as a result of oversupply.
In 1708 the headquarters of the VOC on the north-eastern coast of Java was relocated to Semarang from Japara. In 1748 the 'opperhoofd' or supervisor in Semarang was named governor of the north-east coast of Java.