Ubud is about 15 km from the ocean.
If you're driving to a town near the beach or coastline, you could try Nusa Lembongan.
How far is Newport, OR from the ocean
How far is Nashville from the ocean
How far is Kingman from the ocean
How far is Redding from the ocean
How far is Scottsdale from the ocean
How far is Honolulu from the ocean
How far is Boca Raton from the ocean
How far is West Palm Beach from the ocean
How far is Morro Bay from the ocean
How far is Trogir from the ocean