How do you do the Lucca walls by bike?
Rent a bike near Porta Santa Maria, ride the 4.2 km Renaissance ramparts in one easy loop (about 30 minutes), and go early or near sunset to beat the crowds and the heat.

Lucca's walls are the only fully preserved Renaissance ramparts in Italy you can ride around, and doing the loop by bike is the single best first hour in the city.
Where do you rent a bike?
Rental shops cluster just inside the main gates (around Porta Santa Maria and Porta San Pietro). A standard city bike is cheap by the hour; that's all the loop needs.
Which direction and when?
Either direction works — it's a flat, shaded loop. Go early morning or the hour before sunset: cooler, quieter, and the light over the rooftops is the photo you came for.
What's worth stopping for?
The bastions open into small parks; pause at one with a view inward over the towers and rooftops. From up here you understand the whole compact city in a glance.