We introduce twisted Steinberg algebras over a commutative unital ring $R$. These generalise and are purely algebraic analogue of Renault's groupoid C*-algebras. In particular, for each ample Hausdorff $G$ locally constant $2$-cocycle $\sigma$ on taking values in the units $R^\times$, we study algebra $A_R(G,\sigma)$ consisting compactly supported $R$-valued functions $G$, with convolution invo...