Mar 17, 2013

Setting up a CVS server on Ubuntu

Installing a local CVS server can be really useful although you do not have huge information to control or many people working on the same project. You can just want to have controlled all your documents. For this case and many others, you can quickly set up a version controller such as CVS.

So let's get started by installing the CVS client and server (Ubuntu Server 12.10). During the installation, you have to choose a name for your repository (or repositories). In my case I went with "myrepos".

$ sudo aptitude install cvs cvsd

Then you have to initialize the repository and change the directory where CVS lock files will be dropped off (instead of directly in the repository by default). Remember to create that new directory.

$ sudo cvs -d /var/lib/cvsd/myrepos init

$ sudo vim /var/lib/cvsd/myrepos/CVSROOT/config

$ sudo mkdir /var/lib/cvsd/tmp/myrepos

Now you only have to create an user for the repository and modify its owner.

$ sudo cvsd-passwd /var/lib/cvsd/myrepos javi
/usr/sbin/cvsd-passwd: adding user 'javi' to '/var/lib/cvsd/myrepos/CVSROOT/passwd'

$ sudo chown -R cvsd:cvsd /var/lib/cvsd

Let's restart the server and check it out from the localhost.

$ sudo /etc/init.d/cvsd restart

$ sudo cvs -d :pserver:javi@localhost:/myrepos login
Logging in to :pserver:javi@localhost:2401/myrepos
CVS password: 


  1. Today CVS is a control management system (CMS) almost outdated. You should think replacing it by SVN if you want a centralized CMS, or GIT/Mercurial if you prefer a distributed CMS. Distributed CMS are better when you work for a huge project with hundreds of developers spread all over the world.

    1. You're right. It happens that at work we have been working with CVS so far. I just wanted to install a CVS server in order to practice a little bit. Anyway, we are migrating to GIT now. In fact, our CVS server is going to be switch off next week. I have been testing the Eclipse plugin for GIT (EGit) and works really well.