In this work, we establish the existence of ground state solution for Hamiltonian systems of the form \(\begin{aligned} \left\{ \begin{aligned} -\Delta u + V(x)u = H_v(x,u,v), \quad x \in {\mathbb {R}}^2, \\ -\Delta v + V(x)v = H_u(x,u,v), \quad x \in {\mathbb {R}}^2, \end{aligned} \right. \end{aligned}\) where \(V \in C({\mathbb {R}}^2, (0, \infty ))\) and \(H \in C^1({\mathbb {R}}^2 \times {\mathbb {R}}^2, {\mathbb {R}})\) is allowed to have an exponential growth with respect to the Trudinger–Moser inequality. We study the case where V and H are periodic or asymptotically periodic. In the proof of the main results, we have used a reduction method involving the generalized Nehari manifold and also a linking theorem. In our approach, as we deal with general nonlinearities, it was necessary to obtain a new version of the Trudinger–Moser inequality.