Is it an obligation for everyone to marry? In my case, I want to live lonely and not marry but I don't Know or Islam allows a person to not marry.
The answer to your question is yes; you can perfectly remain single and be committed to your faith.
Family is central in Islam, there are many references in the Quran on how to deal with family (for example, respect for elders, mothers rights, daughters rights, etc.) and clearly even from the hadith it is understood that family is a central core of a good Islamic society.
Marriage is encouraged. You can find references to it in the Quran; and the proper ways to marry are also outlined. In our Holy Prophet's (PBUH) time there were many unspeakable ways how the people would marry between them and even how they would treat their partners this is when our Holy Prophet (PBUH) declared for the those who believe the rights of partners and the method and specifics of marriage.
However, you should not marry unless you have a partner of your choosing, who you believe can be a faithful partner for you. In Islam, forced marriages are strictly forbidden and no one can be married against their will; so there is that protection for you as well.
An additional reason why marriage is encouraged is because it protects people from sin. As is it natural for a person to have desires for intimacy, marriage provides you a way to fulfill these desires in a way that protects both you and your partner.
I hope this clarifies the matter to you; and may Allah guide us all on the right path and make easy our challenges and keep us from that which is not in our best interests.
You are not obligated to be marry if you have your reasonable reasons BUT you have to be sure of some things.
You can stay away from haram, acts and thoughts. What i mean if this will affect you once and make you fall in haram then you have to get married.
Also you have to know that a married man is better within ALLAH and there are many hadith about married acts vs single.
الامام الصادق(ع): ركعتان يصليهما المتزوج أفضل من سبعين ركعة يصليها أعزب
Two kneels(Rkaatan) prayed by married better than seventy kneels(rak'ahs) prayed by single
Another thing you have to keep in your mind the Prophet Mohammad(sawws) say:
النكاح سنتي ومن رغب عن سنتي فليس مني
Marriage is my Sunnah and who refuse my sunnah then he is not on my way.
So you can't say I don't want to get married at all.
Yes, the general ruling from Quran is that it's obligatory to get married.
But the Quran also exempts men from those who cannot afford it.
Yet, Allah also tells us that there's richness in marriage and to seek it. In Surah an-Noor 24:32 =
And marry the unmarried among you and the righteous among your male slaves and female slaves. If they should be poor, Allah will enrich them from His bounty, and Allah is all-Encompassing and Knowing.
Marriage with a true believing person has many benefits. So you should try to find someone you are interested in and get along with inshaAllah. wa Allaho Alim
i agree with @Sayyid and upvoted his answer.
but i just post for an addition...
copy from https://islam.stackexchange.com/a/23326/6575 (almost duplicate answer there, but maybe that caused me to answer ) : israf is prohibited; not marrying can be an israf because some genetical and psychological development was with you and people used some their time on your development and you used earth and sun etc resources on your development; if you marry you do not lose that development, you give your knowledge to your children and wife and maybe relatives of wife and genes to your children.