Your hosting is up for renewal.
You have a spare Raspberry Pi and a fibre connection with a static IP address.
You are bored.


Build a secure and surprisingly fast platform to blog from the comfort of your own home, with the following components:

  1. Raspberry Pi 2 (or 3+ if you one).
  2. Uncomplicated Firewall, adds a layer of security and comfort.
  3. Nginx, free, open-source, high-performance HTTP server and reverse proxy.
  4. MariaDB, popular database server.
  5. Ghost, lightweight and simple blogging platform - RECOMMENDED!
High Level Steps
  1. Update the system.
  2. Install the necessary software components.
  3. Configure the UFW firewall.
  4. Configure and secure MariaDB.
  5. Install Ghost.
  6. Configure Ghost.
  7. Start blogging.
# Update the system.
sudo apt-get update && sudo apt-get dist-upgrade -y

# Install the necessary software components.
sudo apt-get install ufw, nginx, mariadb-server -y
curl -sL | sudo -E bash
sudo apt-get install -y nodejs

# Configure the firewall.
sudo ufw allow from to any port 22
sudo ufw allow 'Nginx Full'
sudo ufw enable

# Prepare for Ghost Install
# Make a new directory for Ghost and grant permissions.
sudo mkdir /var/www/ghost
sudo chown pi:pi /var/www/ghost

# Install Ghost-CLI.
sudo npm i -g [email protected]

Secure MariaDB Server:
# Configure and secure MariaDB.
sudo mysql_secure_installation

Follow the wizard and answer 'Yes' to the questions.

# Grant user root privileges so that Ghost CLI can create the databases automatically.
sudo mysql -u root -p

USE mysql
UPDATE user SET plugin='mysql_native_password' WHERE User='root';

Configure Ghost:
# Create production Ghost instance.
cd /var/www/ghost
ghost install

Answer the section prompts as appropriate.
For details, check out the CLI reference cli-install#section-prompts
Ghost is now installed. Happy blogging!

Next Steps

Some things you should do,

  • Secure your blog with SSL encryption.
  • High Availability (Docker Swarm).
  • Backup.