Using Flockport with Jiffybox   December 18th, 2014

I am interested in the idea of Flockport: providing ready built LXC containers for download. So I wanted to try to see how I can actually download a Flockport container and install it on a Jiffybox (the German equivalent to the American Linode…)

See also my old post: LXC Linux containers on JiffyBox running CentOS on Ubuntu

So, I install a Jiffybox with Ubuntu 14.04 64 bit operating system, 2 GB RAM.

Install lxc (currently 1.0.6) from the default Ubuntu repositories:

apt-get install lxc

Now to Flockport: Check out these pages, my next steps are based on the instructions there:

I chose the WordPress container as an example. See

I wanted to download the Debian Wheezy 64 Bit package called wordpress.tar.xz, but that does not work like that, because you need to be logged in.

Here comes the Flockport utility into play. It is currently in Alpha, but it works ok, even on Ubuntu, though it is only advertised for Debian:

To install the Flock utility, follow these steps:

apt-key add flockport.gpg.key
echo "deb wheezy main" > /etc/apt/sources.list.d/flockport.list
apt-get update
apt-get install flockport

Note that I am not installing lxc from the Flockport repository, but only the Flockport utility.

Some useful commands with the Flockport utility:

#shows all Flockport containers available
flockport list 
# login with your username and password for
flockport login
# download a container, the names were displayed by the list command above
flockport get wordpress

The Flockport utility will download the container, and extract it to /var/lib/lxc.

# shows the new container
lxc-ls -f
# start the container
lxc-start -d -n wordpress 
# now show the running container, and the currently used IP address:
lxc-ls -f 
#wordpress RUNNING  -     NO

To make this container accessible to the outside, you can use iptables:

containerIP=`lxc-ls -f -F name,ipv4 | grep wordpress | awk '{ print $2 }'`
interface=`cat /etc/network/interfaces | grep "auto" | grep -v "auto lo" | awk '{ print $2 }'`
HostIP=`ifconfig ${interface} | grep "inet addr" | awk '{ print $2 }' | awk -F ':' '{ print $2 }'`
iptables -t nat -A PREROUTING -d ${HostIP}/32 -i ${interface} -p tcp -m tcp --dport 80 -j DNAT --to-destination ${containerIP}:80
echo "make sure that resolves to this HostIP: " ${HostIP}

If resolves to the IP of your Jiffybox, then you can visit the WordPress installation by browsing to

To change the domain name from to the actual domain name that you want to use, you have to first go into, login with username admin and password flockport, change the password, and change in General Settings the WordPress URL and the Site URL to your desired domain name, eg.

You also have to change the Nginx configuration inside the container to replace the domain name with your actual domain name for your website:

# switch inside the container
lxc-attach -n wordpress
# unfortunately no vi available, but nano will do as well:
nano /etc/nginx/sites-available/
# add or your domain name to the 4th line:
#    server_name;
# leave nano with Ctrl-X, and don't forget to save...
# reload nginx for the change of configuration to take effect
service nginx reload

Now you can reach the server on your own domain name, that points to your Jiffybox!

Tags: , ,
This entry was posted on Thursday, December 18th, 2014 at 7:46 pm and is filed under Software Development. You can follow any responses to this entry through the RSS 2.0 feed.Both comments and pings are currently closed.

No Responses