LXD: Create Port Forwarding from host to container


Create Port Forwarding

lxc config device add container_name port80 proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:80

This command create a port mapping with custom name "port80" from host (lxd server on 0.0.0.0:80) to container (container_name on 127.0.0.1:80)

Delete Port Forwarding

lxc config device remove container_name port80

Remove port mapping, named port80, related to container "container_name"

Show Port Forwardings

lxc config device show container_name





Comments