The capillary effect acts a key role in our daily life, and its vibration can significantly affect its mass transmission. Here, we aim to study the vibration of the capillary in a nanoscale deformable tube. First, we present the mathematical model, and then we give a detailed study on its vibration characteristics by means of the Hamiltonian‐based method, which is based on the variational principle and Hamiltonian. In the view of the energy conservation, the residual equations are introduced to determine the frequency‐amplitude formulation. We finally verify the effectiveness and reliability of the proposed method by comparing with existing method through the numerical results. The finding in this work is expected to be helpful for the study of the nonlinear vibration.