Ancient maps and documents do not report on any human activities in the area of the present-day Djibouti. 

However, the port of Tadjoura had been active for many centuries, mainly in the slave trade between between Africa and Arabia, and it served as a point of departure for caravanes to the hinterland. This became known in the West only after 1855.

We are informed about the city of Zeila, 40 km east of the actual Djiboutian border. Back in the 14th century, Ibn Battuta was writing about this port:
The trip by sea from the city of Aden to the city of Zeila took four days. The landscape is barren all the way down to Maqdashaw (Mogadishu). It takes two months to travel between these two cities. The people of Zaila have black skin and they are known for their fat camels and sheeps. Zeila is a large city with an important marketplace however it is the most dirty, unpleasant and malodorous place in the world. It is malodorous mainly because camels are slaughtered in the streets and the blood is left to flow all around. Fish is also left to rot in the open. When we arrived there, we chose to spend the night on the boat and in the wind rather than inside that smelly town.

Portuguese sea charts became more accurate after Vasco de Gama was sent by the Portuguese king to discover the African continent in 1497 and those maps showed the coastline of the Gulf of Tadjoura with much details.

By 1840, the British and the French had already etablished bases or were looking for emplacements to establish them on the sea route to China and its reputedly rich markets in Hunan province. The opium war of 1857 gave both nations the opportunity to establish colonies in those far-flung lands at a time when their colonial empires were expanding at an accelerated pace.

Richard Burton (1821-90) had become famous after 1853 when, disguised as a pilgrim, he visited the holy cities of Mecca and Medina. In 1854 he endeavoured to carry out within a five-year period the Royal Geographical Society project to assess the resources of the Somali country.Here is how he reported his activities:
On the 29th of October, 1854, I left Aden in a Somali boat bound to Zayla, a small port on the African coast of the Red Sea, nearly opposite and about 140 miles from our Arabian settlement. After two days sailing we reached our destination only to find that the mules, ordered three months before and already paid for, had not been procured.
The governor, our old friend El-Shermarkay, immediatly sent to the nearby port of Tajurrah; However I was held up for twenty-eigh days in Zayla due to the delay in obtaining the animals and a further delay caused by adverse winds.
The governor reluctantly supplied me with women (cooks), guides, servants, and camels and warned me that the road was rife with brigands, that the Eesa had recently murdered his son, that smallpox was depopulating the city of Harar, and that the emir would certainly attempt to destroy us...
I came to the conclusion that the good Shermarkay was truly the quintessential Oriental hyperbolist.

Street in Zeila late 19th century, 

observe that the person on the right side wears an uniform with a colonial hat.