Raspberry Pi as Homeserver

This page describes the setup of a Raspberry Pi as Homeserver with the following functions:

Basic Installation

Download Debian Wheezy image (2012-08-08-wheezy-armel.zip) from Raspberry Pi homepage.

Unzip image and write it to SD card.

# dd bs=4M if=/home/seelmann/Development/RPi/2012-08-08-wheezy-armel.img of=/dev/mmcblk0

Mount partitions.

Use maximum memory for applications as the Pi is operated in headless mode and no video output is required.

# cp arm240_start.elf start.elf

Create link to start SSH server:

# cd etc/rc2.d
# ln -s ../init.d/ssh S03ssh

Set a static IP address:

# cat /etc/network/interfaces 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
  address 192.168.2.2
  netmask 255.255.255.0
  gateway 192.168.2.1

# cat /etc/resolv.conf
nameserver 192.168.2.1

Boot the Pi.

Connect via SSh.

$ ssh pi@192.168.2.2

Run basic Pi configuration:

$ sudo raspi-config

Delete unused software packages, in reverse order of /var/log/apt/history.log, including automatically installed packages:

# apt-get purge --auto-remove scratch
# apt-get purge --auto-remove debian-reference-en dillo idle3 python3-tk idle python-pygame python-tk
# apt-get purge --auto-remove lightdm gnome-themes-standard gnome-icon-theme raspberrypi-artwork
# apt-get purge --auto-remove gvfs-backends gvfs-fuse desktop-base lxpolkit netsurf-gtk zenity xdg-utilse
# apt-get purge --auto-remove mupdf gtk2-engines alsa-utils  lxde lxtask menu-xdg gksu
# apt-get purge --auto-remove midori xserver-xorg xinit xserver-xorg-video-fbdev
# apt-get purge --auto-remove libraspberrypi-dev libraspberrypi-doc
# apt-get purge --auto-remove dbus-x11 libx11-6 libx11-data libx11-xcb1 x11-common x11-utils
# apt-get purge --auto-remove lxde-icon-theme gconf-service gconf2-common

Upgrade

# apt-get update
# apt-get dist-upgrade
# apt-get install cups

Allow remote administration:

# cupsctl --share-printers --remote-admin --remote-printers

Add pi user to lpadmin group:

# usermod -a -G lpadmin pi

Use CUPS web UI:

https://192.168.2.2:631/admin/

Scan Server

# apt-get install sane-utils libsane

Test if scanner is supported:

# sane-find-scanner
# scanimage -L

Allow remote access

# cat /etc/sane.d/saned.conf 
192.168.2.0/24

Activate saned:

# cat /etc/default/saned
RUN=yes
RUN_AS_USER=saned

# /etc/init.d/saned start

On the client add the IP of the scan server to /etc/sane.d/net.conf:

# cat /etc/sane.d/net.conf
192.168.2.2

Chat Server

# apt-get install prosody
# prosodyctl adduser foo@localhost

Sources