It's not an obligation in the sense that it's not strictly mandatory.
But it is beyond encouraged. Any faithful Muslim believe that marriage is half of faith.
“When a person gets married he has completed half of his religion, so let him fear Allah with regard to the other half.”
https://islamqa.info/en/answers/11586/is-marriage-half-of-re...