I just had a Navien tankless water heater installed. It works fairly quietly when in use, but there is a knocking sound from the unit or the copper pipes hours AFTER it has been used (typically in the middle of the night). It usually makes 3-4 quick knocks in rapid succession.
Most likely, that is just the sound of the pipes contracting again after expanding from the heating cycle. With an on-demand water heater, the difference in temperature in the water lines is much more drastic than with a tank-style heater with 50 or so gallons of liquid to act as a buffer.
Some of that is probably never going to go away, but to reduce the noise, you could try slightly loosening any pipe clamps near the heater that you can access. It's possible that the installer snugged them down really tight and they are binding as the pipes expand and contract.