This paper is concerned with the \(L_1\) in time \(B^s_{q,1}\) in space maximal regularity for the Stokes equations obtained by linearization procedure of the Navier–Stokes equations describing the viscous compressible fluid motion. Our main tool of deriving this maximal regularity is based on the spectral analysis of the corresponding resolvent problem for the Stokes operators. An application of our theorem is to prove the local well-posedness of the Navier–Stokes equations with non-slip boundary conditions in uniform \(C^3\) domains, whose boundary is compact. This is an extension of results due to Danchin and Tolksdorf (Math Ann 387:1903–1959, 2023), where the boundedness of the domain is assumed. In this paper, we assume that the boundary of the domain is compact, namely not only bounded domains but also exterior domains are considered. Our approach of this paper is based on the spectral analysis of Lamé equations, while the method in Danchin and Tolksdorf (Math Ann 387:1903–1959, 2023) is an extension of a result due to Da Prato and Grisvard (J Math Pures Appl (9) 54(3):305–387, 1974). Our method developed in this paper has applications to extensive system of parabolic and hyperbolic–parabolic equations with non-homogeneous boundary conditions.