This paper is dedicated to the study of shape optimization problems for the first eigenvalue of the elliptic operator with drift $$L = -\Delta + V(x) \cdot \nabla $$ with Dirichlet boundary conditions, where V is a bounded vector field. In the first instance, we prove the existence of a principal eigenvalue $$\lambda _1(\Omega ,V)$$ for a bounded quasi-open set $$\Omega $$ which enjoys similar properties to the case of open sets. Then, given $$m>0$$ and $$\tau \ge 0$$, we show that the minimum of the following non-variational problem $$\begin{aligned} \min \Big \{\lambda _1(\Omega ,V) : \Omega \subset \text {quasi-open}, |\Omega |\le m, \Vert V\Vert _{L^\infty }\le \tau \Big \}. \end{aligned}$$is achieved, where the box $$D\subset {\mathbb {R}}^d$$ is a bounded open set. The existence when V is fixed, as well as when V varies among all the vector fields which are the gradient of a Lipschitz function, are also proved. The second interest and main result of this paper is the regularity of the optimal shape $$\Omega ^*$$ solving the minimization problem $$\begin{aligned} \min \Big \{\lambda _1(\Omega ,\nabla \Phi ) : \Omega \subset \text {quasi-open}, |\Omega |\le m\Big \}, \end{aligned}$$where $$\Phi $$ is a given Lipschitz function on D. We prove that the optimal set $$\Omega ^*$$ is open and that its topological boundary $$\partial \Omega ^*$$ is composed of a regular part, which is locally the graph of a $$C^{1,\alpha }$$ function, and a singular part, which is empty if $$d d^*$$, where $$d^*\in \{5,6,7\}$$ is the smallest dimension at which there exists a global solution to the one-phase free boundary problem with singularities. Moreover, if D is smooth, we prove that, for each $$x\in \partial \Omega ^{*}\cap \partial D$$, $$\partial \Omega ^*$$ is $$C^{1,1/2}$$ in a neighborhood of x.