For testing things on this same machine more generally though, you may want to look into using VMs for isolation. Assuming you've got memory to spare you can boot up full operating systems with virt-manager:
That's actually how I test/dev across OS's/Architectures
If resources are a little more scarce there's also linux containers, sort of like docker in that it's lightweight, but a little easier to use like a VM. Ubuntu actually maintains the tooling for these:
restlisten=localhost:8080
systemctl --user restart lnd && systemctl --user restart lightning_pub