Stem cells are found in specialized microenvironments, or "niches", which regulate stem cell identity and behavior. The adult testis and ovary in Drosophila contain germline stem cells (GSCs) with well-defined niches, and are excellent models for studying niche development. Here, we investigate the formation of the testis GSC niche, or "hub", during the late stages of embryogenesis. By morphological and molecular criteria, we identify and follow the development of an embryonic hub that forms from a subset of anterior somatic gonadal precursors (SGPs) in the male gonad. Embryonic hub cells form a discrete cluster apart from other SGPs, express several molecular markers in common with the adult hub and organize anterior-most germ cells in a rosette pattern characteristic of GSCs in the adult. The sex determination genes transformer and doublesex ensure that hub formation occurs only in males. Interestingly, hub formation occurs in both XX and XY gonads mutant for doublesex, indicating that doublesex is required to repress hub formation in females. This work establishes the Drosophila male GSC niche as a model for understanding the mechanisms controlling niche formation and initial stem cell recruitment, as well as the development of sexual dimorphism in the gonad.