We develop nilpotently $p$-localization of knot groups in terms of the (symplectic) automorphism groups of free nilpotent groups. We show that any map from the set of conjugacy classes of the outer automorphism groups yields a knot invariant. We also investigate the automorphism groups and compute the resulting knot invariants.