We apply the recently developed dual fermion algorithm for disordered interacting systems to the Anderson-Hubbard model. This algorithm is compared with dynamical cluster approximation calculations for a one-dimensional system to establish the quality of the approximation in comparison with an established cluster method. We continue with a three-dimensional (3d) system and look at the antiferromagnetic, Mott and Anderson localization transitions. The dual fermion approach leads to quantitative as well as qualitative improvement of the dynamical mean-field results and it allows one to calculate the hysteresis in the double occupancy in 3d taking into account nonlocal correlations.