Context. High resolution magnetic field measurements are routinely done only in the solar photosphere. Higher layers like the chromosphere and corona can be modeled by extrapolating the photospheric magnetic field upward. In the solar corona, plasma forces can be neglected and the Lorentz force vanishes. This is not the case in the upper photosphere and chromosphere where magnetic and non-magnetic forces are equally important. One way to deal with this problem is to compute the plasma and magnetic field self-consistently with a magnetohydrostatic (MHS) model. Aims. We aim to derive the magnetic field, plasma pressure and density of AR11768 by applying the newly developed extrapolation technique to the SUNRISE/IMaX data. Methods. An optimization method is used for the MHS modeling. The initial conditions consist of a nonlinear force-free field (NLFFF) and a gravity-stratified atmosphere. Results. In the non-force-free layer, which is spatially resolved by the new code, Lorentz forces are effectively balanced by the gas pressure gradient force and the gravity force. The pressure and density are depleted in strong field regions, which is consistent with observations. Denser plasma, however, is also observed at some parts of the active region edges. In the chromosphere, the fibril-like plasma structures trace the magnetic field nicely. Bright points in SUNRISE/SuFI 3000 {$AA$} images are often accompanied by the plasma pressure and electric current concentrations. In addition, the average of angle between MHS field lines and the selected chromospheric fibrils is $11.8^circ$, which is smaller than those computed from the NLFFF model ($15.7^circ$) and linear MHS model ($20.9^circ$). This indicates that the MHS solution provides a better representation of the magnetic field in the chromosphere.