The title says it all. This blog and my personal website they're both running on a RaspberryPi, along with another things. Basically these were the steps I took to get Ghost working on my RaspberryPi and make it visible to the world.

All steps were done through SSH, but you can use the Terminal on RaspberryPi.

Install Node

First, update and upgrade.

sudo apt-get update
sudo apt-get upgrade

Now let's get the latest version of node, compile and install.

cd
wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
tar -zxvf node-v0.10.24.tar.gz
cd node-v0.10.24
./configure
make (this one is going to take A LOT of time)
sudo make install

To test the installation just check node version.

node -v

Install SQLite

sudo apt-get install sqlite3

Install NPM

Although npm is already installed, it's not the latest version (mine wasn't). Let's do that.

git clone git://github.com/isaacs/npm.git
cd npm/scripts
chmod +x install.sh
sudo ./install.sh
sudo npm cache clean

Check npm version.

npm -v

Install Ghost

Now, create the folder where you want to store your blog. In my case, I already have my RaspberryPi configured as a web server running lighttpd, so I stored where I already had other pages.

sudo mkdir /var/www/blog.semeano.me

Download the latest version of Ghost, unzip and install.

cd /var/www/blog.semeano.me
sudo wget https://ghost.org/zip/ghost-latest.zip
sudo unzip ghost-latest.zip
sudo npm install --production

The installation takes a while, so seat back.

Before starting up Ghost you need to do some minor changes do config.js. Actually, that file doesn't exist because it's named differently. Make a copy and open with nano to edit it.

sudo cp config.example.js config.js
sudo nano config.js

Now you need to change some development and production entries. In order to make it visible change the url and host entries with the IP of the RaspberryPi, which in my case is 192.168.2.2 (if you don't know yours check with ifconfig).

development: {
[...]
url: '192.168.2.2:2368',
[...]
host: '192.168.2.2',
[...]
production: {
[...]
url: 'http://blog.semeano.me',
[...]
host: '192.168.2.2',

Actually, I think you don't need to change de development entries because, by default, you'll be running the production enviroment.

Save (Ctrl+O and Enter) and close (Ctrl+X).

Ok, now you can start Ghost.

sudo npm start

And you can start blogging by typing the IP of the RaspberryPi on your browser. Don't forget that Ghost is running by default on port 2368.

http://192.168.2.2:2368/signup

Configure Lighttpd

Now, to make it available to the rest of the world, first you need to configure the subdomain on your registrar, in my case blog.semeano.me, and redirect it to your public IP. And don't forget to configure your router to redirect all port 80 requests to your RaspberryPi.

After that, on Lighttpd, all you have to do is to add a proxy entry on lighttpd.conf file.

$HTTP["host"] == "blog.semeano.me" {
 proxy.balance = "hash"
 proxy.server  = ( "" => (( "host" => "192.168.2.2", "port" => 2368 )))
}

Don't forget to add mod_proxy on server.modules.

Run Ghost on startup

When you start ghost with the last command you have a problem. If you close the terminal, or signout from SSH, Ghost is ended and your blog is no longer available.
So the solution is to start Ghost when the RaspberryPi is booting.

This part is well explained on Ghost docs, and you have diferent options, but I've choose to create the init script. Now everytime the RaspberryPi reboots I don't have to worry, Ghost will be running already.