In this paper we describe a method for setting up an atomistic simulation of a membrane protein in a hydrated lipid bilayer and report the effect of differing electrostatic parameters on the drift in the protein structure during the subsequent simulation. The method aims to generate a suitable cavity in the interior of a lipid bilayer, using the solvent-accessible surface of the protein as a template, during the course of a short steered molecular dynamics simulation of a solvated lipid membrane. This is achieved by a two-stage process: firstly, lipid molecules whose headgroups are inside a cylindrical volume equivalent to that defined by the protein surface are removed; then the protein-lipid interface is optimized by applying repulsive forces perpendicular to the protein surface, and of gradually increased magnitude, to the remaining lipid atoms inside the volume occupied by the protein surface until it is emptied. The protein itself may then be inserted. Using the bacterial membrane proteins KcsA and FhuA as test cases, we show how the method achieves the formation of a suitable cavity in the interior of a dimyristoylphosphatidylcholine lipid bilayer without perturbing the configuration of the non-interfacial regions of the previously equilibrated lipid bilayer, even in cases of membrane proteins with irregular geometrical shapes. In addition, we compare subsequent simulations in which the long-range electrostatic interactions are treated via either a cut-off or a particle-mesh Ewald method. The results show that the drift from the initial structure is less in the latter case, especially for KcsA and for the non-core secondary structural elements (i.e. surface loops) of both proteins.