[2013–11–05] Setting up a Raspberry Pi web server using Node & Express

  • USB Keyboard
  • Monitor
  • Ethernet connection
  • HDMI Cable or Video Composite Cable
  • Raspberry Pi
  • Power Source
  • 4GB SD Card
  • GitHub Account
  • A computer for SSH access, and formatting the SD card (OSX assumed for this tutorial)
  • USB WiFi Dongle (or not if you stick with Ethernet)

Installing Raspian

The first thing that you’re going to need to get going on your Pi is an operating system, and for this walkthrough I’m using Raspian, a popular Raspberry Pi specific flavor of Debian. To start, you’ll need to download the latest .zip version of Raspian. Once you have the file, you’ll want to unzip it, revealing the OS image.

Filesystem      Size   Used  Avail  Capacity  Mounted on
/dev/disk0s2 465Gi 117Gi 348Gi 26% /
devfs 193Ki 193Ki 0Bi 100% /dev
map -hosts 0Bi 0Bi 0Bi 100% /net
map auto_home 0Bi 0Bi 0Bi 100% /home
Filesystem      Size   Used  Avail  Capacity  Mounted on
/dev/disk0s2 465Gi 117Gi 348Gi 26% /
devfs 193Ki 193Ki 0Bi 100% /dev
map -hosts 0Bi 0Bi 0Bi 100% /net
map auto_home 0Bi 0Bi 0Bi 100% /home
/dev/disk1s1 15Gi 1.1Mi 15Gi 1% /Volumes/SD
sudo dd if=2013-09-25-wheezy-raspbian.img of=/dev/rdisk1 bs=1m
rasberrypi login:

Setting up SSH

Reference

sudo /etc/init.d/ssh start
sudo update-rc.d ssh defaults

Setting up WiFi

Now we want to set up our WiFi dongle with the device so that we don’t have to plug it in via ethernet every time we want to use it. To scan for wifi networks, run iwlist scan. Once you locate the network you want,open up your interfaces config by using sudo nano /etc/network/interfaces. Edit the file to look like the following:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0


iface wlan0 inet dhcp
wpa-ssid "NETWORK_NAME"
wpa-psk "NETWORK_PASSWORD"

Installing NodeJS

Reference

PATH=$PATH:/opt/node/bin
export PATH

Setting up your Pi with GitHub

Reference

Backing up your Pi

Reference

dd if=/dev/rdiskx of=/path/to/image bs=1m

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Neil Dahlke

Neil Dahlke

Engineer. @hashicorp , formerly @memsql , @UChiResearch . @depaulu alum.