This paper considers a model of linear capital taxation for an economy where capital and labor income are subject to idiosyncratic uninsurable risk. To keep the model tractable, we assume that investment decisions are made before uncertainty is realized, so that the realization of the capital and labor income shocks only affects current consumption. In this setting, we are able to jointly analize capital and labor income risk and derive analitical results regarding the optimal taxation of capital. We find that the optimal capital tax is positive in the long run if there is only capital income risk. The reason for this is that the capital tax provides insurance against capital income risk. Furthermore, for high levels of risk, increasing the capital tax may actually induce capital accumulation. On the other hand, if there is only labor income risk the optimal capital tax is zero. The sign of the optimal tax can only be negative if the two types of risk are negatively correlated and labor income risk is large enough.