If your Espresso tastes salty most of the time, it’s simply under extraction. Under extraction occurs when your beans have been ground too coarse, and the water is pulled through too quickly.
Try grinding your coffee beans finer, which will slow the water flow in the extraction process; you will need to experiment here with different grinds until you hit that sweet spot.
Still Salty?
Check your water temperature.
Your water temperature should be between 90-95 degrees Celsius; if the heat is too low, it can cause salty Espresso.
Clean your equipment
Dirty equipment could be the culprit if you have the extraction and temperature down.
Change your bean
Some beans are difficult to extract correctly and can be prone to that unsatisfying salty taste, mainly Indonesian beans, so if all else fails, try a different coffee bean.