Researchers have paid little attention to the safety of drug use among community residents (CRs). Irrational use of drugs can lead to health risks. We investigated the situation of knowledge-attitude-practices (KAP) of CRs in Shenzhen (China) for safe use of drugs, and analyzed the main factors influencing drug use. A multi-stage, random sampling method was used. We used a validated questionnaire to conduct an online questionnaire survey on the demographic characteristics and KAP of safe use of drugs of CRs in 10 administrative districts of Shenzhen City. The KAP score of safe use of drugs of CRs was analyzed. Influencing factors were identified using a single-factor chi-squared test and binary logistic regression analysis. A total of 7269 valid questionnaires were collected. The average scores of knowledge, attitude, and behavior were (9.08 ± 1.49) (possible range: 0-10), (37.82 ± 3.96) (possible range: 8-40), and (35.82 ± 4.56) (possible range: 8-40), respectively, indicating that they had a better grasp of safe use of drugs. Logistic regression analysis showed that sex, age, education level, occupation, monthly household income per capita, marital status, health status, and different sources of information were the main factors affecting the knowledge and behavior of safe use of drugs of CRs. In addition to the marital status variable, other variables also have a significant impact on attitude towards safe use of drugs of CRs. Male sex, lower education level, lower income level, average/poor self-rated health status, and single source of drug-use information were the main factors affecting safe use of drugs based on KAP theory. The government and medical workers should carry out various forms of drug-education activities for people with different needs, encourage CRs to learn safe use of drugs, and promote safe use of drugs by CRs through diverse information sources.