Plays a role in the maturation of phagosomes that engulf pathogens, such as S.aureus and Mycobacterium (By similarity). May be involved in melanosomal transport and docking. Involved in the proper sorting of TYRP1. Involved in peripheral melanosomal distribution of TYRP1 in melanocytes; the function, which probably is implicating vesicle-trafficking, includes cooperation with ANKRD27 and VAMP7 (PubMed:21187289). Plays an important role in the control of melanin production and melanosome biogenesis (By similarity). In concert with RAB32, regulates the proper trafficking of melanogenic enzymes TYR, TYRP1 and DCT/TYRP2 to melanosomes in melanocytes (PubMed:26620560). Regulated by a guanine nucleotide-exchange factor (GEF) and a GTPase-activating protein (GAP) and alternates between an inactive GDP-bound and an active GTP-bound form. The BLOC-3 complex composed of HPS1 and HPS4 acts as its GEF, promotes the exchange of GDP to GTP, converting it from an inactive GDP-bound form into an active GTP-bound form. SGSM2 acts as its GAP and inactivates it by stimulating its GTPase activity (PubMed:26620560). Interacts with ANKRD27 (By similarity). Recruited to phagosomes containing S.aureus or M.tuberculosis. The BLOC-3 complex, a heterodimer of HPS1 and HPS4 promotes its membrane localization. Defects in Rab38 are the cause of a form of oculocutaneous albinism known as the chocolate (cht) phenotype. Mice exhibit a brown coat similar in color to mice with a mutation in tyrosinase-related protein 1 (TYRP1). The targeting of TYRP1 protein to the melanosome is impaired in Rab38(cht)/Rab38(cht) melanocytes. Belongs to the small GTPase superfamily. Rab family.