Not a licensed pro, but do have EE and have done much of my own work and passed all inspections.
When installing a 30 amp sub panel to a second story does the line ( 10/3 ) need to be ran within conduit?
Not necessairly... 10/3 with Gnd NM could be used if not precluded for use in your situation (wet, subject to damage, etc.) You DO NEED 4 conductor cable; 2 hot, 1 neutral and ground. Bonding screw or link must me removed from sub panel so the neutral and ground are separate.
can this sub panel be installed within a closet?
NO!
There are also clearance requirements around panels to permit access. Check applicable code for your location, but, absolutely NOT IN CLOSET.
Sounds like a small sub panel so you probably will not exceed the 6 breaker limit beyond which you must include a main disconnect in the sub panel.