position the portafilter firmly on the edge of the table or countertop. Or in a very Specific portafilter holder.
But they also make some impressive tampers, significantly this one of a kind calibrated tamper https://www.coffeehype.co.uk/collections/coffee-tampers/