The basic meaning of 勝手に is "of one's own accord", ie. doing something on one's own judgement without consulting anyone else.
When used of a person, it usually (but not necessarily always) has negative connotations, implying that the person isn't being very considerate and they should really have consulted someone before doing the thing. This negative connotation is particularly explicit in the adjectival equivalent 勝手な(人), which refers to the kind of person who only thinks of themself.
勝手に can also be used with non-human subjects (機械が勝手に動き出した "the machine started moving on its own", 問題が勝手に解決した "the problem resolved itself") in which case there is of course no value judgement involved.
I have trouble thinking of many situations where it would be natural to translate 勝手に as "voluntarily", but it's not out of the question, since they do both indicate that a person is doing something of their own will rather than due to anyone else's influence.