Weight gain journey

I recently went to the doctors and found out I am 87 pounds. Since the age of 16 my weight has stayed within 87 - 98 pounds. I am 5’0 and now 21, and after hearing this, I do want to start taking more care of my body. My doctor told me that I should put on more weight since I could be at risk of experiencing osteoporosis. I do feel a lot of aching in my hip bones, lower back, and knees. They feel weak most of the day and I am not sure if it’s because I don’t walk around much since I am sitting all day at the computer studying/doing work or if it’s because I don’t have enough fat muscle supporting my bones. Either way, I need to start exercising more and find a way to gain more muscle strength. I do eat two or three well balanced meals a day, when I have lunch I will regularly get seconds. But what I am eating is not enough, especially since my metabolism works fast. If anyone has had a similar experience, please recommend some suggestions I should implement into my lifestyle ♥️