Table of Contents

Create LXC Templates

Every time inspiration struck or I saw a blog post with something I wanted to try, it was frustrating and time consuming to get the base operating system set up to the way I like it before proceeding with the project.

Now I just update the template each point release or when I add something substantial to my dotfiles so it's ready to go whenever I need to spin up a fresh container.

It only takes a few minutes to set up or modify and can save lots of time in the long run.


Select an Image


Create the Container

Now we need to create the container that we will be updating and adding our programs to. Note that you will need to modify the following command to match your system.


Modify the Container

Here's where we update/add programs/configure it to our liking.


Create the template

In order to turn the container into a template, we need to delete the network interface then create a backup.


Cleaning up

Feel free to delete the container we used to make the template (250).


Modifying or Updating

It's really easy to modify the container when a new version of the OS is released or you want to add something to your templates.


Conclusion

Now every time you want to create a lxc container to use, it will be ready to go with things set just the way you like!