The bacterial outer membrane protein OmpX from Escherichia coli has been investigated by molecular dynamics simulations when embedded in a phospholipid bilayer and as a protein-micelle aggregate. The resulting simulation trajectories were analysed in terms of structural and dynamic properties of the membrane protein. In agreement with experimental observations, highest relative stability was found for the β-barrel region that is embedded in the lipophilic phase, whereas an extracellular protruding β-sheet, which is a unique structural feature of OmpX that supposedly plays an important role in cell adhesion and invasion, shows larger structure fluctuations. Additionally, we investigated water permeation into the core of the β-barrel protein, which contains a tight salt-bridge and hydrogen-bond network, so that extensive water flux is unlikely. Differences between the bilayer and the micellar system were observed in the length of the barrel and its position inside the lipid environment, and in the protein interactions with the hydrophilic part of the lipids near the lipid/water interface. Those variations suggest that micelles and other detergent environments might not offer a wholly membrane-like milieu to promote adoption of the physiological conformational state by OmpX.