To rename an LXD/LXC container, use the following command:
lxc move <old-name> <new-name>
Where <old-name>
is the current name of the container and <new-name>
is the desired new name. Make sure that the new name is not already in use by another container.