Chefchaouen is about 36 km from the ocean.
If you're driving to a town near the beach or coastline, you could try Tetouan.
How far is Naples, FL from the ocean
How far is Avila Beach from the ocean
How far is Fairbanks from the ocean
How far is Solvang from the ocean
How far is Tallahassee from the ocean
How far is Saint Paul, MN from the ocean
How far is Portsmouth, NH from the ocean
How far is Jacksonville from the ocean
How far is Anaheim from the ocean
How far is Marrakech from the ocean