Cells within Bacillus subtilis biofilms are held in place by an extracellular matrix that contains cell-anchored amyloid fibres, composed of the amyloidogenic protein TasA. As biofilms age they disassemble because the cells release the amyloid fibres. This release appears to be the consequence of incorporation of D-tyrosine, D-leucine, D-tryptophan and D-methionine into the cell wall. Here, we characterize the in vivo roles of an accessory protein TapA (TasA anchoring/assembly protein; previously YqxM) that serves both to anchor the fibres to the cell wall and to assemble TasA into fibres. TapA is found in discrete foci in the cell envelope and these foci disappear when cells are treated with a mixture of D-amino acids. Purified cell wall sacculi retain a functional form of this anchoring protein such that purified fibres can be anchored to the sacculi in vitro. In addition, we show that TapA is essential for the proper assembly of the fibres. Its absence results in a dramatic reduction in TasA levels and what little TasA is left produces only thin fibres that are not anchored to the cell.