  We study the potential of the Quantum Chromodynamics axion in hot and/or
dense quark matter, within a Nambu-Jona-Lasinio-like model that includes the
coupling of the axion to quarks. Differently from previous studies, we
implement local electrical neutrality and $\beta-$equilibrium, which are
relevant for the description of the quark matter in the core of compact stellar
objects. Firstly we compute the effects of the chiral crossover on the axion
mass and self-coupling. We find that the low energy properties of axion are
very sensitive to the phase transition of Quantum Chromodynamics, in
particular, when the bulk quark matter is close to criticality. Then, for the
first time in the literature we compute the axion potential at finite quark
chemical potential and study the axion domain walls in bulk quark matter. We
find that the energy barrier between two adjacent vacuum states decrease in the
chirally restored phase: this results in a lower surface tension of the walls.
Finally, we comment on the possibility of production of walls in dense quark
matter.
