It can be. Depression is a form of mental illness (more of an imbalance then illness, but along the same effects). So, it is proven that mental illness can be passed down through generations.
Depression also has to do with environment (not as much as it does with chemicals and balance) So, if you were raised in a family where one parent or a significant family member was suffering from depression, you learned at an early age to imitate these behaviors.
The most important thing in fighting depression is knowing that it can be controlled with Healthy diet, Dr.s supervision, Exercise (when you exercise and eat right your body produces more of the chemicals your body needs to feel good. Also, Sunshine is important for processing your vitamin intake. If with all of this you are still having a difficult time, Medications may be needed. Only your Dr can know if they are right for you (wow, that just sounded like a commercial - lol)
But after all this rambling, Yes, it can be hereditary.