This study provides an understanding of the role of job satisfaction as a mediator of compensation and workplace environments for the organizational commitment of employees in the public sector. This study used a structural model using path analysis. The population and sample in this study were all employees at the Population and Civil Registry Office of one of the districts in Indonesia. The sampling technique used was total sampling, due to the considerably smaller amount of the sample size. This study found that compensation and workplace environment could explain job satisfaction variables with a 93.8% confidence level and simultaneously compensation, workplace environment, and job satisfaction that could explain organizational commitment with a variable of 97.4%. This findings also shows that the manifest bonus variable on the latent compensation variable is one of the main indicators that needs to improve to increase job satisfaction and organizational commitment. One of the important things which needs to be done is to increase compensation. The first thing which needs to be done is to increase the bonus. Furthermore, to improve the quality of the workplace environment, facilities, and infrastructure such as stable internet connections, computer specifications are the important criteria that must be met.