The amyloid fold is usually considered a result of protein misfolding. However, a number of studies have recently shown that the amyloid structure is also used in nature for functional purposes. CsgA is the major subunit of Escherichia coli curli, one of the most well-characterized functional amyloids. Here we show, using a highly efficient approach to prepare monomeric CsgA, that in vitro fibrillation of CsgA occurs under a wide variety of environmental conditions and that the resulting fibrils exhibit similar structural features. This highlights how fibrillation is "hardwired" into amyloid that has evolved for structural purposes in a fluctuating extracellular environment and represents a clear contrast to disease-related amyloid formation. Furthermore, we show that CsgA polymerization in vitro is preceded by the formation of thin needlelike protofibrils followed by aggregation of the amyloid fibrils.