TurnKey LXC

Create inithooks configuration (/root/wp1.conf)

export ROOT_PASS=secretrootpass
export DB_PASS=secretmysqlpass
export APP_PASS=secretadminwppass
export APP_EMAIL=admin@example.com
export APP_DOMAIN=www.example.com
export HUB_APIKEY=SKIP
export SEC_UPDATES=FORCE

Create LXC container

lxc-create -n wp1 -t turnkey -- wordpress -i /root/wp1.conf

Start the container in the background

lxc-start -n wp1 -d

Create inithooks configuration (/root/wp1.conf)

export ROOT_PASS=secretrootpass
export DB_PASS=secretmysqlpass
export APP_PASS=secretadminwppass
export APP_EMAIL=admin@example.com
export APP_DOMAIN=www.example.com
export HUB_APIKEY=SKIP
export SEC_UPDATES=FORCE

Create LXC container

lxc-create -n wp1 -t turnkey -- wordpress -i /root/wp1.conf -l natbr0

Start the container in the background

lxc-start -n wp1 -d

Configure proxying web requests for domain to container

nginx-proxy www.example.com wp1

Expose the container SSH service

ipaddr=$(host wp1 | cut -d " " -f 4)
iptables-nat add 2222 $ipaddr:22