In July 1880, the 28-year-old Williams was serving as chief mate aboard the Jeddah, a boat owned by the Singaporean merchant Syed Mohamed Alsagoff. The boat was captained by Joseph Clark, who set sail from Singapore on 18 July 1880. The ship stopped at Penang and took on board more than 950 Muslim pilgrims, all making their way to Arabia in order to perform the hajj in Mecca.