Why do Lie algebras pop up, from a categorical point of view? 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?.
 A: The category of Lie algebras is equivalent to a certain category of cocommutative Hopf algebras, with the equivalence given by sending a Lie algebra $\mathfrak{g}$ to its universal enveloping algebra $U(\mathfrak{g})$. These cocommutative Hopf algebras can in turn be thought of as group objects in a certain category of cocommutative coalgebras, and hence can potentially pop up as automorphism objects in any category enriched over cocommutative coalgebras. 
You might object that you don't know any interesting examples of such categories, but in fact you do: the category of commutative algebras admits such an enrichment (see the nLab), and this is one abstract way to see why Lie algebras can act on commutative algebras (by derivations). 
Speaking more philosophically, you should expect to be able to extract Lie algebras from any situation where you can cook up a sensible notion of infinitesimal automorphism or more generally an infinitesimal element of some group. Enriching over cocommutative coalgebras gives you one fairly general way to do this; if $X$ is an object in your category and $\text{End}(X)$ is the cocommutative bialgebra of endomorphisms of $X$, then the primitive elements of $\text{End}(X)$ (the ones satisfying $\Delta X = 1 \otimes X + X \otimes 1$, where $1 = \text{id}_X \in \text{End}(X)$) should be regarded as the infinitesimal endomorphisms of $X$, and indeed these naturally form a Lie algebra under the commutator bracket. 
A: 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).
