lxc config device \
add pgpp postgres-forward \
proxy listen=tcp:0.0.0.0:5432 \
connect=tcp:127.0.0.1:5432
How to forward a port from an instance to the host in LXD
General
PostgreSQL
Linux
LXD/LXC
  • In the example below, "pgpp" is containers name.
  • "postgres-forward" is the name of the rule (device).

- adds a rule with a specific name
- rule forwards specific port to another one