# LXD port forwarding

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: connect=tcp:
  1. lxc config device add - adds device to our container
  2. example123 - name of your container
  3. listen=tcp: - listening to 09093 port
  4. connect=tcp: - connecting to our container using existing 09093 TCP port on localhost