As a part of the important species that form coral reef ecosystems, stony corals have become a potential source of pharmacologically active lead compounds for an increasing number of compounds with novel chemical structures and strong biological activity. In this study, the secondary metabolites and biological activities are reported for Aspergillus terreus C21-1, an epiphytic fungus acquired from Porites pukoensis collected from Xuwen Coral Reef Nature Reserve, China. This strain was cultured in potato dextrose broth (PDB) media and rice media with different salinities based on the OSMAC strategy. The mycelial morphology and high-performance thin layer chromatographic (HPTLC) fingerprints of the fermentation extracts together with bioautography were recorded. Furthermore, an untargeted metabolomics study was performed using principal component analysis (PCA), orthogonal projection to latent structure discriminant analysis (O-PLSDA), and feature-based molecular networking (FBMN) to analyze their secondary metabolite variations. The comprehensive results revealed that the metabolite expression in A. terreus C21-1 differed significantly between liquid and solid media. The metabolites produced in liquid medium were more diverse but less numerous compared to those in solid medium. Meanwhile, the mycelial morphology underwent significant changes with increasing salinity under PDB cultivation conditions, especially in PDB with 10% salinity. Untargeted metabolomics revealed significant differences between PDB with 10% salinity and other media, as well as between liquid and solid media. FBMN analysis indicated that alkaloids, which might be produced under high salt stress, contributed largely to the differences. The biological activities results showed that six groups of crude extracts exhibited acetylcholinesterase (AChE) inhibitory activities, along with 1,1-diphenyl-2-picrylhydrazyl (DPPH) free radical scavenging and antibacterial activities. The results of this study showed that the increase in salinity favored the production of unique alkaloid compounds by A. terreus C21-1.