We establish explicit socially optimal rules for an irreversible investment decision with time-to-build and uncertainty. Assuming a price sensitive demand function with a random intercept, we provide comparative statics and economic interpretations for three models of demand (arithmetic Brownian, geometric Brownian, and the Cox-Ingersoll-Ross). Committed capacity, that is, the installed capacity plus the investment in the pipeline, must never drop below the best predictor of future demand, minus two biases. The discounting bias takes into account the fact that investment is paid upfront for future use; the precautionary bias multiplies a type of risk aversion index by the local volatility. Relying on the analytical forms, we discuss in detail the economic effects.