We demonstrate a flexible assembly method for producing linear metal nanoparticle chains embedded in nanotubes. The chain formation is based on the Rayleigh instability after annealing metal nanowires confined in nanotubes. Beginning with metal nanowires from arbitrary synthesis methods, atomic layer deposition (ALD) was applied to coat the wires first with a sacrificial layer then with a shell layer. Subsequently, the sacrificial layer was removed leading to confined wires in nanotubes with a free volume. Finally, embedded nanoparticle chains were produced inducing the Rayleigh instability by annealing the confined nanowires. This method is quite general not only for different metals but also for different shell materials. We are able to tune the particle spacing and diameter, the shape of the nanochains, the tube diameter and the shell thickness by ALD significantly.