The Thomas-Fermi approach to galaxy structure determines selfconsistently and non-linearly the gravitational potential of the fermionic warm dark matter ( WDM ) particles given their quantum distribution function f ( E ) . This semiclassical framework accounts for the quantum nature and high number of DM particles , properly describing gravitational bounded and quantum macroscopic systems as neutron stars , white dwarfs and WDM galaxies . We express the main galaxy magnitudes as the halo radius r _ { h } , mass M _ { h } , velocity dispersion and phase space density in terms of the surface density which is important to confront to observations . From these expressions we derive the general equation of state for galaxies , i. e. , the relation between pressure and density , and provide its analytic expression . Two regimes clearly show up : ( i ) Large diluted galaxies for M _ { h } \gtrsim 2.3 10 ^ { 6 } M _ { \odot } and effective temperatures T _ { 0 } > 0.017 K described by the classical selfgravitating WDM Boltzman gas with an inhomogeneous perfect gas equation of state , and ( ii ) Compact dwarf galaxies for 1.6 10 ^ { 6 } M _ { \odot } \gtrsim M _ { h } \gtrsim M _ { h,min } \simeq 3.10 10 ^ { 4 } \left% ( 2 { keV } / m \right ) ^ { \frac { 16 } { 5 } } M _ { \odot } , T _ { 0 } < 0.011 K described by the quantum fermionic WDM regime with a steeper equation of state close to the degenerate state . In particular , the T _ { 0 } = 0 degenerate or extreme quantum limit yields the most compact and smallest galaxy . All magnitudes in the diluted regime turn to exhibit square root of M _ { h } scaling laws and are universal functions of r / r _ { h } reflecting the WDM perfect gas behaviour in this regime . These theoretical results contrasted to robust and independent sets of galaxy data remarkably reproduce the observations . For the small galaxies , 10 ^ { 6 } \gtrsim M _ { h } \geq M _ { h,min } , the equation of state is galaxy mass dependent and the density and velocity profiles are not anymore universal , accounting to the quantum physics of the self-gravitating WDM fermions in the compact regime ( near , but not at , the degenerate state ) . It would be extremely interesting to dispose of dwarf galaxy observations which could check these quantum effects .