TITLE: Why do Lie algebras pop up, from a categorical point of view?
QUESTION [30 upvotes]: Groups pop up as automorphism groups in any category.
Rings pop up as endomorphism rings in any additive category.
Is there a similar way to attach a Lie algebra to an object in a category of a certain sort? Maybe even such that the attachment of a Lie algebra to a Lie group becomes a special case?
And yes, I have searched through the answers to Why study Lie algebras?.

REPLY [10 votes]: Lie algebras are equivalently groups internal to "infinitesimal geometry".
For instance when formalized in a topos for synthetic differential geometry then a Lie algebra of a Lie group is just the first-order infinitesimal neighbourhood of the unit element (e.g. Kock 09, section 6). 
More generally in geometric homotopy theory, Lie algebras, being 0-truncated L-∞ algebras are equivalently "infinitesimal ∞-group geometric ∞-stacks" also called formal moduli problems (Lurie). See the link there for pointers to the proof of the equivalence, also (Pridham 07).