Last Updated: February 25, 2016
· fluxsauce

Installing etckeeper to store config with autopush to git in Ubuntu 14.04 LTS

etckeeper - - is a great utility for automatically storing your server configuration in git, because configuration should be tracked like any other program. Ubuntu includes a package for it, but by default it uses Bazzar (Canonical's versioning system) instead of git as the author intended. To quote the README:

It's possible that your distribution has chosen to modify etckeeper so its default VCS is not git -- if they have please complain to them, as they're making things unnecessarily difficult for you, and causing unnecessary divergence of etckeeper installations.


Takes a bit of tweaking out-of-the-box. Let me save you some time.

# Login as root.
sudo su
# Install etckeeper.
apt-get -y install etckeeper
# Edit the etckeeper configuration.
nano /etc/etckeeper/etckeeper.conf

Uncomment the GIT line and comment out bzr.




Exit & save.

# Go to the configuration directory.
cd /etc
# Initialize etckeeper.
etckeeper init
# Add the remote repository.
git remote add origin git@HOSTNAME:REPONAME
# First commit.
etckeeper commit "Initial commit."
# Set the upstream and push.
git push -u origin master
# We're done here.

Etckeeper will now automatically push commits to your git repository.

1 Response
Add your response

Browsing about this topic I found that if you have an application at the top of your stack with a configuration outside of /etc you can also store it's configuration in the etckeeper repository, to make commits to both application, stack and system configuration in the same changesets in the same repo:

However, I still have some questions on this if you know anything about them:

I understand however that if your repo gets to be too big, you can run etckeeper vcs gc if you're using git, and if it gets way too big you can get rid of the changes using etckeeper uninit.

Also I believe that it's also possible to use something like sshfs to mount a share on another machine if you wish to keep the etckeeper repo somewhere else where it won't take up so much space on the production server.

This is a pretty good post too:

over 1 year ago ·