Reliability-based design optimization (RBDO) faces severe challenges due to its nested double-loop structure and high computational cost associated with reliability analysis. For this purpose, this article proposes a deep generative modeling framework for the RBDO problem using conditional normalizing flow (cNF). The proposed framework consists of a training phase and an optimization phase. In the training phase, a cNF is constructed and trained to learn an invertible mapping between the response distribution of the performance function and a standard Gaussian base distribution, conditioned on the design parameters. The flow model is built by composing multiple transformation layers, including affine coupling layers and neural spline layers. In the optimization phase, once the flow model has been trained, the response distributions at any given design point can be efficiently evaluated using the change-of-variable formula, enabling direct and exact computation of the associated failure probabilities without additional performance function evaluations. As a result, the original RBDO problem is reformulated as a deterministic optimization problem, in which the probabilistic constraints are evaluated through the trained flow model. Consequently, standard deterministic optimization algorithms can be readily employed to search for the optimal design point. Four numerical examples are presented to demonstrate the effectiveness of the proposed method.