Castelldefels is generally considered safe for solo female travelers. There is a low rate of serious crime, and the locals are usually welcoming towards tourists. There is a strong police presence and the city is well lit at night. However, like in any other place, it's recommended to be cautious, especially during the night and in less crowded areas. Always keep an eye on your valuable items to avoid opportunistic pickpocketing and petty thefts at tourist hotspots.