We study the viscous boundary layer that forms at small viscosity near a rigid wall for the solution to the Navier–Stokes equations linearized around a smooth and stationary Euler flow (LNSE for short) in a smooth bounded domain $$\Omega \subset \mathbb {R}^3$$ under no-slip boundary conditions. LNSE is supplemented with smooth initial data and smooth external forcing, assumed ill-prepared, that is, not compatible with the no-slip boundary condition. We construct an approximate solution to LNSE on the time interval [0, T], $$0<T<\infty $$ , obtained via an asymptotic expansion in the viscosity parameter, such that the difference between the linearized Navier–Stokes solution and the proposed expansion vanishes as the viscosity tends to zero in $$L^2(\Omega )$$ uniformly in time, and remains bounded independently of viscosity in the space $$L^2([0,T];H^1(\Omega ))$$ . We make this construction both for a 3D channel domain and a smooth domain with a curved boundary. The zero-viscosity limit for LNSE, that is, the convergence of the LNSE solution to the solution of the linearized Euler equations around the same profile when viscosity vanishes, then naturally follows from the validity of this asymptotic expansion. This article generalizes and improves earlier works, such as Temam and Wang (Indiana Univ Math J 45(3):863–916, 1996), Xin and Yanagisawa (Commun Pure Appl Math 52(4):479–541, 1999), and Gie (Commun Math Sci 12(2):383–400, 2014).