Problem to copy an image from a server that is loacated behind NAT

I have an LXD server v.3.0.3 where I prepare my custom LXD images. This server is located on LAN and not accessible from the Internet. I would like to copy the prepared images to another Internet-based LXD server (v.5.0.1).
I have configured the ‘remote’ on the local server and can communicate with the remote server: get the list of images, etc. The only problem is that I am not able to copy an image from the local server to the remote server:

lxc image copy local:1d9edfcb4406  updates: --copy-aliases 
Error: Failed remote image download: Failed to connect to LXD server "": Get "": Unable to connect to: ([dial tcp i/o timeout])

where is the IP address of my local server.
According to the error message, the remote server tries to connect to the local server.
If so, then how can I avoid it?

Thank you.

Try --mode push or --mode relay – the default is pull, which does exactly what you’re seeing.

1 Like

The option ‘–mode’ is not available in LXD 3.0.3:

lxc image copy local:cuad-5.2.8rc4  updates: --copy-aliases  --mode push 
Error: unknown flag: --mode

Well, then you don’t really have much choice. You can either upgrade LXD or export the image to a file and use e.g. SCP to copy the image to the target.

Ok, thank you.