In this study, a linear quadratic regulator (LQR) based position controller is designed and optimized for an inverted pendulum system. Two parameters, vertical pendulum angle and horizontal cart position, must be controlled together to move a pendulum to desired position. PID controllers are conventionally used for this purpose and two different PID controllers must be used to move the pendulum. LQR is an alternative method. Angle and position of inverted pendulum can be controlled using only one LQR. Determination of Q and R matrices is the main problem when designing an LQR and they must be minimized a defined performance index. Determination of the Q and R matrices is generally made by trial and error method but finding the optimum parameters using this method is difficult and not guaranty. An optimization algorithm can be used for this purpose and in this way; it is possible to obtain optimum controller parameters and high performance. That's why an optimization method, grey wolf optimizer, is used to tune controller parameters in this study.