Due to the detrimental effects of cocaine on the human body such as organ damage, paranoia, immunodeficiency, cardiovascular disease, blood pressure, and stress, it is highly required to develop sensing approaches for its rapid and facile determination. Based on the signal enhancement capability of the UiO-66/AuNPs nanocomposite and acting as a capture agent, we designed a cost-effective fluorescent aptasensor for cocaine detection. The cocaine presence in the sample would cause a considerable escalation in the quenching of the fluorescence signal. The aptasensor achieved the linear response range over 0.5 μM–20 μM with a low detection limit of 0.178 μM. The selectivity of the designed aptasensing assay was successfully confirmed by examining several analgesic drugs. The aptasensor was employed for cocaine determination in human serum as the real samples. This method has a substantial benefit the for development of a low-cost and facile tool in medicine and forensic science.