April 21, 2016

Quick & Easy: LXC Container on Ubuntu 16.04

Quick & Easy: LXC Container on Ubuntu 16.04

Install lxc
apt-get install lxc -y

create container with latest ubuntu
sudo lxc-create -n loki -t ubuntu

create container with ubuntu 14.04
sudo lxc-create -t download -n loki -- -d ubuntu -r trusty -a amd64

start container
sudo lxc-start -n loki

login to container
sudo lxc-attach -n loki

or you can run
sudo lxc-create -n loki -t ubuntu && lxc-start -n loki && lxc-attach -n loki

run a test with caddy http server


find ip of container

check if port is open on container

setup forwarding manually

Distroy container

sources:unixmen, Arch, do, cyberciti

  • LinkedIn
  • Tumblr
  • Reddit
  • Pinterest
  • Pocket
DigitalOcean Referral Badge
Keep my site online & receive a $200 60-day credit at DigitalOcean for your VPS Hosting
Cheaper Games on Instant-Gaming
Creative Commons Licence