Here’s a guide to take a fresh Debian stable (Etch) install and turn it into a viable Lisp web development environment. (Including Emacs22, SBCL, Slime, Hunchentoot, Apache2 all working together from boot)

Please note that this guide assumes you’re using a fresh installation of Debian stable.

All the commands assume you are logged in as root on your soon-to-be web server.

Installation Steps

# Install Emacs 22
echo deb etch backports >> /etc/apt/sources.list
wget -O- | apt-key add -
apt-get update
apt-get install emacs22

# Install the other required packages
apt-get install darcs cvs subversion curl git-core cogito sbcl make gcc build-essential detachtty

# Grab clbuild
cd /usr/src
darcs get
cd clbuild && chmod +x clbuild

# Install the different bits and bobs with clbuild
./clbuild update sbcl
./clbuild compile-implementation sbcl
echo cl-unicode get_darcs >> projects
echo metabang-bind get_darcs >> projects
echo stefil get_darcs >> projects
echo cffi get_darcs >> projects
./clbuild build cl-unicode cl-ppcre hunchentoot vecto cl-who slime metabang-bind iterate stefil babel cffi

# Make a Lisp image
./clbuild dumpcore --installed

# Setup Lisp to start on boot
cd /etc/init.d
chmod a+x lisp-boot
cd /etc/rc2.d
ln -s ../init.d/lisp-boot S98lispboot
mkdir /var/run/lisp

# Add the lisp user for Lisp to run as
adduser lisp-user
touch /var/log/detachtty.log
touch /var/log/lisp-app-dribble
chown lisp-user:lisp-user /var/log/detachtty.log
chown lisp-user:lisp-user -R /var/run/lisp
chown lisp-user:lisp-user /var/log/lisp-app-dribble

# Make it so Lisp will start the webserver and swank server each time
cd /usr/src/clbuild/
mkdir /var/lisp && cd /var/lisp
mkdir images && cd images
chmod g+w -R /var/lisp
chown -R lisp-user:lisp-user /var/lisp

# Grab Apache2 and set it up with modlisp
apt-get install apache2 cl-modlisp libapache-mod-lisp apache2-threaded-dev
cd /etc/apache2/sites-available/
rm default && wget
cd /etc/apache2/mods-enabled
cd /usr/lib/apache2/modules

# Get rid of the old SBCL that comes with Debian (Thanks Todd)
apt-get remove sbcl
echo SBCL_HOME=/usr/src/clbuild/target/lib/sbcl >> /etc/profile
ln -s /usr/src/clbuild/target/bin/sbcl /usr/bin/sbcl
ln -s /usr/src/clbuild/target/lib/sbcl /usr/local/lib/sbcl
cd /usr/src/clbuild/target/lib/sbcl && rm -r site-system
ln -s /usr/lib/sbcl/* .

# Start it all running
/etc/init.d/apache2 restart
/etc/init.d/lisp-boot start

# Set up Emacs (Run as the user who will use Emacs)
cd ~ && wget


  • Browse to http://SERVERNAME/lisp to view your website.
  • Type emacs /var/lisp/server.lisp to start editing the little example page.
  • Type M-x slime-connect RET RET in Emacs to connect to the running Lisp REPL


  • Add your user to the lisp-user group to edit the files
  • Make sure you have downloaded the .emacs for your user so slime-connect works properly

Leave a comment if you hit a problem and I’ll try and help - Dave.

Edit: Thanks to Todd for some good feedback, I have added some extra commands that help to get rid of the outdated version of SBCL which comes with Debian, while still making use of Debian’s cl package. (That’s the hope anyway, let me know if it worked for you / if there’s a better way to do that part)