We investigate the roughening transition of an electric flux string between two static charges in a \({{\mathbb{Z}}}_{2}\) lattice gauge theory in (2+1) dimensions. This transition is compelling because of its relation to the continuum limit. However, the entanglement growth makes it harder to access it computationally. Using numerical simulations with matrix product states, we explore the static and dynamical properties of an electric string in the confined and deconfined phases. Within the roughening region, we obtain the universal Lüscher correction to the confining potential and observe the restoration of rotational symmetry. Our simulations of the out-of-equilibrium evolution of a string reveal that the growth of the entanglement entropy of the state and the string width exhibit qualitatively different behaviors in the roughening region compared to the strongly confined one. Eventually, we find that the rate of entropy growth is consistent with an effective description of the string excitations in the roughening phase as a bosonic model.