# LXD port forwarding

In 
Published 2021-08-29

# opening ports on LXD

Let's make an example and use it to explain how to do It.

Easiest way to open a specific port in lxd container, is by using proxy device

lxc config device add example123 pdevice09093 proxy listen=tcp:0.0.0.0:09093 connect=tcp:127.0.0.1:09093
  1. lxc config device add - adds device to our container
  2. example123 - name of your container
  3. listen=tcp:0.0.0.0:09093 - listening to 09093 port
  4. connect=tcp:127.0.0.1:09093 - connecting to our container using existing 09093 TCP port on localhost