Depression is influenced by the structure, diversity, and composition of the gut microbiome. Although depression has been described previously in human immunodeficiency virus (HIV) and hepatitis C virus (HCV) monoinfections, and to a lesser extent in HIV-HCV coinfection, research on the interplay between depression and the gut microbiome in these disease states is limited. Here, we characterized the gut microbiome using 16S rRNA amplicon sequencing of fecal samples from 373 participants who underwent a comprehensive neuropsychiatric assessment and the gut metabolome on a subset of these participants using untargeted metabolomics with liquid chromatography-mass spectrometry. We observed that the gut microbiome and metabolome were distinct between HIV-positive and -negative individuals. HCV infection had a large association with the microbiome that was not confounded by drug use. Therefore, we classified the participants by HIV and HCV infection status (HIV-monoinfected, HIV-HCV coinfected, or uninfected). The three groups significantly differed in their gut microbiome (unweighted UniFrac distances) and metabolome (Bray-Curtis distances). Coinfected individuals also had lower alpha diversity. Within each of the three groups, we evaluated lifetime major depressive disorder (MDD) and current Beck Depression Inventory-II. We found that the gut microbiome differed between depression states only in coinfected individuals. Coinfected individuals with a lifetime history of MDD were enriched in primary and secondary bile acids, as well as taxa previously identified in people with MDD. Collectively, we observe persistent signatures associated with depression only in coinfected individuals, suggesting that HCV itself, or interactions between HCV and HIV, may drive HIV-related neuropsychiatric differences.IMPORTANCE The human gut microbiome influences depression. Differences between the microbiomes of HIV-infected and uninfected individuals have been described, but it is not known whether these are due to HIV itself, or to common HIV comorbidities such as HCV coinfection. Limited research has explored the influence of the microbiome on depression within these groups. Here, we characterized the microbial community and metabolome in the stools from 373 people, noting the presence of current or lifetime depression as well as their HIV and HCV infection status. Our findings provide additional evidence that individuals with HIV have different microbiomes which are further altered by HCV coinfection. In individuals coinfected with both HIV and HCV, we identified microbes and molecules that were associated with depression. These results suggest that the interplay of HIV and HCV and the gut microbiome may contribute to the HIV-associated neuropsychiatric problems.