  We show how to do gauge theory on the octonions and other nonassociative
algebras such as `fuzzy $R^4$' models proposed in string theory. We use the
theory of quasialgebras obtained by cochain twist introduced previously. The
gauge theory in this case is twisting-equivalent to usual gauge theory on the
underlying classical space. We give a general U(1)-Yang-Mills example for any
quasi-algebra and a full description of the moduli space of flat connections in
this theory for the cube $Z_2^3$ and hence for the octonions. We also obtain
further results about the octonions themselves; an explicit Moyal-product
description of them as a nonassociative quantisation of functions on the cube,
and a characterisation of their cochain twist as invariant under Fourier
transform.
