Abstract An experimental system consisting of a spherical vessel with a horizontal pipe was established. By changing the pipe length, the effect that the ignition position has on methane explosion in an airtight spherical vessel with a pipe was studied, and the regularities of Pmax, (dP/dt)max and flame transmission were analyzed in detail. The results show that different ignition position leading to different propagation of flame and pressure wave. As the ignition position moved from the wall of vessel to the end of pipe, the Pmax in the apparatus first increased, then decreased when ignition occurs behind the center of vessel, and finally increased when ignition occurs behind the middle of pipe. The same trend was observed for (dP/dt)max. When ignited near the end of pipe, the Pmax and (dP/dt)max were large, and the explosion was the most dangerous. In addition, gas oscillation was observed during the explosion process in the pipe, and it was more serious when igniting at the wall of vessel, the center of vessel and the end of pipe. Furthermore, the influence that structure effect had on the gas explosion was determined. With ignition in spherical vessel, the longer the pipe is, the weaker the explosion intensity in vessel is, but the greater the explosion intensity in pipe is. With ignition in the pipe, the longer the pipe is, the greater the explosion intensities are in both the vessel and pipe. The influence that the ignition position has on a gas explosion was revealed, and the reason was analyzed. This research has great theoretical value and practical significance for preventing and controlling potentially disastrous accidents in complex units. The research results provide a theoretical foundation for antiknock and explosion venting in technical vessels and pipes.