As a lattice Boltzmann method, He-Chen-Zhang model is widely used in two-phase simulations. However, the pressure boundary conditions applied in He-Chen-Zhang model have hardly been discussed in detail before. In this article, a pressure boundary condition for single-phase flows is extended to He-Chen-Zhang model for simulating two-phase flows in porous media or in channel. Several cases are conducted for validation. Qualitatively, the displacement of two-phase flows in porous media or in channel is reproduced; the manipulations of droplet in T-junction, duct, or needle are simulated. These numerical results match well with the basic physical reality. Quantitatively, we tested the displacement of two-phase fluids in a channel under specified pressure gradient, and it is found that the velocity profile on the crosssection coincides with the analytical solution exactly. Moreover, for stable displacement of two-phase flows in a channel, the numerical linear relation between the apparent contact angle and the velocity of contact line coincides well with the theoretical result reported before. The present pressure boundary condition proves to be a reliable method to deal with the problems of two-phase flows, which are driven by pressure difference. K E Y W O R D S displacement, droplet, lattice Boltzmann, pressure boundary conditions, two-phase flows 1 Int J Numer Meth Fluids. 2020;92:669-686. wileyonlinelibrary.com/journal/fld