This paper presents a model and optimal controller for Unmanned Underwater Vehicles (UUVs). We present a nonlinear six degrees of freedom model of the UUV that includes hydrodynamic and hydrostatic terms. To design the controller, we simplify the model using the geometry of the UUV as well as its operating conditions such as the depth and expected travel speed. Instead of designing a controller for the state space system, we used feedback linearization technique to decouple the motions. Then, a set of controllers were designed for each motion. To incorporate the constraints on the input and the state variables, we designed a fast Model Predictive Controller (MPC) for the UUV and compared its performance with a conventional controller.